Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. begin TR_m2_q_12_Counter
  2. ; q2-12-Misc Avenge the Knights
  3. ; Keeps track of the number of dead Cultists and dead Knights within Galseah.
  4.  
  5. ; Nov2017edit: changed from global script to local script, and more fixes.
  6.  
  7. ; changes /abot
  8. ; activators having the local script attached do not need to be persistent and can be disabled/setdeleted when done
  9.  
  10. short wdead
  11. short i1
  12. float timer
  13.  
  14. if ( MenuMode )
  15. return
  16. endif
  17.  
  18. if ( timer < 0.85 )
  19. set timer to ( timer + GetSecondsPassed )
  20. return
  21. endif
  22. set timer to Random 1001
  23. set timer to ( timer * 0.0001 )
  24.  
  25. set i1 to ( GetJournalIndex "TR_m2_Wil_AvengeKnights" )
  26. if ( i1 < 20 )
  27. return
  28. endif
  29.  
  30. if ( wdead )
  31. else
  32. set wdead to 1
  33. StopScript TR_m2_q_12_Counter ; better stop any global script instance ASAP
  34. endif
  35.  
  36. if ( i1 == 140 )
  37. disable
  38. elseif ( i1 == 130 )
  39. disable
  40. elseif ( i1 == 100 )
  41. disable
  42. elseif ( i1 == 90 )
  43. disable
  44. endif
  45.  
  46. if ( GetDisabled )
  47. setdelete 1
  48. return
  49. endif
  50.  
  51. if ( wdead != 2 )
  52. if ( i1 == 20 )
  53. if ( GetDeadCount "TR_m2_Merias Tolode" )
  54. if ( GetDeadCount "TR_m2_Tarbus Norin" )
  55. set wdead to 2
  56. Journal TR_m2_Wil_AvengeKnights 40
  57. endif
  58. endif
  59. endif
  60. endif
  61.  
  62. if ( wdead == 5 )
  63. if ( i1 <= 40 )
  64. if ( i1 == 40 )
  65. Journal TR_m2_Wil_AvengeKnights 140
  66. Player->ModReputation 1
  67. return
  68. elseif ( i1 == 20 )
  69. if ( Player->GetDistance "TR_m2_Tarbus Norin" < 7500 )
  70. Journal TR_m2_Wil_AvengeKnights 70
  71. elseif ( Player->GetDistance "TR_m2_Merias Tolode" < 7500 )
  72. Journal TR_m2_Wil_AvengeKnights 70
  73. else
  74. Journal TR_m2_Wil_AvengeKnights 110
  75. endif
  76. endif
  77. set wdead to 6
  78. "TR_m2_Tarbus Norin"->AIWander 0 0 0 20 60 30 0 ; To ensure they stay put after defeating the cultists
  79. "TR_m2_Merias Tolode"->AIWander 0 0 0 20 30 60 0
  80. endif
  81. return
  82. endif
  83.  
  84. ; GetDeadCounts nested in reverse order of difficulty to reach.
  85. ; The logic behind this: If the player has killed Joricas Rosard, then
  86. ; chances are good that he has already dealt with the rest since Joricas
  87. ; is the one most deep into the caves.
  88. ; Note that getDeadCount *is* a resource hog when the savegame is large. ;Nov2017edit: so noted. added timer.
  89. if ( GetDeadCount "TR_m2_O_Joricas Rosard" )
  90. if ( GetDeadCount TR_m2_O_Faricel )
  91. if ( GetDeadCount TR_m2_O_Gorthas )
  92. if ( GetDeadCount "TR_m2_O_Avala Garvas" )
  93. if ( GetDeadCount "TR_m2_O_Tirisar Garvas" )
  94. set wdead to 5
  95. endif
  96. endif
  97. endif
  98. endif
  99. endif
  100.  
  101. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement