Ejemplo n.º 1
0
 public override void JustDied(Unit killer)
 {
     if (!PlayerGUID.IsEmpty() && !Completed)
     {
         Player player = Global.ObjAccessor.GetPlayer(me, PlayerGUID);
         if (player)
         {
             player.FailQuest(QuestPoweringOurDefenses);
         }
     }
 }
Ejemplo n.º 2
0
            public override void JustDied(Unit killer)
            {
                me.SetFaction(FactionNormal);

                if (!PlayerGUID.IsEmpty())
                {
                    Player player = Global.ObjAccessor.GetPlayer(me, PlayerGUID);
                    if (player)
                    {
                        player.FailQuest(QUEST_UNEXPECTED_RESULT);
                    }
                }
            }
Ejemplo n.º 3
0
            public override void UpdateAI(uint diff)
            {
                if (KillCount >= 3 && !PlayerGUID.IsEmpty())
                {
                    Player player = Global.ObjAccessor.GetPlayer(me, PlayerGUID);
                    if (player)
                    {
                        if (player.GetQuestStatus(QUEST_UNEXPECTED_RESULT) == QuestStatus.Incomplete)
                        {
                            player.CompleteQuest(QUEST_UNEXPECTED_RESULT);
                            me.SetFaction(FactionNormal);
                            me.SetFlag64(UnitFields.NpcFlags, NPCFlags.QuestGiver);
                        }
                    }
                }

                _events.Update(diff);
                _events.ExecuteEvents(eventId =>
                {
                    switch (eventId)
                    {
                    case EventTalk:
                        Talk(SayTestSoil);
                        _events.ScheduleEvent(EventAddQuestGiverFlag, 7000);
                        break;

                    case EventAddQuestGiverFlag:
                        me.SetFlag64(UnitFields.NpcFlags, NPCFlags.QuestGiver);
                        break;

                    case EventSummon:
                        me.SummonCreature(NPC_GHARZUL, 8749.505f, -7132.595f, 35.31983f, 3.816502f, TempSummonType.CorpseTimedDespawn, 180000);
                        me.SummonCreature(NPC_ANGERSHADE, 8755.38f, -7131.521f, 35.30957f, 3.816502f, TempSummonType.CorpseTimedDespawn, 180000);
                        me.SummonCreature(NPC_ANGERSHADE, 8753.199f, -7125.975f, 35.31986f, 3.816502f, TempSummonType.CorpseTimedDespawn, 180000);
                        break;

                    case EventFireball:
                        if (UpdateVictim())
                        {
                            DoCastVictim(SpellFireball, true);      // Not casting in combat
                            _events.ScheduleEvent(EventFireball, 3000);
                        }
                        break;

                    default:
                        break;
                    }
                });
                DoMeleeAttackIfReady();
            }
Ejemplo n.º 4
0
            public override void UpdateAI(uint diff)
            {
                if (EndTimer < diff && Progress)
                {
                    Talk(Emote);
                    Completed = true;
                    if (!PlayerGUID.IsEmpty())
                    {
                        Player player = Global.ObjAccessor.GetPlayer(me, PlayerGUID);
                        if (player)
                        {
                            player.CompleteQuest(QuestPoweringOurDefenses);
                        }
                    }

                    me.DealDamage(me, (uint)me.GetHealth(), null, DamageEffectType.Direct, SpellSchoolMask.Normal, null, false);
                    me.RemoveCorpse();
                }
                else
                {
                    EndTimer -= diff;
                }

                if (WaveTimer < diff && !Completed && Progress)
                {
                    uint ran1 = RandomHelper.Rand32() % 8;
                    uint ran2 = RandomHelper.Rand32() % 8;
                    uint ran3 = RandomHelper.Rand32() % 8;
                    me.SummonCreature(NpcEnragedWeaith, SpawnLocations[ran1].X, SpawnLocations[ran1].Y, SpawnLocations[ran1].Z, 0, TempSummonType.TimedOrCorpseDespawn, 10000);
                    me.SummonCreature(NpcEnragedWeaith, SpawnLocations[ran2].X, SpawnLocations[ran2].Y, SpawnLocations[ran2].Z, 0, TempSummonType.TimedOrCorpseDespawn, 10000);
                    me.SummonCreature(NpcEnragedWeaith, SpawnLocations[ran3].X, SpawnLocations[ran3].Y, SpawnLocations[ran3].Z, 0, TempSummonType.TimedOrCorpseDespawn, 10000);
                    WaveTimer = 30000;
                }
                else
                {
                    WaveTimer -= diff;
                }
            }