mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Ulduar: Add proper support for Razorscale summon event.
DB/SQL: Remove duplicate script from world database
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
UPDATE `creature_template` SET `flags_extra`=128 WHERE `entry` IN (33245,34188);
|
||||
UPDATE `creature_template` SET `ScriptName`= '' WHERE `entry`=33282;
|
||||
@@ -55,6 +55,12 @@ enum Spells
|
||||
SPELL_HARPOON_SHOT_2 = 63657,
|
||||
SPELL_HARPOON_SHOT_3 = 63659,
|
||||
SPELL_HARPOON_SHOT_4 = 63524,
|
||||
// MoleMachine Spells
|
||||
SPELL_SUMMON_MOLE_MACHINE = 62899,
|
||||
SPELL_SUMMON_IRON_DWARVES = 63116,
|
||||
SPELL_SUMMON_IRON_DWARVES_2 = 63114,
|
||||
SPELL_SUMMON_IRON_DWARVE_GUARDIAN = 62926,
|
||||
SPELL_SUMMON_IRON_DWARVE_WATCHER = 63135,
|
||||
};
|
||||
|
||||
enum NPC
|
||||
@@ -541,7 +547,7 @@ class boss_razorscale : public CreatureScript
|
||||
float x = float(irand(540, 640)); // Safe range is between 500 and 650
|
||||
float y = float(irand(-230, -195)); // Safe range is between -235 and -145
|
||||
float z = GROUND_Z; // Ground level
|
||||
me->SummonCreature(MOLE_MACHINE_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 10000);
|
||||
me->SummonCreature(MOLE_MACHINE_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 15000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -726,45 +732,64 @@ class npc_mole_machine_trigger : public CreatureScript
|
||||
{
|
||||
npc_mole_machine_triggerAI(Creature* creature) : Scripted_NoMovementAI(creature)
|
||||
{
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
|
||||
me->SetVisible(false);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED);
|
||||
}
|
||||
|
||||
uint32 SummonTimer;
|
||||
uint32 SummonGobTimer;
|
||||
uint32 SummonNpcTimer;
|
||||
uint32 DissapearTimer;
|
||||
bool GobSummoned;
|
||||
bool NpcSummoned;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (GameObject* MoleMachine = me->SummonGameObject(GO_MOLE_MACHINE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), float(urand(0, 6)), 0, 0, 0, 0, 300))
|
||||
MoleMachine->SetGoState(GO_STATE_ACTIVE);
|
||||
SummonTimer = 6000;
|
||||
SummonGobTimer = 2000;
|
||||
SummonNpcTimer = 6000;
|
||||
DissapearTimer = 10000;
|
||||
GobSummoned = false;
|
||||
NpcSummoned = false;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 const Diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (SummonTimer <= Diff)
|
||||
if (!GobSummoned && SummonGobTimer <= Diff)
|
||||
{
|
||||
float x = me->GetPositionX();
|
||||
float y = me->GetPositionY();
|
||||
float z = me->GetPositionZ();
|
||||
|
||||
// One mole can spawn a Dark Rune Watcher with 1-2 Guardians, or a lone Sentinel
|
||||
uint8 id = urand(0, 1);
|
||||
if (id)
|
||||
{
|
||||
me->SummonCreature(NPC_DARK_RUNE_WATCHER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
|
||||
for (uint8 n = 0; n < urand(1, 2); n++)
|
||||
me->SummonCreature(NPC_DARK_RUNE_GUARDIAN, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
|
||||
}
|
||||
else
|
||||
me->SummonCreature(NPC_DARK_RUNE_SENTINEL, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
|
||||
|
||||
SummonTimer = 15000;
|
||||
DoCast(SPELL_SUMMON_MOLE_MACHINE);
|
||||
if (GameObject* molemachine = me->FindNearestGameObject(GO_MOLE_MACHINE, 1))
|
||||
molemachine->SetGoState(GO_STATE_ACTIVE);
|
||||
GobSummoned = true;
|
||||
}
|
||||
else
|
||||
SummonTimer -= Diff;
|
||||
SummonGobTimer -= Diff;
|
||||
|
||||
if (!NpcSummoned && SummonNpcTimer <= Diff)
|
||||
{
|
||||
switch (urand(0, 1 ))
|
||||
{
|
||||
case 0:
|
||||
DoCast(SPELL_SUMMON_IRON_DWARVES);
|
||||
break;
|
||||
case 1:
|
||||
DoCast(SPELL_SUMMON_IRON_DWARVES_2);
|
||||
break;
|
||||
}
|
||||
|
||||
DoCast(SPELL_SUMMON_IRON_DWARVE_GUARDIAN);
|
||||
DoCast(SPELL_SUMMON_IRON_DWARVE_WATCHER);
|
||||
NpcSummoned = true;
|
||||
}
|
||||
else
|
||||
SummonNpcTimer -= Diff;
|
||||
|
||||
if (DissapearTimer <= Diff)
|
||||
{
|
||||
if (GameObject* molemachine = me->FindNearestGameObject(GO_MOLE_MACHINE, 1))
|
||||
molemachine->Delete();
|
||||
|
||||
me->DisappearAndDie();
|
||||
}
|
||||
else
|
||||
DissapearTimer -= Diff;
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
@@ -788,8 +813,7 @@ class npc_devouring_flame : public CreatureScript
|
||||
{
|
||||
npc_devouring_flameAI(Creature* creature) : Scripted_NoMovementAI(creature)
|
||||
{
|
||||
me->SetDisplayId(me->GetCreatureInfo()->Modelid2);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
@@ -811,12 +835,7 @@ class npc_darkrune_watcher : public CreatureScript
|
||||
|
||||
struct npc_darkrune_watcherAI : public ScriptedAI
|
||||
{
|
||||
npc_darkrune_watcherAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
npc_darkrune_watcherAI(Creature* creature) : ScriptedAI(creature){}
|
||||
|
||||
uint32 ChainTimer;
|
||||
uint32 LightTimer;
|
||||
@@ -865,12 +884,7 @@ class npc_darkrune_guardian : public CreatureScript
|
||||
|
||||
struct npc_darkrune_guardianAI : public ScriptedAI
|
||||
{
|
||||
npc_darkrune_guardianAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
npc_darkrune_guardianAI(Creature* creature) : ScriptedAI(creature){}
|
||||
|
||||
uint32 StormTimer;
|
||||
|
||||
@@ -909,12 +923,7 @@ class npc_darkrune_sentinel : public CreatureScript
|
||||
|
||||
struct npc_darkrune_sentinelAI : public ScriptedAI
|
||||
{
|
||||
npc_darkrune_sentinelAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
npc_darkrune_sentinelAI(Creature* creature) : ScriptedAI(creature){}
|
||||
|
||||
uint32 HeroicTimer;
|
||||
uint32 WhirlTimer;
|
||||
|
||||
Reference in New Issue
Block a user