Guest User

Pirokineza

a guest
Mar 6th, 2018
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1.  
  2. const int SPL_COST_PYROKINESIS = 10;
  3. const int SPL_DAMAGE_PYROKINESIS = 30;
  4.  
  5. instance Spell_Pyrokinesis(C_Spell_Proto)
  6. {
  7. time_per_mana = 500;
  8. damage_per_level = SPL_DAMAGE_PYROKINESIS;
  9. spellType = SPELL_BAD;
  10. targetCollectAlgo = TARGET_COLLECT_FOCUS;
  11. targetCollectRange = 3000;
  12. };
  13.  
  14.  
  15. func int Spell_Logic_Pyrokinesis(var int manaInvested)
  16. {
  17. if(!Npc_IsInState(other,zs_psidefense) || Npc_IsPlayer(other))
  18. {
  19. if(self.attribute[ATR_MANA] < SPL_COST_PYROKINESIS)
  20. {
  21. return SPL_DONTINVEST;
  22. };
  23. if(Npc_GetActiveSpellIsScroll(self))
  24. {
  25. self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
  26. }
  27. else
  28. {
  29. self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_COST_PYROKINESIS;
  30. };
  31. Npc_ClearAIQueue(other);
  32. AI_StandupQuick(other);
  33. AI_StartState(other,zs_psidefense,1,"");
  34. if(other.guild < GIL_SEPERATOR_HUM)
  35. {
  36. AI_PlayAni(other,"T_STAND_2_LIGHTNING_VICTIM");
  37. };
  38. B_MagicHurtNpc(self,other,SPL_DAMAGE_PYROKINESIS);
  39. if(other.attribute[ATR_Hitpoints] <= 0)
  40. {
  41. Npc_ClearAIQueue(other);
  42. AI_Standup(other);
  43. return SPL_SENDCAST;
  44. };
  45. };
  46. if(self.attribute[ATR_MANA] < SPL_COST_PYROKINESIS)
  47. {
  48. return SPL_DONTINVEST;
  49. };
  50. if(Npc_GetStateTime(other) >= 1)
  51. {
  52. Npc_SetStateTime(other,0);
  53. B_MagicHurtNpc(self,other,SPL_DAMAGE_PYROKINESIS);
  54. if(Npc_GetActiveSpellIsScroll(self))
  55. {
  56. self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
  57. }
  58. else
  59. {
  60. self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_COST_PYROKINESIS;
  61. };
  62. if(other.attribute[ATR_Hitpoints] <= 0)
  63. {
  64. Npc_ClearAIQueue(other);
  65. AI_Standup(other);
  66. return SPL_SENDCAST;
  67. };
  68. };
  69. return SPL_NEXTLEVEL;
  70. };
  71.  
  72. func void Spell_Cast_Pyrokinesis(var int spellLevel)
  73. {
  74. self.aivar[AIV_SelectSpell] += 1;
  75. };
Advertisement
Add Comment
Please, Sign In to add comment