mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
Prince fix
Prince fix
This commit is contained in:
@@ -41,7 +41,7 @@ enum creatures
|
|||||||
NETHERSPITE_INFERNAL = 17646,
|
NETHERSPITE_INFERNAL = 17646,
|
||||||
MALCHEZARS_AXE = 17650,
|
MALCHEZARS_AXE = 17650,
|
||||||
INFERNAL_MODEL_INVISIBLE = 11686,
|
INFERNAL_MODEL_INVISIBLE = 11686,
|
||||||
SPELL_INFERNAL_RELAY = 33814, // 30835,
|
SPELL_INFERNAL_RELAY = 33814, // 30835,
|
||||||
EQUIP_ID_AXE = 33542
|
EQUIP_ID_AXE = 33542
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ public:
|
|||||||
DoCast(me, SPELL_HELLFIRE);
|
DoCast(me, SPELL_HELLFIRE);
|
||||||
HellfireTimer = 0;
|
HellfireTimer = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
HellfireTimer -= diff;
|
HellfireTimer -= diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ public:
|
|||||||
{
|
{
|
||||||
CleanupTimer = 0;
|
CleanupTimer = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CleanupTimer -= diff;
|
CleanupTimer -= diff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -211,7 +211,6 @@ public:
|
|||||||
void Reset() override
|
void Reset() override
|
||||||
{
|
{
|
||||||
Initialize();
|
Initialize();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void KilledUnit(Unit* /*victim*/) override
|
void KilledUnit(Unit* /*victim*/) override
|
||||||
@@ -227,7 +226,6 @@ public:
|
|||||||
{
|
{
|
||||||
Axe->DespawnOrUnsummon();
|
Axe->DespawnOrUnsummon();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnterCombat(Unit* /*who*/) override
|
void EnterCombat(Unit* /*who*/) override
|
||||||
@@ -292,33 +290,33 @@ public:
|
|||||||
|
|
||||||
void SummonInfernal()
|
void SummonInfernal()
|
||||||
{
|
{
|
||||||
InfernalPoint *point = 0;
|
InfernalPoint *point = 0;
|
||||||
Position pos;
|
Position pos;
|
||||||
|
|
||||||
if ((me->GetMapId() == 532))
|
if ((me->GetMapId() == 532))
|
||||||
{
|
{
|
||||||
me->GetRandomNearPosition(pos, 40.0);
|
me->GetRandomNearPosition(pos, 40.0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
point = Trinity::Containers::SelectRandomContainerElement(positions);
|
point = Trinity::Containers::SelectRandomContainerElement(positions);
|
||||||
pos.Relocate(point->x, point->y, INFERNAL_Z, frand(0.0f, float(M_PI * 2)));
|
pos.Relocate(point->x, point->y, INFERNAL_Z, frand(0.0f, float(M_PI * 2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Creature* RELAY = me->FindNearestCreature(NPC_RELAY, 100.0f))
|
if (Creature* RELAY = me->FindNearestCreature(NPC_RELAY, 100.0f))
|
||||||
{
|
{
|
||||||
Creature* infernal = RELAY->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000);
|
Creature* infernal = RELAY->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000);
|
||||||
|
|
||||||
if (infernal)
|
if (infernal)
|
||||||
{
|
{
|
||||||
infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE);
|
infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE);
|
||||||
infernal->setFaction(me->getFaction());
|
infernal->setFaction(me->getFaction());
|
||||||
infernals.push_back(infernal->GetGUID());
|
infernals.push_back(infernal->GetGUID());
|
||||||
infernal->SetControlled(true, UNIT_STATE_ROOT);
|
infernal->SetControlled(true, UNIT_STATE_ROOT);
|
||||||
RELAY->AI()->DoCast(infernal, SPELL_INFERNAL_RELAY);
|
RELAY->AI()->DoCast(infernal, SPELL_INFERNAL_RELAY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Talk(SAY_SUMMON);
|
Talk(SAY_SUMMON);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Phase2()
|
void Phase2()
|
||||||
@@ -395,9 +393,10 @@ public:
|
|||||||
if (HealthBelowPct(60))
|
if (HealthBelowPct(60))
|
||||||
{
|
{
|
||||||
Phase2();
|
Phase2();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phase == 2)
|
if (phase == 2)
|
||||||
{
|
{
|
||||||
if (SunderArmorTimer <= diff)
|
if (SunderArmorTimer <= diff)
|
||||||
{
|
{
|
||||||
@@ -440,82 +439,82 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class prince_axes : public CreatureScript
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
prince_axes() : CreatureScript("prince_axes") { }
|
||||||
|
|
||||||
|
CreatureAI* GetAI(Creature* creature) const override
|
||||||
|
{
|
||||||
|
return GetInstanceAI<prince_axesAI>(creature);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct prince_axesAI : public ScriptedAI
|
||||||
|
{
|
||||||
|
|
||||||
|
prince_axesAI(Creature* creature) : ScriptedAI(creature)
|
||||||
|
{
|
||||||
|
Initialize();
|
||||||
|
instance = creature->GetInstanceScript();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 AxesTargetSwitchTimer;
|
||||||
|
InstanceScript* instance;
|
||||||
|
|
||||||
|
|
||||||
|
void Initialize()
|
||||||
|
{
|
||||||
|
AxesTargetSwitchTimer = 7500;
|
||||||
|
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||||
|
me->SetCanDualWield(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Reset()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void EnterCombat(Unit* /*who*/) override
|
||||||
|
{
|
||||||
|
DoZoneInCombat();
|
||||||
|
}
|
||||||
|
|
||||||
|
void changetarget()
|
||||||
|
{
|
||||||
|
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||||
|
{
|
||||||
|
if (me->GetVictim())
|
||||||
|
DoModifyThreatPercent(me->GetVictim(), -100);
|
||||||
|
if (target)
|
||||||
|
me->AddThreat(target, 1000000.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateAI(uint32 diff) override
|
||||||
|
{
|
||||||
|
if (!UpdateVictim())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (AxesTargetSwitchTimer <= diff)
|
||||||
|
{
|
||||||
|
AxesTargetSwitchTimer = urand(7500, 20000);
|
||||||
|
changetarget();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
AxesTargetSwitchTimer -= diff;
|
||||||
|
|
||||||
|
DoMeleeAttackIfReady();
|
||||||
|
}
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
class prince_axes : public CreatureScript
|
void AddSC_boss_malchezaar()
|
||||||
{
|
|
||||||
public:
|
|
||||||
prince_axes() : CreatureScript("prince_axes") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
{
|
||||||
return GetInstanceAI<prince_axesAI>(creature);
|
new boss_malchezaar();
|
||||||
|
new prince_axes();
|
||||||
|
new netherspite_infernal();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct prince_axesAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
|
|
||||||
prince_axesAI(Creature* creature) : ScriptedAI(creature)
|
|
||||||
{
|
|
||||||
Initialize();
|
|
||||||
instance = creature->GetInstanceScript();
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32 AxesTargetSwitchTimer;
|
|
||||||
InstanceScript* instance;
|
|
||||||
|
|
||||||
|
|
||||||
void Initialize()
|
|
||||||
{
|
|
||||||
AxesTargetSwitchTimer = 7500;
|
|
||||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
|
||||||
me->SetCanDualWield(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Reset()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void EnterCombat(Unit* /*who*/) override
|
|
||||||
{
|
|
||||||
DoZoneInCombat();
|
|
||||||
}
|
|
||||||
|
|
||||||
void changetarget()
|
|
||||||
{
|
|
||||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
|
||||||
{
|
|
||||||
if (me->GetVictim())
|
|
||||||
DoModifyThreatPercent(me->GetVictim(), -100);
|
|
||||||
if (target)
|
|
||||||
me->AddThreat(target, 1000000.0f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
|
||||||
{
|
|
||||||
if (!UpdateVictim())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (AxesTargetSwitchTimer <= diff)
|
|
||||||
{
|
|
||||||
AxesTargetSwitchTimer = urand(7500, 20000);
|
|
||||||
changetarget();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
AxesTargetSwitchTimer -= diff;
|
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
void AddSC_boss_malchezaar()
|
|
||||||
{
|
|
||||||
new boss_malchezaar();
|
|
||||||
new prince_axes();
|
|
||||||
new netherspite_infernal();
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user