Violet Hold: Fix crystal activation mechanic

--HG--
branch : trunk
This commit is contained in:
Tartalo
2010-06-28 22:39:54 +02:00
parent 948f333dc3
commit 9bedc08b71
@@ -56,6 +56,11 @@ enum AzureSaboteurSpells
SABOTEUR_SHIELD_EFFECT = 45775
};
enum CrystalSpells
{
SPELL_ARCANE_LIGHTNING = 57912
};
const Position PortalLocation[] =
{
{1877.51, 850.104, 44.6599, 4.7822 }, // WP 1
@@ -367,15 +372,8 @@ struct instance_violet_hold : public ScriptedInstance
}
break;
case DATA_ACTIVATE_CRYSTAL:
// Kill all mobs registered with SetData64(ADD_TRASH_MOB)
// TODO: All visual, spells etc
bCrystalActivated = true;
for (std::set<uint64>::const_iterator itr = trashMobs.begin(); itr != trashMobs.end(); ++itr)
{
Creature* pCreature = instance->GetCreature(*itr);
if (pCreature && pCreature->isAlive())
pCreature->Kill(pCreature);
}
ActivateCrystal();
break;
}
}
@@ -754,6 +752,19 @@ struct instance_violet_hold : public ScriptedInstance
SetData(DATA_MAIN_DOOR,GO_STATE_ACTIVE);
}
}
void ActivateCrystal()
{
// Kill all mobs registered with SetData64(ADD_TRASH_MOB)
// TODO: All visual, spells etc
bCrystalActivated = true;
for (std::set<uint64>::const_iterator itr = trashMobs.begin(); itr != trashMobs.end(); ++itr)
{
Creature* pCreature = instance->GetCreature(*itr);
if (pCreature && pCreature->isAlive())
pCreature->CastSpell(pCreature,SPELL_ARCANE_LIGHTNING,true); // Who should cast the spell?
}
}
};
InstanceData* GetInstanceData_instance_violet_hold(Map* pMap)