You can ignore this post
BeginIf ( myglobal == 1 ) set myglobal to 0 "NPCname"->SetAtStartendifend
BeginIf ( myglobal == 1 ) set myglobal to 0 "NPCname"->SetAtStartendifend
begin RAK_tg_kidnappingshort chanceshort oppositionshort initialshort doonceshort currentdayshort varcleanshort oncedoshort threedayshort didonceshort pspeeshort pstrfloat nfightfloat nfleefloat nalarmif ( initial == 0 ) set nfight to ( getfight ) set nflee to ( getflee ) set nalarm to ( getalarm ) set doonce to 0 set varclean to 0 set oncedo to 0 set threeday to 0 set didonce to 0 set opposition to ( ( GetSpeechcraft ) + random100 ) set pspee to ( "player"->GetSpeechcraft ) set pstr to ( "player"->GetStrength ) set chance to ( pspee + pstr ) set initial to 1 returnendifif ( gethealth < 1 ) setfight nfight setflee nflee setalarm nalarm set varclean to 1endifif ( ( getpccell "Balmora, South Wall Cornerclub" ) == 1 ) if ( ( "player"->getdistance ) <= 200 ) set RAK_kidnap to 4 set RAK_ba_ransom to 1 endifelseif ( ( getpccell "Ald-ruhn, The Rat In The Pot" ) == 1 ) if ( ( "player"->getdistance ) <= 200 ) set RAK_kidnap to 4 set RAK_ar_ransom to 1 endifelseif ( ( getpccell "Sadrith Mora, Dirty Muriel's Cornerclub" ) == 1 ) if ( ( "player"->getdistance ) <= 200 ) set RAK_kidnap to 4 set RAK_sm_ransom to 1 endifelseif ( ( getpccell "Vivec, Simine Fralinie: Bookseller" ) == 1 ) if ( ( "player"->getdistance ) <= 200 ) set RAK_kidnap to 4 set RAK_vc_ransom to 1 endifendifif ( RAK_kidnap == 0 ) if ( opposition < chance ) set RAK_kidnap to 1 return endifelseif ( RAK_kidnap == 1 ) if ( doonce == 0 ) aifollow "player" 0, 0, 0, 0 setfight 0 setflee 80 set doonce to 1 return elseif ( doonce == 1 ) if ( ( "player"->getdistance ) >= 500 ) set currentday to day set RAK_kidnap to 2 return else return endif endifelseif ( RAK_kidnap == 2 ) if ( currentday =! day ) set currentday to day setfight nfight setflee nflee setalarm nalarm setatstart set varclean to 1 return endif setfight 70 setflee 40 if ( oncedo == 0 ) AIWander 5000, 0, 0, 60, 30, 10, 0, 0, 0, 0, 0, 0 set oncedo to 1 return endifelseif ( RAK_kidnap == 3 ) if ( opposition < chance ) set doonce to 0 set RAK_kidnap to 1 return else moddisposition -30 set RAK_kidnap to 2 return endifelseif ( RAK_kidnap == 4 ) if ( didonce == 0 ) forcegreeting AIWander 200, 0, 0, 60, 30, 10, 0, 0, 0, 0, 0, 0 set didonce to 1 endif if ( currentday != day ) set currentday to day set threeday to ( threeday + 1 ) endifendifif ( threeday > 2 ) set RAK_ransom to ( ( getlevel ) * 10 ) setfight nfight setflee nflee setalarm nalarm setatstart set varclean to 1else returnendifif ( varclean == 1 ) set RAK_kidnap to 0 set doonce to 0 set varclean to 0 set oncedo to 0 set threeday to 0 set didonce to 0 set initial to 0 stopscript "RAK_tg_kidnapping"endifend
elseif ( RAK_kidnap == 1 ) if ( doonce == 0 ) aifollow "player" 0, 0, 0, 0 ;<--------this has to be defined (i think) if the script isn't attached to an NPC ex: "myNPC"->aiflollow "player" 0, 0, 0, 0 setfight 0 setflee 80 set doonce to 1 return
if ( ( getdistance "player" ) <= 500 )
begin RAK_tg_kidnappingshort GatherInfo;;;;;;;;;;;;;;;;;;;;;;;;;;;;short chanceshort oppositionshort initialshort doonceshort currentdayshort varcleanshort oncedoshort threedayshort didonceshort pspeeshort pstrfloat nfightfloat nfleefloat nalarm;;;;;;;;;;;;;;;;;;;;;;;;;;float NXFloat NYFloat NZLong MyCell;;;;;;;;;;;;;;;;;;;;;;;;if ( initial == 0 ) set nfight to ( getfight ) set nflee to ( getflee ) set nalarm to ( getalarm ) set doonce to 0 set varclean to 0 set oncedo to 0 set threeday to 0 set didonce to 0 set opposition to ( ( GetSpeechcraft ) + random, 100 ) set pspee to ( "player"->GetSpeechcraft ) set pstr to ( "player"->GetStrength ) set chance to ( pspee + pstr ) set initial to 1 returnendif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Ifx ( GatherInfo ) Set Nx to GetPos, X Set Ny to GetPos, Y Set Nz to GetPos, Z Setx MyCell to xMyCellId set gatherinfo to 0EndIf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;if ( gethealth < 1 ) setfight nfight setflee nflee setalarm nalarm set varclean to 1endifif ( ( getpccell "Balmora, South Wall Cornerclub" ) == 1 ) if ( ( getdistance, player ) <= 200 ) set RAK_kidnap to 4 set RAK_ba_ransom to 1 endifelseif ( ( getpccell "Ald-ruhn, The Rat In The Pot" ) == 1 ) if ( ( getdistance, Player ) <= 200 ) set RAK_kidnap to 4 set RAK_ar_ransom to 1 endifelseif ( ( getpccell "Sadrith Mora, Dirty Muriel's Cornerclub" ) == 1 ) if ( ( getdistance, Player ) <= 200 ) set RAK_kidnap to 4 set RAK_sm_ransom to 1 endifelseif ( ( getpccell "Vivec, Simine Fralinie: Bookseller" ) == 1 ) if ( ( getdistance, player ) <= 200 ) set RAK_kidnap to 4 set RAK_vc_ransom to 1 endifendifif ( RAK_kidnap == 0 ) if ( opposition < chance ) set RAK_kidnap to 1 return endifelseif ( RAK_kidnap == 1 ) if ( doonce == 0 );;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; set GatherInfo to 1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; aifollow "player" 0, 0, 0, 0 setfight 0 setflee 80 set doonce to 1 return elseif ( doonce == 1 ) if ( ( getdistance, player ) >= 500 ) set currentday to day set RAK_kidnap to 2 return else return endif endifelseif ( RAK_kidnap == 2 ) if ( currentday != day ) set currentday to day setfight nfight setflee nflee setalarm nalarm setatstart set varclean to 1 return endif setfight 70 setflee 40 if ( oncedo == 0 ) AIWander 5000, 0, 0, 60, 30, 10, 0, 0, 0, 0, 0, 0 set oncedo to 1 return endifelseif ( RAK_kidnap == 3 ) if ( opposition < chance ) set doonce to 0 set RAK_kidnap to 1 return else moddisposition -30 set RAK_kidnap to 2 return endifelseif ( RAK_kidnap == 4 ) if ( didonce == 0 ) forcegreeting AIWander 200, 0, 0, 60, 30, 10, 0, 0, 0, 0, 0, 0 set didonce to 1 endif if ( currentday != day ) set currentday to day set threeday to ( threeday + 1 ) endifendifif ( threeday > 2 ) set RAK_ransom to ( ( getlevel ) * 10 ) setfight nfight setflee nflee setalarm nalarm setatstart set varclean to 1else returnendififx ( varclean );;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; xPositionCell, NX, NY, NZ, 0, MyCell;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; set RAK_kidnap to 0 set doonce to 0 set varclean to 0 set oncedo to 0 set threeday to 0 set didonce to 0 set initial to 0 stopscript "RAK_tg_kidnapping"endifend
if ( threeday > 2 )
Need more room for zero pointers in script::ReplaceGlobalsInData
begin RAK_tg_kidnappingshort chanceshort oppositionshort initialshort doonceshort currentdayshort varcleanshort oncedoshort threedayshort didonceshort pspeeshort pstrshort GatherInfofloat nfightfloat nfleefloat nalarmfloat NXFloat NYFloat NZLong MyCellif ( initial == 0 ) set nfight to ( getfight ) set nflee to ( getflee ) set nalarm to ( getalarm ) set doonce to 0 set varclean to 0 set oncedo to 0 set threeday to 0 set didonce to 0 set Gatherinfo to 1 set opposition to ( ( GetSpeechcraft ) + random100 ) set pspee to ( "player"->GetSpeechcraft ) set pstr to ( "player"->GetStrength ) set chance to ( pspee + pstr ) set initial to 1 returnendifIfx ( GatherInfo ) Set Nx to GetPos, X Set Ny to GetPos, Y Set Nz to GetPos, Z Setx MyCell to xMyCellId set gatherinfo to 0EndIfif ( gethealth < 1 ) setfight nfight setflee nflee setalarm nalarm set varclean to 1endifif ( ( getpccell "Balmora, South Wall Cornerclub" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_ba_ransom to 1 endifelseif ( ( getpccell "Ald-ruhn, The Rat In The Pot" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_ar_ransom to 1 endifelseif ( ( getpccell "Sadrith Mora, Dirty Muriel's Cornerclub" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_sm_ransom to 1 endifelseif ( ( getpccell "Vivec, Simine Fralinie: Bookseller" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_vc_ransom to 1 endifendifif ( RAK_kidnap == 0 ) if ( opposition < chance ) set RAK_kidnap to 1 endifelseif ( RAK_kidnap == 1 ) if ( doonce == 0 ) aifollow "player" 0, 0, 0, 0 setfight 0 setflee 80 set doonce to 1 return elseif ( doonce == 1 ) if ( ( getdistance "player" ) >= 500 ) set currentday to day set RAK_kidnap to 2 return endif endifelseif ( RAK_kidnap == 2 ) if ( oncedo == 0 ) AIWander 5000, 0, 0, 60, 30, 10, 0, 0, 0, 0, 0, 0 set oncedo to 1 return endif if ( currentday != day ) set currentday to day setfight nfight setflee nflee setalarm nalarm xPositionCell, NX, NY, NZ, 0, MyCell set varclean to 1 return endif setfight 70 setflee 40elseif ( RAK_kidnap == 3 ) set opposition to ( ( GetSpeechcraft ) + random100 ) if ( opposition < chance ) set doonce to 0 set RAK_kidnap to 1 return else moddisposition -30 set RAK_kidnap to 2 return endifelseif ( RAK_kidnap == 4 ) if ( didonce == 0 ) forcegreeting AIWander 500, 0, 0, 60, 30, 10, 0, 0, 0, 0, 0, 0 set didonce to 1 endif if ( currentday != day ) set currentday to day set threeday to ( threeday + 1 ) endifendifif ( threeday > 2 ) set RAK_ransom to ( ( getlevel ) * 100 ) setfight nfight setflee nflee setalarm nalarm set RAK_kidnap to 5 xPositionCell, NX, NY, NZ, 0, MyCell set varclean to 1endifif ( varclean == 1 ) set RAK_kidnap to 0 set doonce to 0 set varclean to 0 set oncedo to 0 set threeday to 0 set didonce to 0 set initial to 0 stopscript "RAK_tg_kidnapping"endifend
begin RAK_tg_kidnappingshort chanceshort oppositionshort initialshort doonceshort currentdayshort varcleanshort oncedoshort threedayshort didonceshort pspeeshort pstrshort GatherInfofloat nfightfloat nfleefloat nalarmfloat NXFloat NYFloat NZLong MyCellif ( initial == 0 ) set nfight to ( getfight ) set nflee to ( getflee ) set nalarm to ( getalarm ) set doonce to 0 set varclean to 0 set oncedo to 0 set threeday to 0 set didonce to 0 set opposition to ( ( GetSpeechcraft ) + random100 ) set pspee to ( "player"->GetSpeechcraft ) set pstr to ( "player"->GetStrength ) set chance to ( pspee + pstr ) set initial to 1 returnendifIfx ( GatherInfo ) Set Nx to GetPos, X Set Ny to GetPos, Y Set Nz to GetPos, Z Setx MyCell to xMyCellId set gatherinfo to 0EndIfif ( gethealth < 1 ) setfight nfight setflee nflee setalarm nalarm set varclean to 1endifif ( ( getpccell "Balmora, South Wall Cornerclub" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_ba_ransom to 1 endifelseif ( ( getpccell "Ald-ruhn, The Rat In The Pot" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_ar_ransom to 1 endifelseif ( ( getpccell "Sadrith Mora, Dirty Muriel's Cornerclub" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_sm_ransom to 1 endifelseif ( ( getpccell "Vivec, Simine Fralinie: Bookseller" ) == 1 ) if ( ( getdistance "player" ) <= 200 ) set RAK_kidnap to 4 set RAK_vc_ransom to 1 endifendifif ( RAK_kidnap == 0 ) if ( opposition < chance ) set RAK_kidnap to 1 endifelseif ( RAK_kidnap == 1 ) if ( doonce == 0 ) aifollow "player" 0, 0, 0, 0 setfight 0 setflee 80 set Gatherinfo to 1 set doonce to 1 return elseif ( doonce == 1 ) if ( ( getdistance "player" ) >= 500 ) set currentday to day set RAK_kidnap to 2 return endif endifelseif ( RAK_kidnap == 2 ) if ( oncedo == 0 ) AIWander 5000, 0, 0, 60, 30, 10, 0, 0, 0, 0, 0, 0 set oncedo to 1 return endif if ( currentday != day ) set currentday to day setfight nfight setflee nflee setalarm nalarm xPositionCell, NX, NY, NZ, 0, MyCell set varclean to 1 return endif setfight 70 setflee 40elseif ( RAK_kidnap == 3 ) set opposition to ( ( GetSpeechcraft ) + random100 ) if ( opposition < chance ) set doonce to 0 set RAK_kidnap to 1 return else moddisposition -30 set RAK_kidnap to 2 return endifelseif ( RAK_kidnap == 4 ) if ( didonce == 0 ) forcegreeting AIWander 500, 0, 0, 60, 30, 10, 0, 0, 0, 0, 0, 0 set didonce to 1 endif if ( currentday != day ) set currentday to day set threeday to ( threeday + 1 ) endifendifif ( threeday > 2 ) set RAK_ransom to ( ( getlevel ) * 100 ) setfight nfight setflee nflee setalarm nalarm set RAK_kidnap to 5 xPositionCell, NX, NY, NZ, 0, MyCell set varclean to 1endifif ( varclean == 1 ) set RAK_kidnap to 0 set doonce to 0 set varclean to 0 set oncedo to 0 set threeday to 0 set didonce to 0 set initial to 0 stopscript "RAK_tg_kidnapping"endifend
set temp to ( MyVariable - 5 )ifx ( temp ) ; section for not 5else section for 5endif
if ( threeday > 2 ) set respawn to 1endififx ( respawn ) xPositionCell, NX, NY, NZ, 0, MyCellendif
if ( threeday > 2 ) set respawn to 1endififx ( respawn ) xPositionCell, NX, NY, NZ, 0, MyCellendif