コード例 #1
0
 void JustSummoned(Creature* creature)
 {
     summons.Summon(creature);
 }
コード例 #2
0
		void JustSummoned(Creature* pSummoned) {
			Summons.Summon(pSummoned);
		}
コード例 #3
0
 void JustSummoned(Creature* summoned)
 {
     if( Unit* Muru = me->GetUnit(pInstance->GetData64(DATA_MURU)))
         ((boss_muruAI*)Muru)->JustSummoned(summoned);
     Summons.Summon(summoned);
 }
コード例 #4
0
 void JustSummoned(Creature* summon)
 {
     summons.Summon(summon);
     DoZoneInCombat(summon);
 }
コード例 #5
0
 void JustSummoned(Creature* summoned)
 {
     summoned->AI()->AttackStart(me);
     Summons.Summon(summoned);
 }
コード例 #6
0
 void JustSummoned(Creature* summoned)
 {
     Summons.Summon(summoned);
     ++KillCount;
 }
コード例 #7
0
ファイル: boss_magmaw.cpp プロジェクト: Exodius/chuspi
 void JustSummoned(Creature* summon)
 {
     summons.Summon(summon);
     if (me->IsInCombat())
         summon->SetInCombatWithZone();
 }
コード例 #8
0
        void UpdateAI(uint32 diff)
        {
            if (!CanStartEvent) // boss is invisible, don't attack
            {
                if (CheckCanStart())
                {
                    if (Submerged)
                    {
                        me->SetVisible(true);
                        Submerged = false;
                        WaitTimer2 = 500;
                    }

                    if (!Submerged && WaitTimer2 <= diff) // wait 500ms before emerge anim
                    {
                        me->RemoveAllAuras();
                        me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
                        DoCast(me, SPELL_EMERGE, false);
                        WaitTimer2 = 60000; // never reached
                        WaitTimer = 3000;
                    }
                    else
                        WaitTimer2 -= diff;

                    if (WaitTimer <= diff) // wait 3secs for emerge anim, then attack
                    {
                        WaitTimer = 3000;
                        CanStartEvent = true; // fresh fished from pool
                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
                        me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                    }
                    else
                        WaitTimer -= diff;
                }
                return;
            }

            if (me->getThreatManager().getThreatList().empty()) // check if should evade
            {
                if (me->IsInCombat())
                    EnterEvadeMode();
                return;
            }
            if (!Submerged)
            {
                if (PhaseTimer <= diff)
                {
                    me->InterruptNonMeleeSpells(false);
                    DoCast(me, SPELL_SUBMERGE);
                    PhaseTimer = 60000; // 60secs submerged
                    Submerged = true;
                } else PhaseTimer-=diff;

                if (SpoutTimer <= diff)
                {
                    me->MonsterTextEmote(EMOTE_SPOUT, 0, true);
                    me->SetReactState(REACT_PASSIVE);
                    me->GetMotionMaster()->MoveRotate(20000, urand(0, 1) ? ROTATE_DIRECTION_LEFT : ROTATE_DIRECTION_RIGHT);
                    SpoutTimer = 45000;
                    WhirlTimer = 20000; // whirl directly after spout
                    RotTimer = 20000;
                    return;
                } else SpoutTimer -= diff;

                // Whirl directly after a Spout and at random times
                if (WhirlTimer <= diff)
                {
                    WhirlTimer = 18000;
                    DoCast(me, SPELL_WHIRL);
                } else WhirlTimer -= diff;

                if (CheckTimer <= diff)//check if there are players in melee range
                {
                    InRange = false;
                    Map* map = me->GetMap();
                    Map::PlayerList const &PlayerList = map->GetPlayers();
                    if (!PlayerList.isEmpty())
                    {
                        for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
                        {
                            if (me->IsWithinMeleeRange(i->GetSource()))
                                InRange = true;
                        }
                    }
                    CheckTimer = 2000;
                } else CheckTimer -= diff;

                if (RotTimer)
                {
                    Map* map = me->GetMap();
                    if (map->IsDungeon())
                    {
                        Map::PlayerList const &PlayerList = map->GetPlayers();
                        for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
                        {
                            if (i->GetSource() && i->GetSource()->IsAlive() && me->HasInArc(float(diff/20000*M_PI*2), i->GetSource()) && me->IsWithinDist(i->GetSource(), SPOUT_DIST) && !i->GetSource()->IsInWater())
                                DoCast(i->GetSource(), SPELL_SPOUT, true); // only knock back players in arc, in 100yards, not in water
                        }
                    }

                    if (SpoutAnimTimer <= diff)
                    {
                        DoCast(me, SPELL_SPOUT_ANIM, true);
                        SpoutAnimTimer = 1000;
                    } else SpoutAnimTimer -= diff;

                    if (RotTimer <= diff)
                    {
                        RotTimer = 0;
                    } else RotTimer -= diff;
                    return;
                }

                if (GeyserTimer <= diff)
                {
                    Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
                    if (!target && me->GetVictim())
                        target = me->GetVictim();
                    if (target)
                        DoCast(target, SPELL_GEYSER, true);
                    GeyserTimer = rand()%5000 + 15000;
                } else GeyserTimer -= diff;

                if (!InRange) // if on players in melee range cast Waterbolt
                {
                    if (WaterboltTimer <= diff)
                    {
                        Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
                        if (!target && me->GetVictim())
                            target = me->GetVictim();
                        if (target)
                            DoCast(target, SPELL_WATERBOLT, true);
                        WaterboltTimer = 3000;
                    } else WaterboltTimer -= diff;
                }

                if (!UpdateVictim())
                    return;

                DoMeleeAttackIfReady();

            }
            else // submerged
            {
                if (PhaseTimer <= diff)
                {
                    Submerged = false;
                    me->InterruptNonMeleeSpells(false); // shouldn't be any
                    me->RemoveAllAuras();
                    me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
                    me->RemoveFlag(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED);
                    DoCast(me, SPELL_EMERGE, true);
                    Spawned = false;
                    SpoutTimer = 3000; // directly cast Spout after emerging!
                    PhaseTimer = 120000;
                    return;
                } else PhaseTimer-=diff;

                if (me->getThreatManager().getThreatList().empty()) // check if should evade
                {
                    EnterEvadeMode();
                    return;
                }

                if (!me->IsInCombat())
                    DoZoneInCombat();

                if (!Spawned)
                {
                    me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
                    // spawn adds
                    for (uint8 i = 0; i < 9; ++i)
                        if (Creature* summoned = me->SummonCreature(i < 6 ? MOB_COILFANG_AMBUSHER : MOB_COILFANG_GUARDIAN, AddPos[i][0], AddPos[i][1], AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0))
                            Summons.Summon(summoned);
                    Spawned = true;
                }
            }
        }
コード例 #9
0
 void JustSummoned(Creature* summon) override
 {
     Summons.Summon(summon);
 }
コード例 #10
0
			void UpdateAI(uint32 diff)
			{
				events2.Update(diff);
				switch (events2.ExecuteEvent())
				{
					case EVENT_SHADE_GATHER_NPCS:
					{
						std::list<Creature*> ChannelerList;
						me->GetCreaturesWithEntryInRange(ChannelerList, 100.0f, NPC_ASHTONGUE_CHANNELER);
						for (std::list<Creature*>::const_iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr)
							summonsChanneler.Summon(*itr);

						std::list<Creature*> SpawnerList;
						me->GetCreaturesWithEntryInRange(SpawnerList, 100.0f, NPC_CREATURE_GENERATOR_AKAMA);
						for (std::list<Creature*>::const_iterator itr = SpawnerList.begin(); itr != SpawnerList.end(); ++itr)
							summonsGenerator.Summon(*itr);

						summonsChanneler.Respawn();
						summonsGenerator.Respawn();
						ChannelersAction(ACTION_CHANNELERS_START_CHANNEL);
						
						if (Creature* akama = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_AKAMA_SHADE)))
							akama->Respawn(true);
						break;
					}
					case EVENT_SHADE_RESET_ENCOUNTER:
						me->SetVisible(true);
						summonsGenerator.Respawn();
						summonsChanneler.Respawn();
						ChannelersAction(ACTION_CHANNELERS_START_CHANNEL);

						if (Creature* akama = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_AKAMA_SHADE)))
							akama->Respawn(true);
						break;
				}

				if (!UpdateVictim())
					return;

				events.Update(diff);
				if (me->HasUnitState(UNIT_STATE_CASTING))
					return;

				switch (events.ExecuteEvent())
				{
					case EVENT_SHADE_CHECK_DISTANCE:
						if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
						{
							int32 slow = me->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_DECREASE_SPEED);
							if (slow > -100)
							{
								me->SetWalk(true);
								me->GetMotionMaster()->MovePoint(POINT_START, 510.0f, 400.7993f, 112.7837f);
							}
						}
						else
						{
							int32 slow = me->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_DECREASE_SPEED);
							if (slow < -100)
								me->GetMotionMaster()->Clear();
							else if (slow == 0)
							{
								summonsGenerator.DoAction(ACTION_NO_SORCERERS);
								me->SetWalk(false);
							}
						}

						if (me->IsWithinMeleeRange(me->GetVictim()))
						{
							me->SetReactState(REACT_AGGRESSIVE);
							DoResetThreat();
							me->GetVictim()->InterruptNonMeleeSpells(false);
							me->AddThreat(me->GetVictim(), 1000000.0f);
							me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC|UNIT_FLAG_NOT_SELECTABLE);
							summonsGenerator.DoAction(ACTION_STOP_SPAWNING);
							break;
						}
						events.ScheduleEvent(EVENT_SHADE_CHECK_DISTANCE, 1000);
						break;
				}

				DoMeleeAttackIfReady();
				EnterEvadeIfOutOfCombatArea();
			}
