func int Trigger_MagicBurn()
{
var int timer2;
if (SelfTrigger.Delay != 100)
{
//PlayEffect_MAGICBURN(self);
SelfTrigger.Delay = 100; // 10 вызовов в секунду
//timer2 = 40; // 45 много
//Wld_PlayEffect("VOB_BURN", self, self, 0, 0, DAM_FIRE, FALSE );
if (Npc_IsDead(self) == true)
{
return LOOP_END;
};
SelfTrigger.AIVariables[0] -= self.attribute[ATR_HITPOINTS]; // ВЫСЧИТЫВАЕМ УРОН
SelfTrigger.AIVariables[2] = SelfTrigger.AIVariables[0];
if (Npc_IsDead(self) == false)
&& (C_NpcIsHuman(self) == true)
&& (SelfTrigger.AIVariables[0] > 30) //
//&& !Npc_IsInState(self, ZS_MagicBurnHuman)
//&& !Npc_IsInState(self, ZS_Unconscious)
//&& !C_BodystateContains(self,BS_SWIM) // проверка выше
//&& !C_BodystateContains(self,BS_DIVE) // проверка выше
//&& self.aivar[AIV_ItemFreq] <= S_FIRE_VICTIM // горит три секунды
{
Npc_ClearAIQueue(self);
AI_StartState(self, ZS_MagicBurnHuman, 0, "");
Hlp_PrintConsole(" Trigger_MagicBurn --> ZS_MagicBurnHuman");
};
};
SelfTrigger.AIVariables[2] -=1;
/*
if timer == timer2 * 1
|| timer == timer2 * 2
|| timer == timer2 * 3
|| timer == timer2 * 4
{
Wld_PlayEffect("VOB_BURN_CHILD1", self, self, 0, 0, 0, FALSE );
};
*/
if (SelfTrigger.AIVariables[2] <= 0) { return LOOP_END; };
if C_BodystateContains(self,BS_SWIM)
{
Npc_StopAni (self, "S_FIRE_VICTIM"); // falls der
Hlp_PrintConsole(" Trigger_MagicBurn_LOOP_END --> C_BodystateContains(self,BS_SWIM)");
return LOOP_END;
};
if C_BodystateContains(self,BS_DIVE)
{
Npc_StopAni (self, "S_FIRE_VICTIM"); // falls der
Hlp_PrintConsole(" Trigger_MagicBurn_LOOP_END --> C_BodystateContains(self,BS_DIVE");
return LOOP_END;
};
Npc_ChangeAttribute(self, ATR_HITPOINTS, - SelfTrigger.AIVariables[1]);
if (self.attribute[ATR_HITPOINTS] <= 0)
//|| (Npc_IsDead(self) == true)
{
//B_DeathXP2020(self,hero);
B_GiveXP(self.level * XP_PER_LEVEL_DEAD); // новый формат начисления опыта?
Npc_StopAni (self, "S_FIRE_VICTIM"); // falls der
/*
AI_StopFX(self, "VOB_BURN");
AI_StopFX(self, "VOB_BURN_CHILD1");
AI_StopFX(self, "VOB_BURN_CHILD2");
AI_StopFX(self, "VOB_BURN_CHILD3");
AI_StopFX(self, "VOB_BURN_CHILD4");
AI_StopFX(self, "VOB_BURN_CHILD5");
AI_StopFX(self, "VOB_BURN_CHILD6");
*/
Wld_PlayEffect("spellFX_Firespell_HUMANSMOKE", self, self, 0, 0, 0, FALSE );
Hlp_PrintConsole(Str_Format(" Trigger_MagicBurn[%s] --> return LOOP_END" , self.name));
return Loop_end;
};
//Hlp_msg = Str_Format(" Trigger_MagicBurn[%s] :: Таймер %i :: Жизни %i", self.name, timer,self.attribute[ATR_HITPOINTS]);
//Hlp_PrintConsole(Hlp_msg);
Hlp_msg = Str_Format(" Trigger_MagicBurn[%s] :: AIVariables[2] %i :: Жизни %i --> LOOP_CONTINUE", self.name, SelfTrigger.AIVariables[2],self.attribute[ATR_HITPOINTS]);
Hlp_PrintConsole(Hlp_msg);
return LOOP_CONTINUE;
};