Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int SPL_COST_PYROKINESIS = 10;
- const int SPL_DAMAGE_PYROKINESIS = 30;
- instance Spell_Pyrokinesis(C_Spell_Proto)
- {
- time_per_mana = 500;
- damage_per_level = SPL_DAMAGE_PYROKINESIS;
- spellType = SPELL_BAD;
- targetCollectAlgo = TARGET_COLLECT_FOCUS;
- targetCollectRange = 3000;
- };
- func int Spell_Logic_Pyrokinesis(var int manaInvested)
- {
- if(!Npc_IsInState(other,zs_psidefense) || Npc_IsPlayer(other))
- {
- if(self.attribute[ATR_MANA] < SPL_COST_PYROKINESIS)
- {
- return SPL_DONTINVEST;
- };
- if(Npc_GetActiveSpellIsScroll(self))
- {
- self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
- }
- else
- {
- self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_COST_PYROKINESIS;
- };
- Npc_ClearAIQueue(other);
- AI_StandupQuick(other);
- AI_StartState(other,zs_psidefense,1,"");
- if(other.guild < GIL_SEPERATOR_HUM)
- {
- AI_PlayAni(other,"T_STAND_2_LIGHTNING_VICTIM");
- };
- B_MagicHurtNpc(self,other,SPL_DAMAGE_PYROKINESIS);
- if(other.attribute[ATR_Hitpoints] <= 0)
- {
- Npc_ClearAIQueue(other);
- AI_Standup(other);
- return SPL_SENDCAST;
- };
- };
- if(self.attribute[ATR_MANA] < SPL_COST_PYROKINESIS)
- {
- return SPL_DONTINVEST;
- };
- if(Npc_GetStateTime(other) >= 1)
- {
- Npc_SetStateTime(other,0);
- B_MagicHurtNpc(self,other,SPL_DAMAGE_PYROKINESIS);
- if(Npc_GetActiveSpellIsScroll(self))
- {
- self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
- }
- else
- {
- self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_COST_PYROKINESIS;
- };
- if(other.attribute[ATR_Hitpoints] <= 0)
- {
- Npc_ClearAIQueue(other);
- AI_Standup(other);
- return SPL_SENDCAST;
- };
- };
- return SPL_NEXTLEVEL;
- };
- func void Spell_Cast_Pyrokinesis(var int spellLevel)
- {
- self.aivar[AIV_SelectSpell] += 1;
- };
Advertisement
Add Comment
Please, Sign In to add comment