void ActivateCrystal() { // just to make things easier we'll get the gameobject from the map GameObject* invoker = instance->GetGameObject(uiActivationCrystal[0]); if (!invoker) return; SpellInfo const* spellInfoLightning = sSpellMgr->GetSpellInfo(SPELL_ARCANE_LIGHTNING); if (!spellInfoLightning) return; // the orb TempSummon* trigger = invoker->SummonCreature(NPC_DEFENSE_SYSTEM, ArcaneSphere, TEMPSUMMON_MANUAL_DESPAWN, 0); if (!trigger) return; // visuals trigger->CastSpell(trigger, spellInfoLightning, true, 0, 0, trigger->GetGUID()); // Kill all mobs registered with SetData64(ADD_TRASH_MOB) for (std::set<uint64>::const_iterator itr = trashMobs.begin(); itr != trashMobs.end(); ++itr) { Creature* creature = instance->GetCreature(*itr); if (creature && creature->IsAlive()) trigger->Kill(creature); } }