Drak'Tharon Keep, Trollgore: Fix name collision

Halls of Stone: Chest handling & fix typo, by trazom. Closes #79
Halls of Stone, Sjonnir the Ironshaper: Despawn adds on reset, Attempt to fix
add merging

--HG--
branch : trunk
This commit is contained in:
tartalo
2009-11-05 19:06:08 +01:00
parent c5c6013ced
commit 3d337232c9
3 changed files with 61 additions and 63 deletions
@@ -59,7 +59,7 @@ enum Creatures
NPC_DRAKKARI_INVADER_2 = 27709 NPC_DRAKKARI_INVADER_2 = 27709
}; };
Position SpawnPoint = { -260.493011, -622.968018, 26.605301, 3.036870 }; Position AddSpawnPoint = { -260.493011, -622.968018, 26.605301, 3.036870 };
struct TRINITY_DLL_DECL boss_trollgoreAI : public ScriptedAI struct TRINITY_DLL_DECL boss_trollgoreAI : public ScriptedAI
{ {
@@ -118,7 +118,7 @@ struct TRINITY_DLL_DECL boss_trollgoreAI : public ScriptedAI
if (uiSpawnTimer < diff) if (uiSpawnTimer < diff)
{ {
for (uint8 i = 0; i < urand(2,HEROIC(3,5)); ++i) for (uint8 i = 0; i < urand(2,HEROIC(3,5)); ++i)
DoSpawnCreature(RAND(NPC_DRAKKARI_INVADER_1,NPC_DRAKKARI_INVADER_2), SpawnPoint.GetPositionX(), SpawnPoint.GetPositionY(), SpawnPoint.GetPositionZ(), SpawnPoint.GetOrientation(), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000); DoSpawnCreature(RAND(NPC_DRAKKARI_INVADER_1,NPC_DRAKKARI_INVADER_2), AddSpawnPoint.GetPositionX(), AddSpawnPoint.GetPositionY(), AddSpawnPoint.GetPositionZ(), AddSpawnPoint.GetOrientation(), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
uiSpawnTimer = urand(30000,40000); uiSpawnTimer = urand(30000,40000);
} else uiSpawnTimer -= diff; } else uiSpawnTimer -= diff;
@@ -14,42 +14,42 @@ update creature_template set scriptname = 'boss_sjonnir' where entry = '';
enum Spells enum Spells
{ {
SPELL_LIGHTING_RING = 51849, //Periodic Trigger (interval 2s) spell = 50841 SPELL_LIGHTING_RING = 51849, //Periodic Trigger (interval 2s) spell = 50841
H_SPELL_LIGHTING_RING = 59861, //Periodic Trigger (interval 2s) spell = 59849 H_SPELL_LIGHTING_RING = 59861, //Periodic Trigger (interval 2s) spell = 59849
SPELL_LIGHTING_RING_1 = 50840, //Periodic Trigger (interval 2s) spell = 50841 SPELL_LIGHTING_RING_1 = 50840, //Periodic Trigger (interval 2s) spell = 50841
H_SPELL_LIGHTING_RING_1 = 59848, //Periodic Trigger (interval 2s) spell = 59849 H_SPELL_LIGHTING_RING_1 = 59848, //Periodic Trigger (interval 2s) spell = 59849
SPELL_STATIC_CHARGE = 50834, //Periodic Trigger 2s interval, spell =50835 SPELL_STATIC_CHARGE = 50834, //Periodic Trigger 2s interval, spell =50835
H_SPELL_STATIC_CHARGE = 59846, //Periodic Trigger 2s interval, spell =50847 H_SPELL_STATIC_CHARGE = 59846, //Periodic Trigger 2s interval, spell =50847
SPELL_CHAIN_LIGHTING = 50830, SPELL_CHAIN_LIGHTING = 50830,
H_SPELL_CHAIN_LIGHTING = 59844, H_SPELL_CHAIN_LIGHTING = 59844,
SPELL_LIGHTING_SHIELD = 50831, SPELL_LIGHTING_SHIELD = 50831,
H_SPELL_LIGHTING_SHIELD = 59845, H_SPELL_LIGHTING_SHIELD = 59845,
SPELL_FRENZY = 28747 SPELL_FRENZY = 28747
}; };
enum Yells enum Yells
{ {
SAY_AGGRO = -1603011, SAY_AGGRO = -1603011,
SAY_SLAY_1 = -1603012, SAY_SLAY_1 = -1603012,
SAY_SLAY_2 = -1603013, SAY_SLAY_2 = -1603013,
SAY_SLAY_3 = -1603014, SAY_SLAY_3 = -1603014,
SAY_DEATH = -1603015 SAY_DEATH = -1603015
}; };
#define EMOTE_GENERIC_FRENZY -1000002 #define EMOTE_GENERIC_FRENZY -1000002
enum Creatures enum Creatures
{ {
CREATURE_FORGED_IRON_TROGG = 27979, CREATURE_FORGED_IRON_TROGG = 27979,
CREATURE_MALFORMED_OOZE = 27981, CREATURE_MALFORMED_OOZE = 27981,
CREATURE_FORGED_IRON_DWARF = 27982, CREATURE_FORGED_IRON_DWARF = 27982,
CREATURE_IRON_SLUDGE = 28165 CREATURE_IRON_SLUDGE = 28165
}; };
enum Misc enum Misc
{ {
DATA_TIME_BEFORE_OOZE = 150000, //2min 30 secs DATA_TIME_BEFORE_OOZE = 150000, //2min 30 secs
ACHIEVEMENT_ABUSE_THE_OOZE = 2155 ACHIEV_ABUSE_THE_OOZE = 2155
}; };
struct Locations struct Locations
@@ -67,7 +67,7 @@ static Locations CenterPoint = {1295.21, 667.157, 189.691};
struct TRINITY_DLL_DECL boss_sjonnirAI : public ScriptedAI struct TRINITY_DLL_DECL boss_sjonnirAI : public ScriptedAI
{ {
boss_sjonnirAI(Creature *c) : ScriptedAI(c) boss_sjonnirAI(Creature *c) : ScriptedAI(c), lSummons(me)
{ {
pInstance = c->GetInstanceData(); pInstance = c->GetInstanceData();
} }
@@ -83,6 +83,8 @@ struct TRINITY_DLL_DECL boss_sjonnirAI : public ScriptedAI
uint32 uiEncounterTimer; uint32 uiEncounterTimer;
uint32 uiKilledIronSludges; uint32 uiKilledIronSludges;
SummonList lSummons;
ScriptedInstance* pInstance; ScriptedInstance* pInstance;
void Reset() void Reset()
@@ -98,6 +100,8 @@ struct TRINITY_DLL_DECL boss_sjonnirAI : public ScriptedAI
uiFrenzyTimer = 300000; //5 minutes uiFrenzyTimer = 300000; //5 minutes
uiKilledIronSludges = 0; uiKilledIronSludges = 0;
lSummons.DespawnAll();
if (pInstance) if (pInstance)
pInstance->SetData(DATA_SJONNIR_EVENT, NOT_STARTED); pInstance->SetData(DATA_SJONNIR_EVENT, NOT_STARTED);
} }
@@ -175,29 +179,20 @@ struct TRINITY_DLL_DECL boss_sjonnirAI : public ScriptedAI
summon->GetMotionMaster()->MovePoint(0, CenterPoint.x, CenterPoint.y, CenterPoint.z); summon->GetMotionMaster()->MovePoint(0, CenterPoint.x, CenterPoint.y, CenterPoint.z);
/*if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) /*if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
summon->AI()->AttackStart(pTarget);*/ summon->AI()->AttackStart(pTarget);*/
lSummons.Summon(summon);
} }
void JustDied(Unit* killer) void JustDied(Unit* killer)
{ {
DoScriptText(SAY_DEATH, m_creature); DoScriptText(SAY_DEATH, m_creature);
lSummons.DespawnAll();
if (HeroicMode && uiKilledIronSludges > 4)
{
AchievementEntry const *AchievAbuseTheOoze = GetAchievementStore()->LookupEntry(ACHIEVEMENT_ABUSE_THE_OOZE);
if (AchievAbuseTheOoze)
{
Map* pMap = m_creature->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
itr->getSource()->CompletedAchievement(AchievAbuseTheOoze);
}
}
}
if (pInstance) if (pInstance)
{
pInstance->SetData(DATA_SJONNIR_EVENT, DONE); pInstance->SetData(DATA_SJONNIR_EVENT, DONE);
if (HeroicMode && uiKilledIronSludges > 4)
pInstance->DoCompleteAchievement(ACHIEV_ABUSE_THE_OOZE);
}
} }
void KilledUnit(Unit *victim) void KilledUnit(Unit *victim)
{ {
@@ -222,41 +217,30 @@ struct TRINITY_DLL_DECL mob_malformed_oozeAI : public ScriptedAI
mob_malformed_oozeAI(Creature *c) : ScriptedAI(c) {} mob_malformed_oozeAI(Creature *c) : ScriptedAI(c) {}
uint32 uiMergeTimer; uint32 uiMergeTimer;
bool bIsMerging;
void Reset() void Reset()
{ {
uiMergeTimer = 5000; uiMergeTimer = 10000;
bIsMerging = false;
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
{ {
if (bIsMerging) if (uiMergeTimer <= diff)
{ {
if (uiMergeTimer <= diff) if (Creature* pTemp = m_creature->FindNearestCreature(CREATURE_MALFORMED_OOZE, 3.0f, true))
{ {
if (Creature* pTemp = m_creature->FindNearestCreature(CREATURE_MALFORMED_OOZE, 1.0f, true)) DoSpawnCreature(CREATURE_IRON_SLUDGE, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000);
{ pTemp->DisappearAndDie();
DoSpawnCreature(CREATURE_IRON_SLUDGE, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000); m_creature->DisappearAndDie();
pTemp->DisappearAndDie(); }
m_creature->DisappearAndDie(); uiMergeTimer = 3000;
} else bIsMerging = false; } else uiMergeTimer -= diff;
} else uiMergeTimer -= diff;
}
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
void MovementInform(uint32 type, uint32 id)
{
if(type != POINT_MOTION_TYPE)
return;
bIsMerging = true;
}
}; };
CreatureAI* GetAI_mob_malformed_ooze(Creature* pCreature) CreatureAI* GetAI_mob_malformed_ooze(Creature* pCreature)
@@ -10,6 +10,12 @@
3- Sjonnir The Ironshaper 3- Sjonnir The Ironshaper
*/ */
enum GameObjects
{
GO_TRIBUNAL_CHEST = 190586,
GO_TRIBUNAL_CHEST_HERO = 193996
};
struct TRINITY_DLL_DECL instance_halls_of_stone : public ScriptedInstance struct TRINITY_DLL_DECL instance_halls_of_stone : public ScriptedInstance
{ {
instance_halls_of_stone(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; instance_halls_of_stone(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
@@ -71,7 +77,7 @@ struct TRINITY_DLL_DECL instance_halls_of_stone : public ScriptedInstance
case 27978: uiSjonnir = pCreature->GetGUID(); break; case 27978: uiSjonnir = pCreature->GetGUID(); break;
case 30897: uiMarnak = pCreature->GetGUID(); break; case 30897: uiMarnak = pCreature->GetGUID(); break;
case 30898: uiKaddrak = pCreature->GetGUID(); break; case 30898: uiKaddrak = pCreature->GetGUID(); break;
case 30099: uiAbedneum = pCreature->GetGUID(); break; case 30899: uiAbedneum = pCreature->GetGUID(); break;
case 28070: uiBrann = pCreature->GetGUID(); break; case 28070: uiBrann = pCreature->GetGUID(); break;
} }
} }
@@ -113,8 +119,11 @@ struct TRINITY_DLL_DECL instance_halls_of_stone : public ScriptedInstance
case 193907: case 193907:
uiTribunalConsole = pGo->GetGUID(); uiTribunalConsole = pGo->GetGUID();
break; break;
case 190586: case GO_TRIBUNAL_CHEST:
case GO_TRIBUNAL_CHEST_HERO:
uiTribunalChest = pGo->GetGUID(); uiTribunalChest = pGo->GetGUID();
if (m_auiEncounter[2] == DONE)
pGo->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_INTERACT_COND);
break; break;
case 191527: case 191527:
uiTribunalSkyFloor = pGo->GetGUID(); uiTribunalSkyFloor = pGo->GetGUID();
@@ -142,7 +151,12 @@ struct TRINITY_DLL_DECL instance_halls_of_stone : public ScriptedInstance
case DATA_BRANN_EVENT: case DATA_BRANN_EVENT:
m_auiEncounter[2] = data; m_auiEncounter[2] = data;
if (m_auiEncounter[2] == DONE) if (m_auiEncounter[2] == DONE)
{
HandleGameObject(uiSjonnirDoor,true); HandleGameObject(uiSjonnirDoor,true);
GameObject *pGo = instance->GetGameObject(uiTribunalChest);
if (pGo)
pGo->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_INTERACT_COND);
}
break; break;
} }