Advertisement
Guest User

Untitled

a guest
Jun 11th, 2013
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.33 KB | None | 0 0
  1. begin CSC_Katti
  2.  
  3. ; By Nigedo.
  4. ; This script is for all kids who require only scheduled behaviour and recall when attacked
  5. ; scripts disable/enable while unseen and timing reworked by abot
  6.  
  7. Short nolore
  8. Short knowyou
  9. Short OnPCHitMe
  10. Short removeDay
  11. Short count
  12. Short extraBounty
  13. short morning
  14. short evening
  15.  
  16. if ( GameHour >= 9 )
  17. if ( GameHour < 21 )
  18. if ( morning == 0 )
  19. PositionCell -131545 220782 90 0 "Солстхейм, побережьe Фелсаад" (-17, 26 ) ; без CELLID, если НПЦ должен быть в экстерьере
  20. set morning to 1
  21. set evening to 0
  22. endif
  23. endif
  24. elseif ( GameHour < 9 )
  25. if ( GameHour <= 21 )
  26. if ( evening == 0 )
  27. PositionCell 3633 2868 12726 10800 "Каюта Катти Сарк"; gradus выставляет НПЦ относительно севера (север берется за 0 ) по часовой стрелке, но не в градусах, а в минутах
  28. set evening to 1
  29. set morning to 0
  30. endif
  31. endif
  32. endif
  33.  
  34. short i1
  35. float t1
  36. float x1
  37. float y1
  38. float x2
  39. float y2
  40. float x3
  41. float y3
  42.  
  43. if ( MenuMode == 1 )
  44. return
  45. endif
  46.  
  47. if ( i1 >= 10 )
  48. set x2 to ( GetDistance player )
  49. if ( x2 > 500 )
  50. set i1 to 1
  51. set x1 to ( player->GetPos X )
  52. set y1 to ( player->GetPos Y )
  53. set y3 to ( player->GetAngle Z )
  54.  
  55. set x2 to GetPos X
  56. set y2 to GetPos Y
  57.  
  58. set x2 to ( x2 - x1 )
  59. set y2 to ( y2 - y1 )
  60.  
  61. set x3 to ( y2 * y2 )
  62. if ( x3 < 0.000001 )
  63. return
  64. endif
  65.  
  66. set x3 to ( x2 / y2 )
  67.  
  68. if ( x2 > 0 )
  69. if ( y2 > 0 )
  70. if ( x3 > 1 )
  71. if ( y3 < -45 )
  72. set i1 to 0
  73. endif
  74. else
  75. if ( y3 < -90 )
  76. set i1 to 0
  77. endif
  78. if ( y3 > 135 )
  79. set i1 to 0
  80. endif
  81. endif
  82. else
  83. if ( x3 < -1 )
  84. if ( y3 < 0 )
  85. if ( y3 > -135 )
  86. set i1 to 0
  87. endif
  88. endif
  89. else
  90. if ( y3 < 45 )
  91. if ( y3 > -90 )
  92. set i1 to 0
  93. endif
  94. endif
  95. endif
  96. endif
  97. else
  98. if ( y2 > 0 )
  99. if ( x3 < -1 )
  100. if ( y3 > 45 )
  101. set i1 to 0
  102. endif
  103. else
  104. if ( y3 > 90 )
  105. set i1 to 0
  106. endif
  107. if ( y3 < -135 )
  108. set i1 to 0
  109. endif
  110. endif
  111. else
  112. if ( x3 > 1 )
  113. if ( y3 > 0 )
  114. if ( y3 < 135 )
  115. set i1 to 0
  116. endif
  117. endif
  118. else
  119. if ( y3 > -35 )
  120. if ( y3 < 90 )
  121. set i1 to 0
  122. endif
  123. endif
  124. endif
  125. endif
  126. endif
  127.  
  128. if ( i1 == 0 ) ; player is not looking at me
  129. if ( GetDisabled == 0 )
  130. disable
  131. else
  132. enable
  133. endif
  134. endif
  135. endif
  136. set i1 to 0
  137. endif
  138.  
  139. if ( GetDisabled == 1 )
  140. return
  141. endif
  142.  
  143. if ( GetEffect sEffectRecall ) ; Recall cast completed
  144. set removeDay To Day; Trigger unscheduled disable for one day
  145. disable
  146. return
  147. elseif ( OnPCHitMe == 1 )
  148. SetHealth 1000 ; Prevent more attacks from killing kid
  149. Cast "1EM_kidsrecall" Player ; Face Player and cast kids recall spell
  150. if ( extraBounty == 0 )
  151. ModPCCrimeLevel 2000 ; Add extra fine for this crime
  152. set extraBounty To 1
  153. elseif ( GetPCCrimeLevel == 0 )
  154. set OnPCHitMe To 0
  155. set extraBounty To 0
  156. endif
  157. endif
  158.  
  159. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement