Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin TR_m2_q_12_Counter
- ; q2-12-Misc Avenge the Knights
- ; Keeps track of the number of dead Cultists and dead Knights within Galseah.
- ; Nov2017edit: changed from global script to local script, and more fixes.
- ; changes /abot
- ; activators having the local script attached do not need to be persistent and can be disabled/setdeleted when done
- short wdead
- short i1
- float timer
- if ( MenuMode )
- return
- endif
- if ( timer < 0.85 )
- set timer to ( timer + GetSecondsPassed )
- return
- endif
- set timer to Random 1001
- set timer to ( timer * 0.0001 )
- set i1 to ( GetJournalIndex "TR_m2_Wil_AvengeKnights" )
- if ( i1 < 20 )
- return
- endif
- if ( wdead )
- else
- set wdead to 1
- StopScript TR_m2_q_12_Counter ; better stop any global script instance ASAP
- endif
- if ( i1 == 140 )
- disable
- elseif ( i1 == 130 )
- disable
- elseif ( i1 == 100 )
- disable
- elseif ( i1 == 90 )
- disable
- endif
- if ( GetDisabled )
- setdelete 1
- return
- endif
- if ( wdead != 2 )
- if ( i1 == 20 )
- if ( GetDeadCount "TR_m2_Merias Tolode" )
- if ( GetDeadCount "TR_m2_Tarbus Norin" )
- set wdead to 2
- Journal TR_m2_Wil_AvengeKnights 40
- endif
- endif
- endif
- endif
- if ( wdead == 5 )
- if ( i1 <= 40 )
- if ( i1 == 40 )
- Journal TR_m2_Wil_AvengeKnights 140
- Player->ModReputation 1
- return
- elseif ( i1 == 20 )
- if ( Player->GetDistance "TR_m2_Tarbus Norin" < 7500 )
- Journal TR_m2_Wil_AvengeKnights 70
- elseif ( Player->GetDistance "TR_m2_Merias Tolode" < 7500 )
- Journal TR_m2_Wil_AvengeKnights 70
- else
- Journal TR_m2_Wil_AvengeKnights 110
- endif
- endif
- set wdead to 6
- "TR_m2_Tarbus Norin"->AIWander 0 0 0 20 60 30 0 ; To ensure they stay put after defeating the cultists
- "TR_m2_Merias Tolode"->AIWander 0 0 0 20 30 60 0
- endif
- return
- endif
- ; GetDeadCounts nested in reverse order of difficulty to reach.
- ; The logic behind this: If the player has killed Joricas Rosard, then
- ; chances are good that he has already dealt with the rest since Joricas
- ; is the one most deep into the caves.
- ; Note that getDeadCount *is* a resource hog when the savegame is large. ;Nov2017edit: so noted. added timer.
- if ( GetDeadCount "TR_m2_O_Joricas Rosard" )
- if ( GetDeadCount TR_m2_O_Faricel )
- if ( GetDeadCount TR_m2_O_Gorthas )
- if ( GetDeadCount "TR_m2_O_Avala Garvas" )
- if ( GetDeadCount "TR_m2_O_Tirisar Garvas" )
- set wdead to 5
- endif
- endif
- endif
- endif
- endif
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement