Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.61 KB | None | 0 0
  1. class warrior : warrior_parameter {
  2. parameter:
  3. float Attack_DecayRatio = 6.600000;
  4. float UseSkill_DecayRatio = 66000.000000;
  5. float Attack_BoostValue = 300.000000;
  6. float UseSkill_BoostValue = 100000.000000;
  7. int territory_tp_timer = 1200000;
  8. int territory_tp_timer_id = 9999;
  9.  
  10. handler:
  11. EventHandler NO_DESIRE()
  12. {
  13. myself.AddMoveAroundDesire(5,5);
  14. }
  15.  
  16. EventHandler OUT_OF_TERRITORY()
  17. {
  18. myself.AddTimerEx(territory_tp_timer_id,territory_tp_timer);
  19. }
  20.  
  21. EventHandler CREATED()
  22. {
  23. if( ShoutMsg1 > 0 )
  24. {
  25. if( IsSay == 0 )
  26. {
  27. myself.Shout(MakeFString(ShoutMsg1,"","","","",""));
  28. }
  29. else
  30. {
  31. myself.Say(MakeFString(ShoutMsg1,"","","","",""));
  32. }
  33. }
  34. if( MoveAroundSocial > 0 || ShoutMsg2 > 0 || ShoutMsg3 > 0 )
  35. {
  36. myself.AddTimerEx(1001,10000);
  37. }
  38. super;
  39. }
  40.  
  41. EventHandler TIMER_FIRED_EX(timer_id)
  42. {
  43. if( timer_id == 1001 )
  44. {
  45. if( myself.p_state == 1 || myself.p_state == 2 || ( myself.p_state == 9 && myself.sm.hp > ( myself.sm.max_hp * 0.400000 ) && myself.sm.alive != 0 ) )
  46. {
  47. if( MoveAroundSocial > 0 || MoveAroundSocial1 > 0 || MoveAroundSocial2 > 0 )
  48. {
  49. if( MoveAroundSocial2 > 0 && Rand(100) < 20 )
  50. {
  51. myself.AddEffectActionDesire(myself.sm,3,( ( MoveAroundSocial2 * 1000 ) / 30 ),50);
  52. }
  53. else if( MoveAroundSocial1 > 0 && Rand(100) < 20 )
  54. {
  55. myself.AddEffectActionDesire(myself.sm,2,( ( MoveAroundSocial1 * 1000 ) / 30 ),50);
  56. }
  57. else if( MoveAroundSocial > 0 && Rand(100) < 20 )
  58. {
  59. myself.AddEffectActionDesire(myself.sm,1,( ( MoveAroundSocial * 1000 ) / 30 ),50);
  60. }
  61. }
  62. if( ShoutMsg2 > 0 && Rand(1000) < 17 )
  63. {
  64. if( IsSay == 0 )
  65. {
  66. myself.Shout(MakeFString(ShoutMsg2,"","","","",""));
  67. }
  68. else
  69. {
  70. myself.Say(MakeFString(ShoutMsg2,"","","","",""));
  71. }
  72. }
  73. }
  74. else if( myself.p_state == 3 )
  75. {
  76. if( ShoutMsg3 > 0 && Rand(100) < 10 )
  77. {
  78. if( IsSay == 0 )
  79. {
  80. myself.Shout(MakeFString(ShoutMsg3,"","","","",""));
  81. }
  82. else
  83. {
  84. myself.Say(MakeFString(ShoutMsg3,"","","","",""));
  85. }
  86. }
  87. }
  88. myself.AddTimerEx(1001,10000);
  89. }
  90. if( timer_id == territory_tp_timer_id )
  91. {
  92. if( myself.InMyTerritory(myself.sm) == 0 )
  93. {
  94. myself.InstantTeleport(myself.sm,myself.start_x,myself.hp,myself.start_z);
  95. myself.RemoveAllAttackDesire();
  96. }
  97. }
  98. super;
  99. }
  100.  
  101. EventHandler ATTACKED(attacker,damage,f0)
  102. {
  103. if( attacker.is_pc != 0 || myself.IsInCategory(12,attacker.class_id) )
  104. {
  105. f0 = 0;
  106. if( SetHateGroup >= 0 )
  107. {
  108. if( myself.IsInCategory(SetHateGroup,attacker.occupation) )
  109. {
  110. f0 = ( f0 + SetHateGroupRatio );
  111. }
  112. }
  113. if( attacker.occupation == SetHateOccupation )
  114. {
  115. f0 = ( f0 + SetHateOccupationRatio );
  116. }
  117. if( SetHateRace == attacker.race )
  118. {
  119. f0 = ( f0 + SetHateRaceRatio );
  120. }
  121. f0 = ( ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) ) );
  122. myself.AddAttackDesire(attacker,1,( f0 * 100 ));
  123. }
  124. if( myself.IsNullCreature(myself.top_desire_target) == 0 )
  125. {
  126. if( myself.GetPathfindFailCount() > 10 && attacker == myself.top_desire_target && FloatToInt(myself.sm.hp) != FloatToInt(myself.sm.max_hp) )
  127. {
  128. myself.InstantTeleport(myself.sm,FloatToInt(attacker.x),FloatToInt(attacker.y),FloatToInt(attacker.z));
  129. }
  130. if( GetAbnormalLevel(myself.sm,myself.Skill_GetAbnormalType(78708737)) >= 0 && myself.DistFromMe(myself.top_desire_target) > 40 )
  131. {
  132. if( myself.CanAttack(myself.top_desire_target) == 1 )
  133. {
  134. if( attacker.is_pc != 0 || myself.IsInCategory(12,attacker.class_id) )
  135. {
  136. f0 = 0;
  137. if( SetHateGroup >= 0 )
  138. {
  139. if( myself.IsInCategory(SetHateGroup,attacker.occupation) )
  140. {
  141. f0 = ( f0 + SetHateGroupRatio );
  142. }
  143. }
  144. if( attacker.occupation == SetHateOccupation )
  145. {
  146. f0 = ( f0 + SetHateOccupationRatio );
  147. }
  148. if( SetHateRace == attacker.race )
  149. {
  150. f0 = ( f0 + SetHateRaceRatio );
  151. }
  152. f0 = ( ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) ) );
  153. myself.AddAttackDesire(attacker,1,( f0 * 100 ));
  154. }
  155. }
  156. else
  157. {
  158. myself.RemoveAttackDesire(myself.top_desire_target.id);
  159. if( attacker.is_pc != 0 || myself.IsInCategory(12,attacker.class_id) )
  160. {
  161. f0 = 0;
  162. if( SetHateGroup >= 0 )
  163. {
  164. if( myself.IsInCategory(SetHateGroup,attacker.occupation) )
  165. {
  166. f0 = ( f0 + SetHateGroupRatio );
  167. }
  168. }
  169. if( attacker.occupation == SetHateOccupation )
  170. {
  171. f0 = ( f0 + SetHateOccupationRatio );
  172. }
  173. if( SetHateRace == attacker.race )
  174. {
  175. f0 = ( f0 + SetHateRaceRatio );
  176. }
  177. f0 = ( ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) ) );
  178. myself.AddAttackDesire(attacker,1,( f0 * 100 ));
  179. }
  180. }
  181. }
  182. }
  183. super;
  184. }
  185.  
  186. EventHandler CLAN_ATTACKED(attacker,damage,f0)
  187. {
  188. if( myself.GetLifeTime() > 7 )
  189. {
  190. if( myself.IsNullCreature(myself.top_desire_target) == 0 )
  191. {
  192. if( myself.GetPathfindFailCount() > 10 && attacker == myself.top_desire_target && FloatToInt(myself.sm.hp) != FloatToInt(myself.sm.max_hp) )
  193. {
  194. myself.InstantTeleport(myself.sm,FloatToInt(attacker.x),FloatToInt(attacker.y),FloatToInt(attacker.z));
  195. }
  196. }
  197. if( attacker.is_pc != 0 || myself.IsInCategory(12,attacker.class_id) )
  198. {
  199. f0 = 0;
  200. if( SetHateGroup >= 0 )
  201. {
  202. if( myself.IsInCategory(SetHateGroup,attacker.occupation) )
  203. {
  204. f0 = ( f0 + SetHateGroupRatio );
  205. }
  206. }
  207. if( attacker.occupation == SetHateOccupation )
  208. {
  209. f0 = ( f0 + SetHateOccupationRatio );
  210. }
  211. if( SetHateRace == attacker.race )
  212. {
  213. f0 = ( f0 + SetHateRaceRatio );
  214. }
  215. f0 = ( ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * damage ) / ( myself.sm.level + 7 ) ) ) );
  216. myself.AddAttackDesire(attacker,1,( f0 * 30 ));
  217. }
  218. }
  219. }
  220.  
  221. EventHandler SEE_SPELL(speller,skill_name_id,target,f0,i0)
  222. {
  223. if( myself.Skill_GetEffectPoint(skill_name_id) > 0 )
  224. {
  225. if( myself.p_state == 3 && myself.top_desire_target == target )
  226. {
  227. i0 = myself.Skill_GetEffectPoint(skill_name_id);
  228. f0 = 0;
  229. if( SetHateGroup >= 0 )
  230. {
  231. if( myself.IsInCategory(SetHateGroup,speller.occupation) )
  232. {
  233. f0 = ( f0 + SetHateGroupRatio );
  234. }
  235. }
  236. if( speller.occupation == SetHateOccupation )
  237. {
  238. f0 = ( f0 + SetHateOccupationRatio );
  239. }
  240. if( SetHateRace == speller.race )
  241. {
  242. f0 = ( f0 + SetHateRaceRatio );
  243. }
  244. f0 = ( ( ( 1.000000 * i0 ) / ( myself.sm.level + 7 ) ) + ( ( f0 / 100 ) * ( ( 1.000000 * i0 ) / ( myself.sm.level + 7 ) ) ) );
  245. myself.AddAttackDesire(speller,1,( f0 * 150 ));
  246. }
  247. }
  248. if( myself.GetPathfindFailCount() > 10 && speller == myself.top_desire_target && FloatToInt(myself.sm.hp) != FloatToInt(myself.sm.max_hp) )
  249. {
  250. myself.InstantTeleport(myself.sm,FloatToInt(speller.x),FloatToInt(speller.y),FloatToInt(speller.z));
  251. }
  252. }
  253.  
  254. EventHandler DESIRE_MANIPULATION(speller,desire)
  255. {
  256. myself.MakeAttackEvent(speller,desire,0);
  257. }
  258.  
  259. EventHandler MY_DYING()
  260. {
  261. if( ShoutMsg4 > 0 && Rand(100) < 30 )
  262. {
  263. if( IsSay == 0 )
  264. {
  265. myself.Shout(MakeFString(ShoutMsg4,"","","","",""));
  266. }
  267. else
  268. {
  269. myself.Say(MakeFString(ShoutMsg4,"","","","",""));
  270. }
  271. }
  272. }
  273.  
  274. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement