示例#1
0
        public override void SummonedCreatureDespawn(Creature summon)
        {
            uint nextPhase = 0;

            Summons.Despawn(summon);

            // Check if all summons in this phase killed
            foreach (var guid in Summons)
            {
                Creature visage = ObjectAccessor.GetCreature(me, guid);
                if (visage)
                {
                    // Not all are dead
                    if (visage.IsInPhase(summon))
                    {
                        return;
                    }
                    else
                    {
                        nextPhase = visage.GetPhases().First();
                        break;
                    }
                }
            }

            // Roll Insanity
            var players = me.GetMap().GetPlayers();

            foreach (var player in players)
            {
                if (player)
                {
                    for (uint index = 0; index <= 4; ++index)
                    {
                        player.RemoveAurasDueToSpell(SpellIds.InsanityTarget + index);
                    }
                    player.CastSpell(player, SpellIds.InsanityTarget + nextPhase - 173, true);
                }
            }
        }
示例#2
0
 public override void SummonedCreatureDies(Creature summoned, Unit who)
 {
     Summons.Despawn(summoned);
     ++KillCount;
 }