Scripts/Ulduar/Freya: Fix chest spawn on death. Note that this needs DB data, both for loot and possibly gobject templates.

Closes #2220
Ref #1928
Ref #1878
This commit is contained in:
Machiavelli
2011-10-08 13:17:40 +02:00
parent 35126d3c5e
commit 7b0bff3f7b
3 changed files with 17 additions and 8 deletions
@@ -373,7 +373,7 @@ class boss_freya : public CreatureScript
{ {
me->AddAura(SPELL_DRAINED_OF_POWER, Elder[n]); me->AddAura(SPELL_DRAINED_OF_POWER, Elder[n]);
Elder[n]->CastSpell(me, SPELL_IRONBRANCH_ESSENCE, true); Elder[n]->CastSpell(me, SPELL_IRONBRANCH_ESSENCE, true);
Elder[n]->RemoveLootMode(LOOT_MODE_DEFAULT); Elder[n]->RemoveLootMode(LOOT_MODE_DEFAULT); //! Why?
Elder[n]->AI()->AttackStart(who); Elder[n]->AI()->AttackStart(who);
Elder[n]->AddThreat(who, 250.0f); Elder[n]->AddThreat(who, 250.0f);
Elder[n]->SetInCombatWith(who); Elder[n]->SetInCombatWith(who);
@@ -627,6 +627,21 @@ class boss_freya : public CreatureScript
waveCount++; waveCount++;
} }
void JustDied(Unit* who)
{
//! Freya's chest is dynamically spawned on death by different spells.
const uint32 summonSpell[2][4] =
{
/* 0Elder, 1Elder, 2Elder, 3Elder */
/* 10N */ {62950, 62953, 62955, 62957},
/* 25N */ {62952, 62954, 62956, 62958}
};
who->CastSpell((Unit*)NULL, summonSpell[me->GetMap()->GetDifficulty()][elderCount], true);
_JustDied();
}
void JustSummoned(Creature* summoned) void JustSummoned(Creature* summoned)
{ {
switch (summoned->GetEntry()) switch (summoned->GetEntry())
@@ -423,6 +423,7 @@ class instance_ulduar : public InstanceMapScript
case BOSS_XT002: case BOSS_XT002:
case BOSS_AURIAYA: case BOSS_AURIAYA:
case BOSS_MIMIRON: case BOSS_MIMIRON:
case BOSS_FREYA:
break; break;
case BOSS_ASSEMBLY_OF_IRON: case BOSS_ASSEMBLY_OF_IRON:
if (state == DONE) if (state == DONE)
@@ -466,11 +467,6 @@ class instance_ulduar : public InstanceMapScript
if (GameObject* gameObject = instance->GetGameObject(ThorimChestGUID)) if (GameObject* gameObject = instance->GetGameObject(ThorimChestGUID))
gameObject->SetRespawnTime(gameObject->GetRespawnDelay()); gameObject->SetRespawnTime(gameObject->GetRespawnDelay());
break; break;
case BOSS_FREYA:
if (state == DONE)
if (GameObject* gameObject = instance->GetGameObject(FreyaChestGUID))
gameObject->SetRespawnTime(gameObject->GetRespawnDelay());
break;
} }
return true; return true;
@@ -129,8 +129,6 @@ enum UlduarGameObjects
GO_HODIR_RARE_CACHE_OF_WINTER_HERO = 194201, GO_HODIR_RARE_CACHE_OF_WINTER_HERO = 194201,
GO_HODIR_CHEST_HERO = 194308, GO_HODIR_CHEST_HERO = 194308,
GO_HODIR_CHEST = 194307, GO_HODIR_CHEST = 194307,
GO_FREYA_CHEST_HERO = 194325,
GO_FREYA_CHEST = 194324,
GO_LEVIATHAN_DOOR = 194905, GO_LEVIATHAN_DOOR = 194905,
GO_LEVIATHAN_GATE = 194630, GO_LEVIATHAN_GATE = 194630,
GO_XT_002_DOOR = 194631, GO_XT_002_DOOR = 194631,