Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Script Generated: 9/12/2011 9:24:00 PM
- // Run this query on your world database
- // UPDATE `creature_template` SET ScriptName='npc_Temple_Guardian_Anhuur' WHERE `entry`=39425;
- #include "ScriptPCH.h"
- class npc_Temple_Guardian_Anhuur : public CreatureScript
- {
- public:
- npc_Temple_Guardian_Anhuur() : CreatureScript("npc_Temple_Guardian_Anhuur") { }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new AnhuurAI (creature);
- }
- struct AnhuurAI : public ScriptedAI
- {
- AnhuurAI(Creature *c) : ScriptedAI(c)
- {
- uint32 spell1_phase1_Timer;
- uint32 spell2_phase1_Timer;
- uint32 spell1_phase2_Timer;
- uint32 spell2_phase2_Timer;
- uint32 spell1_phase3_Timer;
- uint32 spell2_phase3_Timer;
- uint32 phase1_Percent;
- uint32 phase2_Percent;
- uint32 phase3_Percent;
- uint32 phase4_Percent;
- uint32 phase;
- }
- void EnterCombat(Unit *who)
- {
- }
- void KilledUnit(Unit* victim)
- {
- }
- void JustDied(Unit* Killer)
- {
- }
- void Reset()
- {
- spell1_phase1_Timer = 0;
- spell2_phase1_Timer = 1000+rand()%4000;
- spell1_phase2_Timer = 0;
- spell2_phase2_Timer = 1000+rand()%4000;
- spell1_phase3_Timer = 0;
- spell2_phase3_Timer = 1000+rand()%4000;
- phase1_Percent = 100;
- phase2_Percent = 66;
- phase3_Percent = 33;
- phase4_Percent = 0;
- phase = 0;
- m_creature->ApplySpellImmune(118, IMMUNITY_DAMAGE, 0, true);
- m_creature->ApplySpellImmune(605, IMMUNITY_DAMAGE, 0, true);
- m_creature->ApplySpellImmune(6770, IMMUNITY_DAMAGE, 0, true);
- m_creature->ApplySpellImmune(339, IMMUNITY_DAMAGE, 0, true);
- }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
- if ((m_creature->GetHealth() * 100 / m_creature->GetMaxHealth() <= 100) && phase == 0)
- {
- phase = 1;
- m_creature->MonsterYell("Temple Guardian Anhuur yells: Turn back, intruders! These halls must not be disturbed!", LANG_UNIVERSAL, NULL);
- }
- if ((m_creature->GetHealth() * 100 / m_creature->GetMaxHealth() <= 66) && phase == 1)
- {
- phase = 2;
- m_creature->MonsterYell("Beacons of light, bestow upon me your aegis!", LANG_UNIVERSAL, NULL);
- }
- if ((m_creature->GetHealth() * 100 / m_creature->GetMaxHealth() <= 33) && phase == 2)
- {
- phase = 3;
- m_creature->MonsterYell("Beacons of light, bestow upon me your aegis!", LANG_UNIVERSAL, NULL);
- }
- if ((m_creature->GetHealth() * 100 / m_creature->GetMaxHealth() <= 0) && phase == 3)
- {
- phase = 4;
- m_creature->MonsterYell("What... have you... done?", LANG_UNIVERSAL, NULL);
- }
- if (phase == 1)
- {
- if (spell1_phase1_Timer <= diff)
- {
- DoCast(m_creature, 75117);
- spell1_phase1_Timer = 0;
- } else spell1_phase1_Timer -= diff;
- if (spell2_phase1_Timer <= diff)
- {
- DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true), 75592);
- spell2_phase1_Timer = 1000+rand()%4000;
- } else spell2_phase1_Timer -= diff;
- }
- if (phase == 2)
- {
- if (spell1_phase2_Timer <= diff)
- {
- DoCast(m_creature, 74938);
- spell1_phase2_Timer = 0;
- } else spell1_phase2_Timer -= diff;
- if (spell2_phase2_Timer <= diff)
- {
- DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true), 75322);
- spell2_phase2_Timer = 1000+rand()%4000;
- } else spell2_phase2_Timer -= diff;
- }
- if (phase == 3)
- {
- if (spell1_phase3_Timer <= diff)
- {
- DoCast(m_creature, 74938);
- spell1_phase3_Timer = 0;
- } else spell1_phase3_Timer -= diff;
- if (spell2_phase3_Timer <= diff)
- {
- DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true), 75322);
- spell2_phase3_Timer = 1000+rand()%4000;
- } else spell2_phase3_Timer -= diff;
- }
- if (phase == 4)
- {
- }
- DoMeleeAttackIfReady();
- }
- };
- void AddSC_npc_Temple_Guardian_Anhuur()
- {
- new npc_Temple_Guardian_Anhuur();
- }
Add Comment
Please, Sign In to add comment