コード例 #11
0
 void JustSummoned(Creature* summon)
 {
     summons.Summon(summon);
     summon->AI()->DoZoneInCombat();
 }
コード例 #12
0
 void JustSummoned(Creature* s)
 {
     summons.Summon(s);
 }
コード例 #13
0
 void JustSummoned(Creature *summon)
 {
         summons.Summon(summon);
         summon->AI()->AttackStart(me->getVictim());
 summon->AI()->DoZoneInCombat();
 }
コード例 #14
0
		void JustSummoned(Creature* pSummoned) {
			Summons.Summon(pSummoned);
			pSummoned->SetCorpseDelay(0);
		}
コード例 #15
0
ファイル: icecrown.cpp プロジェクト: Carbinfibre/Script-Land
 void JustSummoned(Creature* Summoned)
 {
     Summons.Summon(Summoned);
 }
コード例 #16
0
 void JustSummoned(Creature* Summoned) override
 {
     Summons.Summon(Summoned);
 }
コード例 #17
0
 void JustSummoned(Creature* summoned)
 {
     Summons.Summon(summoned);
     // makes immediate corpse despawn of summoned Felflame Infernals
     summoned->SetCorpseDelay(0);
 }
コード例 #18
0
 void JustSummoned(Creature* summoned)
 {
     summons.Summon(summoned);
 }
コード例 #19
0
 void JustSummoned(Creature* summoned)
 {
     Summons.Summon(summoned);
     // makes immediate corpse despawn of summoned Mistress of Pain
     summoned->SetCorpseDelay(0);
 }
コード例 #20
0
 void JustSummoned(Creature* summoned)
 {
     summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
     lSummons.Summon(summoned);
 }
コード例 #21
0
 void JustSummoned(Creature* summon) override
 {
     summons.Summon(summon);
     summon->AI()->AttackStart(me->GetVictim());
 }
コード例 #22
0
 void JustSummoned(Creature *summon)
 {
     Summons.Summon(summon);
 }
コード例 #23
0
 void JustSummoned(Creature* summon)
 {
     summons.Summon(summon);
     if (Unit* target = SelectTargetFromPlayerList(100.0f))
         summon->AI()->AttackStart(target);
 }