aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-30 22:10:09 -0500
committermegamage <none@none>2009-04-30 22:10:09 -0500
commit82b03c856fc96cdeacb297c5fb19211b11f2c916 (patch)
treee1e6b022dc610b5b3751af7c17664b88c8b887cb /src
parent31065850ed5f1f56320d656586acf951b80e3ffa (diff)
*Update sapphiron and kelthuzad scripts. By cryingcloud.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp449
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp181
2 files changed, 336 insertions, 294 deletions
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp
index 4e74445d2cd..a8b2c81c09a 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp
@@ -77,66 +77,7 @@ I also don't know the emotes
//common needed defines
#define NAXXRAMAS_MAP 533
-//Positional defines
-#define ADDX_LEFT_FAR 3783.272705
-#define ADDY_LEFT_FAR -5062.697266
-#define ADDZ_LEFT_FAR 143.711203
-#define ADDO_LEFT_FAR 3.617599
-
-#define ADDX_LEFT_MIDDLE 3730.291260
-#define ADDY_LEFT_MIDDLE -5027.239258
-#define ADDZ_LEFT_MIDDLE 143.956909
-#define ADDO_LEFT_MIDDLE 4.461900
-
-#define ADDX_LEFT_NEAR 3683.868652
-#define ADDY_LEFT_NEAR -5057.281250
-#define ADDZ_LEFT_NEAR 143.183884
-#define ADDO_LEFT_NEAR 5.237086
-
-#define ADDX_RIGHT_FAR 3759.355225
-#define ADDY_RIGHT_FAR -5174.128418
-#define ADDZ_RIGHT_FAR 143.802383
-#define ADDO_RIGHT_FAR 2.170104
-
-#define ADDX_RIGHT_MIDDLE 370.724365
-#define ADDY_RIGHT_MIDDLE -5185.123047
-#define ADDZ_RIGHT_MIDDLE 143.928024
-#define ADDO_RIGHT_MIDDLE 1.309310
-
-#define ADDX_RIGHT_NEAR 3665.121094
-#define ADDY_RIGHT_NEAR -5138.679199
-#define ADDZ_RIGHT_NEAR 143.183212
-#define ADDO_RIGHT_NEAR 0.604023
-
-#define WALKX_LEFT_FAR 3754.431396
-#define WALKY_LEFT_FAR -5080.727734
-#define WALKZ_LEFT_FAR 142.036316
-#define WALKO_LEFT_FAR 3.736189
-
-#define WALKX_LEFT_MIDDLE 3724.396484
-#define WALKY_LEFT_MIDDLE -5061.330566
-#define WALKZ_LEFT_MIDDLE 142.032700
-#define WALKO_LEFT_MIDDLE 4.564785
-
-#define WALKX_LEFT_NEAR 3687.158424
-#define WALKY_LEFT_NEAR -5076.834473
-#define WALKZ_LEFT_NEAR 142.017319
-#define WALKO_LEFT_NEAR 5.237086
-
-#define WALKX_RIGHT_FAR 3687.571777
-#define WALKY_RIGHT_FAR -5126.831055
-#define WALKZ_RIGHT_FAR 142.017807
-#define WALKO_RIGHT_FAR 0.604023
-
-#define WALKX_RIGHT_MIDDLE 3707.990733
-#define WALKY_RIGHT_MIDDLE -5151.450195
-#define WALKZ_RIGHT_MIDDLE 142.032562
-#define WALKO_RIGHT_MIDDLE 1.376855
-
-#define WALKX_RIGHT_NEAR 3739.500000
-#define WALKY_RIGHT_NEAR -5141.883989
-#define WALKZ_RIGHT_NEAR 142.0141130
-#define WALKO_RIGHT_NEAR 2.121412
+//Positional defines
//spells to be casted
#define SPELL_FROST_BOLT 28478
@@ -149,6 +90,32 @@ I also don't know the emotes
#define SPELL_SHADOW_FISURE 27810
#define SPELL_FROST_BLAST 27808
+#define NORMAL_RAID 10
+
+//creature needed summoned
+#define MOB_SUMMON_WASTE 16427 //Soldiers of the Frozen Wastes
+#define MOB_SUMMON_ABOMINATION 16428 //Unstoppable Abominations
+#define MOB_SUMMON_WEAVER 16429//Soul Weavers
+#define MOB_SUMMON_FISSURE 16129 // Shadow Fissure
+#define MOB_SUMMON_ICECROWN 16441// Guardians of Icecrown
+
+float Pos[12][4] =
+{
+ {3783.272705, -5062.697266, 143.711203,3.617599},//LEFT_FAR
+ {3730.291260, -5027.239258,143.956909,4.461900},//LEFT_MIDDLE
+ {3683.868652,-5057.281250,143.183884,5.237086},//LEFT_NEAR
+ {3759.355225,-5174.128418,143.802383,2.170104},//RIGHT_FAR
+ {370.724365,-5185.123047,143.928024,1.309310},//RIGHT_MIDDLE
+ {3665.121094,-5138.679199,143.183212,0.604023},//RIGHT_NEAR
+ {3754.431396,-5080.727734,142.036316,3.736189},//LEFT_FAR
+ {3724.396484, -5061.330566,142.032700, 4.564785},//LEFT_MIDDLE
+ {3687.158424,-5076.834473,142.017319,5.237086},//LEFT_NEAR
+ {3687.571777,-5126.831055,142.017807,0.604023},//RIGHT_FAR
+ {3707.990733,-5151.450195,142.032562,1.376855},//RIGHT_MIDDLE
+ {3739.500000,-5141.883989,142.0141130, 2.121412}//RIGHT_NEAR
+
+};
+
struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
{
boss_kelthuzadAI(Creature* c) : ScriptedAI(c)
@@ -164,20 +131,30 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
uint64 GuardiansOfIcecrown[5];
uint32 GuardiansOfIcecrown_Count;
uint32 GuardiansOfIcecrown_Timer;
+
+ //phase==1 summon_timer
+ uint32 SummonWasters_Timer;
+ uint32 SummonAbominations_Timer;
+ uint32 SummonAWeavers_Timer;
+
+ //phase==2,spell_timer
uint32 FrostBolt_Timer;
uint32 FrostBoltNova_Timer;
uint32 ChainsOfKelthuzad_Timer;
uint32 ManaDetonation_Timer;
uint32 ShadowFisure_Timer;
- uint32 FrostBlast_Timer;
- uint32 ChainsOfKelthuzad_Targets;
- uint32 Phase1_Timer;
- bool Phase2;
- bool Phase3;
+ uint32 FrostBlast_Timer;
+
+ uint32 Phase1_Timer;
+ unit32 Phase;
void Reset()
{
- FrostBolt_Timer = (rand()%60)*1000; //It won't be more than a minute without cast it
+ SummonWasters_Timer=3000 // 3s summon waster
+ SummonAbominations_Timer=25000; //25s summon abomination
+ SummonAWeavers_Timer=20000; //20s summon Weavers
+
+ FrostBolt_Timer = 2000; //2s CD
FrostBoltNova_Timer = 15000; //Cast every 15 seconds
ChainsOfKelthuzad_Timer = (rand()%30+30)*1000; //Cast no sooner than once every 30 seconds
ManaDetonation_Timer = 20000; //Seems to cast about every 20 seconds
@@ -188,18 +165,17 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
for(int i=0; i<5; i++)
{
if(GuardiansOfIcecrown[i])
- {
- //delete creature
- Unit* pUnit = Unit::GetUnit((*m_creature), GuardiansOfIcecrown[i]);
- if (pUnit && pUnit->isAlive())
- pUnit->DealDamage(pUnit, pUnit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- GuardiansOfIcecrown[i] = 0;
- }
+ {
+ //delete creature
+ Unit* pUnit = Unit::GetUnit((*m_creature), GuardiansOfIcecrown[i]);
+ if (pUnit && pUnit->isAlive())
+ pUnit->DealDamage(pUnit, pUnit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ GuardiansOfIcecrown[i] = 0;
+ }
}
- Phase1_Timer = 310000; //Phase 1 lasts 5 minutes and 10 seconds
- Phase2 = false;
- Phase3 = false;
+ Phase1_Timer = 228000; //Phase 1 lasts 3 minutes and 48 seconds
+ Phase=0;
}
void KilledUnit()
@@ -213,52 +189,7 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
void JustDied(Unit* Killer)
{
DoScriptText(SAY_DEATH, m_creature);
- for(int i=0; i<5; i++)
- if(GuardiansOfIcecrown[i])
- {
- Unit* pUnit = Unit::GetUnit((*m_creature), GuardiansOfIcecrown[i]);
- if (!pUnit || !pUnit->isAlive())
- continue;
-
- pUnit->CombatStop();
- float Walk_Pos_X;
- float Walk_Pos_Y;
- float Walk_Pos_Z;
- switch(rand()%6)
- {
- case 0:
- Walk_Pos_X = ADDX_LEFT_FAR;
- Walk_Pos_Y = ADDY_LEFT_FAR;
- Walk_Pos_Z = ADDZ_LEFT_FAR;
- break;
- case 1:
- Walk_Pos_X = ADDX_LEFT_MIDDLE;
- Walk_Pos_Y = ADDY_LEFT_MIDDLE;
- Walk_Pos_Z = ADDZ_LEFT_MIDDLE;
- break;
- case 2:
- Walk_Pos_X = ADDX_LEFT_NEAR;
- Walk_Pos_Y = ADDY_LEFT_NEAR;
- Walk_Pos_Z = ADDZ_LEFT_NEAR;
- break;
- case 3:
- Walk_Pos_X = ADDX_RIGHT_FAR;
- Walk_Pos_Y = ADDY_RIGHT_FAR;
- Walk_Pos_Z = ADDZ_RIGHT_FAR;
- break;
- case 4:
- Walk_Pos_X = ADDX_RIGHT_MIDDLE;
- Walk_Pos_Y = ADDY_RIGHT_MIDDLE;
- Walk_Pos_Z = ADDZ_RIGHT_MIDDLE;
- break;
- case 5:
- Walk_Pos_X = ADDX_RIGHT_NEAR;
- Walk_Pos_Y = ADDY_RIGHT_NEAR;
- Walk_Pos_Z = ADDZ_RIGHT_NEAR;
- break;
- }
- pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X, Walk_Pos_Y, Walk_Pos_Z);
- }
+
}
void EnterCombat(Unit* who)
@@ -269,21 +200,103 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
case 1: DoScriptText(SAY_AGGRO2, m_creature); break;
case 2: DoScriptText(SAY_AGGRO3, m_creature); break;
}
+ Phase=1;
}
void UpdateAI(const uint32 diff)
{
- if (!UpdateVictim())
+ if (!UpdateVictim())
return;
+ if (Phase1_Timer<diff && Phase==1)
+ {
+ Phase=2;
+ }else Phase1_Timer-=diff;
- if(m_creature->getVictim() && m_creature->isAlive())
+ if(phase == 1)
{
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ EnterEvadeMode();
+ //SummonWasters_Timer at far positon
+ if ( SummonWasters_Timer< diff)
+ {
+
+ Creature *Waster = NULL;
+ switch(rand()%4)
+ {
+ case 0: Waster = m_creature->SummonCreature(MOB_SUMMON_WASTE,Pos[0][0], Pos[0][1], Pos[0][2], Pos[0][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
+ case 1: Waster = m_creature->SummonCreature(MOB_SUMMON_WASTE,Pos[3][0], Pos[3][1], Pos[3][2], Pos[3][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
+ case 2: Waster = m_creature->SummonCreature(MOB_SUMMON_WASTE,Pos[6][0], Pos[6][1], Pos[6][2], Pos[6][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
+ case 3: Waster = m_creature->SummonCreature(MOB_SUMMON_WASTE,Pos[9][0], Pos[9][1], Pos[9][2], Pos[9][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
+ }
+
+ if(Waster)
+ {
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ Waster->AI()->AttackStart(target);
+ }
+ SummonWasters_Timer=3000;
+ }else SummonWasters_Timer-=diff;
+
+ //MOB_SUMMON_ABOMINATION at middle positon
+ if ( SummonAbominations_Timer< diff)
+ {
+
+ Creature *Abominations = NULL;
+ switch(rand()%4)
+ {
+ case 0: Abominations = m_creature->SummonCreature(MOB_SUMMON_ABOMINATION,Pos[1][0], Pos[1][1], Pos[1][2], Pos[1][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
+ case 1: Abominations = m_creature->SummonCreature(MOB_SUMMON_ABOMINATION,Pos[4][0], Pos[4][1], Pos[4][2], Pos[4][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
+ case 2: Abominations = m_creature->SummonCreature(MOB_SUMMON_ABOMINATION,Pos[7][0], Pos[7][1], Pos[7][2], Pos[7][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
+ case 3: Abominations = m_creature->SummonCreature(MOB_SUMMON_ABOMINATION,Pos[10][0], Pos[10][1], Pos[10][2], Pos[10][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
+ }
+
+ if(Abominations)
+ {
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ Abominations->AI()->AttackStart(target);
+ }
+ SummonAbominations_Timer=25000;
+ }else SummonAbominations_Timer-=diff;
+
+ //SummonAWeavers_Timer at far positon
+ if ( SummonAWeavers_Timer< diff)
+ {
+
+ Creature *Weavers = NULL;
+ switch(rand()%4)
+ {
+ case 0: Weavers = m_creature->SummonCreature(MOB_SUMMON_WEAVER,Pos[0][0], Pos[0][1], Pos[0][2], Pos[0][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
+ case 1: Weavers = m_creature->SummonCreature(MOB_SUMMON_WEAVER,Pos[3][0], Pos[3][1], Pos[3][2], Pos[3][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
+ case 2: Weavers = m_creature->SummonCreature(MOB_SUMMON_WEAVER,Pos[6][0], Pos[6][1], Pos[6][2], Pos[6][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
+ case 3: Weavers = m_creature->SummonCreature(MOB_SUMMON_WEAVER,Pos[9][0], Pos[9][1], Pos[9][2], Pos[9][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
+ }
+
+ if(Weavers)
+ {
+ Unit *target = NULL;
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if(target)
+ Weavers->AI()->AttackStart(target);
+ }
+ SummonAWeavers_Timer=30000;
+ }else SummonAWeavers_Timer-=diff;
+
+ }
+
+ if( Phase!=1 && m_creature->getVictim() && m_creature->isAlive())
+ {
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+
//Check for Frost Bolt
if(FrostBolt_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FROST_BOLT);
//Cast again on time
- FrostBolt_Timer = (rand()%60)*1000;
+ FrostBolt_Timer = 2000;
}else FrostBolt_Timer -= diff;
//Check for Frost Bolt Nova
@@ -293,135 +306,139 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
FrostBoltNova_Timer = 15000;
}else FrostBoltNova_Timer -= diff;
- //Check for Chains Of Kelthuzad
+ //Cast Chains Of Kelthuzad only on the Heroic instance
+ /*
if(ChainsOfKelthuzad_Timer < diff)
{
- //DoCast(m_creature->getVictim(),SPELL_CHAINS_OF_KELTHUZAD);
+ //DoCast(m_creature->getVictim(),SPELL_CHAINS_OF_KELTHUZAD);
- //if(rand()%2 == 0)
- //DoScriptText(SAY_CHAIN1, m_creature);
- //else
- //DoScriptText(SAY_CHAIN2, m_creature);
- ChainsOfKelthuzad_Timer = (rand()%30+30)*1000;
+ //if(rand()%2 == 0)
+ //DoScriptText(SAY_CHAIN1, m_creature);
+ //else
+ //DoScriptText(SAY_CHAIN2, m_creature);
+ ChainsOfKelthuzad_Timer = (rand()%30+30)*1000;
}else ChainsOfKelthuzad_Timer -= diff;
+ */
//Check for Mana Detonation
if(ManaDetonation_Timer < diff)
{
- //time to cast
- DoCast(m_creature->getVictim(),SPELL_MANA_DETONATION);
-
- if (rand()%2)
- DoScriptText(SAY_SPECIAL1_MANA_DET, m_creature);
+ Unit* target;
+ //select a manaplayer during 10 raid ,how to make sure we can succed in finding a manaplayer or it's safty if there is no manaplayer in raid
+ for(uint8 i = 0; i <NORMAL_RAID; i++)
+ {
+ if (target = SelectUnit(SELECT_TARGET_RANDOM,0))
+ {
+ //check if the target is a manaplayer
+ if ( (Player*)target->getPowerType()==POWER_MANA )
+ {
+ // if yes cast the SPELL_MANA_DETONATION
+ DoCast(m_creature->getVictim(),SPELL_MANA_DETONATION);
+ //Obviously the damage of this spell would be invalidation
+ break;
+ //exit the circle
+ }
+ else //debug
+ {
+ m_creature->Yell("A, no mana,you are cheat?",LANG_COMMON,target);
+ }
+ }
+ }
+ if (rand()%2)
+ DoScriptText(SAY_SPECIAL1_MANA_DET, m_creature);
ManaDetonation_Timer = 20000;
}else ManaDetonation_Timer -= diff;
- //Check for Shadow Fissure
+ //Summons a Shadow Fissure underneath a random player.
+ //The fissure will stay inactive for about 3 seconds, after which it will become a beam of purple energy,
+ //instantly killing the player if they remain in it.
+
if(ShadowFisure_Timer < diff)
{
- DoCast(m_creature->getVictim(),SPELL_SHADOW_FISURE);
-
- if (rand()%2)
- DoScriptText(SAY_SPECIAL3_MANA_DET, m_creature);
+ if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
+ {
+ //get the position of the target x,y,z,ang.
+ float x,y,z,ang;
+ x=(Player*)target->GetPositionX;
+ y=(Player*)target->GetPositionY;
+ z=(Player*)target->GetPositionZ;
+ ang=(Player*)target->GetOrientation;
+ //summon the MOB_SUMMON_FISSURE at this positon
+ Creature *Fissure= m_creature->SummonCreature(MOB_SUMMON_FISSURE,x,y,z,ang, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if(Fissure)
+ {
+ DoCast(target,SPELL_SHADOW_FISURE);
+ Fissure->AI()->AttackStart(target);
+ }
+ }
+
+ if (rand()%2)
+ DoScriptText(SAY_SPECIAL3_MANA_DET, m_creature);
ShadowFisure_Timer = 25000;
}else ShadowFisure_Timer -= diff;
- //Check for Frost Blast
+ //cast Frost Blast to a random player
if(FrostBlast_Timer < diff)
{
- //time to cast
- DoCast(m_creature->getVictim(),SPELL_FROST_BLAST);
-
+ if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
+ {
+ DoCast(target,SPELL_FROST_BLAST);
+ //obviously the spell doesn't work like the description
+ //So, we need script this spell?
+ }
if(rand()%2 == 0)
DoScriptText(SAY_FROST_BLAST, m_creature);
FrostBlast_Timer = (rand()%30+30)*1000;
}else FrostBlast_Timer -= diff;
//start phase 3 when we are 40% health
- if(!Phase3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40)
+ if( Phase!=3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40)
{
- Phase3 = true;
- DoScriptText(SAY_REQUEST_AID, m_creature);
+ Phase = 3 ;
+ DoScriptText(SAY_REQUEST_AID, m_creature);
//here Lich King should respond to KelThuzad but I don't know which creature to make talk
//so for now just make Kelthuzad says it.
DoScriptText(SAY_ANSWER_REQUEST, m_creature);
}
- if(Phase3 && (GuardiansOfIcecrown_Count < 5))
+ if(Phase==3 && (GuardiansOfIcecrown_Count < 2)) //in normal raid ,only two Icecrown
if(GuardiansOfIcecrown_Timer < diff)
- {
- //Summon a Guardian of Icecrown in a random alcove (Creature # 16441)
- //uint32 TimeToWalk;
- Unit* pUnit = NULL;
- float Walk_Pos_X;
- float Walk_Pos_Y;
- float Walk_Pos_Z;
- switch(rand()%6)
{
+ //Summon a Guardian of Icecrown in a random alcove
+ Unit* pUnit = NULL;
+ switch(rand()%3)
+ {
case 0:
- pUnit = m_creature->SummonCreature(16441,ADDX_LEFT_FAR,ADDY_LEFT_FAR,ADDZ_LEFT_FAR,ADDO_LEFT_FAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
- //Setting walk position
- Walk_Pos_X = WALKX_LEFT_FAR;
- Walk_Pos_Y = WALKY_LEFT_FAR;
- Walk_Pos_Z = WALKZ_LEFT_FAR;
+ pUnit = m_creature->SummonCreature(MOB_SUMMON_ICECROWN,Pos[2][0],Pos[2][1],Pos[2][2],Pos[2][3],TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
break;
case 1:
- pUnit = m_creature->SummonCreature(16441,ADDX_LEFT_MIDDLE,ADDY_LEFT_MIDDLE,ADDZ_LEFT_MIDDLE,ADDO_LEFT_MIDDLE,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
- //Start moving guardian towards the center of the room
- Walk_Pos_X = WALKX_LEFT_MIDDLE;
- Walk_Pos_Y = WALKY_LEFT_MIDDLE;
- Walk_Pos_Z = WALKZ_LEFT_MIDDLE;
+ pUnit = m_creature->SummonCreature(MOB_SUMMON_ICECROWN,Pos[5][0],Pos[5][1],Pos[5][2],Pos[5][3],TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
break;
case 2:
- pUnit = m_creature->SummonCreature(16441,ADDX_LEFT_NEAR,ADDY_LEFT_NEAR,ADDZ_LEFT_NEAR,ADDO_LEFT_NEAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
- //Start moving guardian towards the center of the room
- Walk_Pos_X = WALKX_LEFT_NEAR;
- Walk_Pos_Y = WALKY_LEFT_NEAR;
- Walk_Pos_Z = WALKZ_LEFT_NEAR;
- break;
- case 3:
-
- pUnit = m_creature->SummonCreature(16441,ADDX_RIGHT_FAR,ADDY_RIGHT_FAR,ADDZ_RIGHT_FAR,ADDO_RIGHT_FAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
- //Start moving guardian towards the center of the room
- Walk_Pos_X = WALKX_RIGHT_FAR;
- Walk_Pos_Y = WALKY_RIGHT_FAR;
- Walk_Pos_Z = WALKZ_RIGHT_FAR;
- break;
- case 4:
- pUnit = m_creature->SummonCreature(16441,ADDX_RIGHT_MIDDLE,ADDY_RIGHT_MIDDLE,ADDZ_RIGHT_MIDDLE,ADDO_RIGHT_MIDDLE,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
- //Start moving guardian towards the center of the room
- Walk_Pos_X = WALKX_RIGHT_MIDDLE;
- Walk_Pos_Y = WALKY_RIGHT_MIDDLE;
- Walk_Pos_Z = WALKZ_RIGHT_MIDDLE;
- break;
- case 5:
- pUnit = m_creature->SummonCreature(16441,ADDX_RIGHT_NEAR,ADDY_RIGHT_NEAR,ADDZ_RIGHT_NEAR,ADDO_RIGHT_NEAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
- //Start moving guardian towards the center of the room
- Walk_Pos_X = WALKX_RIGHT_NEAR;
- Walk_Pos_Y = WALKY_RIGHT_NEAR;
- Walk_Pos_Z = WALKZ_RIGHT_NEAR;
- break;
- }
-
- if (pUnit)
- {
- //if we find no one to figth walk to the center
- if(!pUnit->isInCombat())
- pUnit->SendMonsterMoveWithSpeed(Walk_Pos_X,Walk_Pos_Y,Walk_Pos_Z);
-
- //Safe storing of creatures
- GuardiansOfIcecrown[GuardiansOfIcecrown_Count] = pUnit->GetGUID();
-
- //Update guardian count
- GuardiansOfIcecrown_Count++;
-
+ pUnit = m_creature->SummonCreature(MOB_SUMMON_ICECROWN,Pos[8][0],Pos[8][1],Pos[8][2],Pos[8][3],TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
+ break;
+ }
+
+ if (pUnit)
+ {
+
+ if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
+ {
+ pUnit->AI()->AttackStart(target);
+ }
+ //Safe storing of creatures
+ GuardiansOfIcecrown[GuardiansOfIcecrown_Count] = pUnit->GetGUID();
+
+ //Update guardian count
+ GuardiansOfIcecrown_Count++;
+
+ }
+ //5 seconds until summoning next guardian
+ GuardiansOfIcecrown_Timer = 5000;
}
- //5 seconds until summoning next guardian
- GuardiansOfIcecrown_Timer = 5000;
- }
- else GuardiansOfIcecrown_Timer -= diff;
+ else GuardiansOfIcecrown_Timer -= diff;
- DoMeleeAttackIfReady();
+ DoMeleeAttackIfReady();
}
}
};
@@ -433,11 +450,9 @@ CreatureAI* GetAI_boss_kelthuzadAI(Creature *_Creature)
void AddSC_boss_kelthuzad()
{
-
Script *newscript;
newscript = new Script;
newscript->Name="boss_kelthuzad";
newscript->GetAI = &GetAI_boss_kelthuzadAI;
newscript->RegisterSelf();
}
-
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
index eecbb9cf980..a60dea9871f 100644
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
+++ b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp
@@ -30,8 +30,12 @@ EndScriptData */
#define SPELL_FROST_BREATH 29318
#define SPELL_FROST_AURA 28531
#define SPELL_LIFE_DRAIN 28542
+//#define SPELL_CHILL 28560
#define SPELL_BLIZZARD 28547
#define SPELL_BESERK 26662
+#define SPELL_CLEAVE 19983
+#define SPELL_TAIL_SWEEP 55697
+
struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI
{
@@ -43,6 +47,8 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI
uint32 FrostAura_Timer;
uint32 LifeDrain_Timer;
uint32 Blizzard_Timer;
+ uint32 Tail_Sweep_Timer;
+ uint32 Cleave_Timer;
uint32 Fly_Timer;
uint32 Fly2_Timer;
uint32 Beserk_Timer;
@@ -55,6 +61,8 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI
FrostAura_Timer = 2000;
LifeDrain_Timer = 24000;
Blizzard_Timer = 20000;
+ Tail_Sweep_Timer=(rand()%2+9)*1000;
+ Cleave_Timer=10000;
Fly_Timer = 45000;
Icebolt_Timer = 4000;
land_Timer = 0;
@@ -75,93 +83,113 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public ScriptedAI
if (!UpdateVictim())
return;
- if(phase == 1)
+ if(phase == 1)
+ {
+ if(FrostAura_Timer < diff)
{
- if(FrostAura_Timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_FROST_AURA);
- FrostAura_Timer = 5000;
- }else FrostAura_Timer -= diff;
+ DoCast(m_creature->getVictim(),SPELL_FROST_AURA);
+ FrostAura_Timer = 5000;
+ }else FrostAura_Timer -= diff;
- if(LifeDrain_Timer < diff)
- {
- if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(target,SPELL_LIFE_DRAIN);
- LifeDrain_Timer = 24000;
- }else LifeDrain_Timer -= diff;
+ if(LifeDrain_Timer < diff)
+ {
+ if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(target,SPELL_LIFE_DRAIN);
+ if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
+ DoCast(target,SPELL_LIFE_DRAIN);
- if(Blizzard_Timer < diff)
- {
- if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
- DoCast(target,SPELL_BLIZZARD);
- Blizzard_Timer = 20000;
- }else Blizzard_Timer -= diff;
+ LifeDrain_Timer = 24000;
+ }else LifeDrain_Timer -= diff;
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 10)
- {
- if(Fly_Timer < diff)
- {
- phase = 2;
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveIdle();
- m_creature->SetHover(true);
- Icebolt_Timer = 4000;
- Icebolt_Count = 0;
- IsInFly = true;
- }else Fly_Timer -= diff;
+ if(Blizzard_Timer < diff)
+ {
+ if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
+ {
+ DoCast(target,SPELL_BLIZZARD);
+ //It seems NO damage?
}
- }
+ Blizzard_Timer = 20000;
+ }else Blizzard_Timer -= diff;
+
+ //SPELL_CLEAVE
+ if(Cleave_Timer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_CLEAVE);
+ Cleave_Timer = 10000;
+ }else Cleave_Timer -= diff;
- if (phase == 2)
+ //Tail Sweep_Timer,
+ if(Tail_Sweep_Timer < diff)
+ {
+ DoCast(m_creature,SPELL_TAIL_SWEEP);
+ Tail_Sweep_Timer=(rand()%2+9)*1000;
+ }else Tail_Sweep_Timer -= diff;
+
+ if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 10)
+ {
+ if(Fly_Timer < diff)
{
- if(Icebolt_Timer < diff && Icebolt_Count < 5)
- {
- if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
- {
- DoCast(target,SPELL_ICEBOLT);
- ++Icebolt_Count;
- error_log("Count incremented");
- }
- FrostBreath_Timer = 6000;
- Icebolt_Timer = 4000;
- }else Icebolt_Timer -= diff;
-
- if(Icebolt_Count == 5 && IsInFly && FrostBreath_Timer < diff )
- {
- DoScriptText(EMOTE_BREATH, m_creature);
- DoCast(m_creature->getVictim(),SPELL_FROST_BREATH);
- land_Timer = 2000;
- IsInFly = false;
- FrostBreath_Timer = 6000;
- }else FrostBreath_Timer -= diff;
-
- if(!IsInFly && land_Timer < diff)
- {
- phase = 1;
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->GetMotionMaster()->Clear(false);
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- m_creature->SetHover(true);
- land_Timer = 0;
- Fly_Timer = 67000;
- }else land_Timer -= diff;
- }
+ phase = 2;
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->SetHover(true);
+ Icebolt_Timer = 4000;
+ Icebolt_Count = 0;
+ IsInFly = true;
+ }else Fly_Timer -= diff;
+ }
+ }
- if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 10)
+ if (phase == 2)
+ {
+ if(Icebolt_Timer < diff && Icebolt_Count < 5)
+ {
+ if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
{
- if (Beserk_Timer < diff)
- {
- DoScriptText(EMOTE_ENRAGE, m_creature);
- DoCast(m_creature,SPELL_BESERK);
- Beserk_Timer = 300000;
- }else Beserk_Timer -= diff;
+ DoCast(target,SPELL_ICEBOLT);
+ ++Icebolt_Count;
+ error_log("Count incremented");
}
+ FrostBreath_Timer = 6000;
+ Icebolt_Timer = 4000;
+ }else Icebolt_Timer -= diff;
- if (phase!=2)
- DoMeleeAttackIfReady();
+ if(Icebolt_Count == 5 && IsInFly && FrostBreath_Timer < diff )
+ {
+ DoScriptText(EMOTE_BREATH, m_creature);
+ DoCast(m_creature->getVictim(),SPELL_FROST_BREATH);
+ land_Timer = 2000;
+ IsInFly = false;
+ FrostBreath_Timer = 6000;
+ }else FrostBreath_Timer -= diff;
+
+ if(!IsInFly && land_Timer < diff)
+ {
+ phase = 1;
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ m_creature->GetMotionMaster()->Clear(false);
+ m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
+ m_creature->SetHover(true);
+ land_Timer = 0;
+ Fly_Timer = 67000;
+ }else land_Timer -= diff;
+ }
+
+ if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 10)
+ {
+ if (Beserk_Timer < diff)
+ {
+ DoScriptText(EMOTE_ENRAGE, m_creature);
+ DoCast(m_creature,SPELL_BESERK);
+ Beserk_Timer = 300000;
+ }else Beserk_Timer -= diff;
+ }
+
+ if (phase!=2)
+ DoMeleeAttackIfReady();
}
};
@@ -178,4 +206,3 @@ void AddSC_boss_sapphiron()
newscript->GetAI = &GetAI_boss_sapphiron;
newscript->RegisterSelf();
}
-