void JustDied(Unit* /*killer*/) { if (CAST_SUM(me)) if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner())) if (pSummoner->AI()) pSummoner->AI()->DoAction(ACTION_FLESH_TENTACLE_KILLED); }
void UpdateAI(const uint32 diff) { events.Update(diff); if (events.ExecuteEvent() == EVENT_CHECK_SUMMON_AURA) { std::list<Creature*> tigers; GetCreatureListWithEntryInGrid(tigers, me, NPC_TIGER_VEHICLE, 15.0f); if (!tigers.empty()) { for (std::list<Creature*>::iterator itr = tigers.begin(); itr != tigers.end(); ++itr) { if (Unit* summoner = CAST_SUM(*itr)->GetSummoner()) if (!summoner->HasAura(SPELL_NO_SUMMON_AURA) && !summoner->HasAura(SPELL_SUMMON_ZENTABRA_TRIGGER) && !summoner->isInCombat()) { me->AddAura(SPELL_NO_SUMMON_AURA, summoner); me->AddAura(SPELL_DETECT_INVIS, summoner); summoner->CastSpell(summoner, SPELL_SUMMON_MATRIARCH, true); Talk(SAY_MATRIARCH_AGGRO, summoner->GetGUID()); } } } events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 5000); } }
void SetDataSummoner() { if (!me->isSummon()) return; if (Unit* pSummon = CAST_SUM(me)->GetSummoner()) CAST_CRE(pSummon)->AI()->SetData(2, 1); }
void JustDied(Unit* /*pKiller*/) { if (!me->isSummon()) return; if (Unit* pSummon = CAST_SUM(me)->GetSummoner()) CAST_CRE(pSummon)->AI()->SetData(2, 2); }
void EnterEvadeMode() { if (m_creature->isSummon()) if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner())) if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI())) pAI->RemoveSummons(); }
void EnterEvadeMode() //If you lose the combat, then the npc go away { if (m_creature->isSummon()) if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner())) if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI())) pAI->RemoveSummons(); }
void UpdateAI(const uint32 diff) { if (!UpdateVictim()) return; if (!_tiger) return; events.Update(diff); while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { case EVENT_POUNCE: DoCastVictim(SPELL_POUNCE); events.ScheduleEvent(EVENT_POUNCE, 30000); break; case EVENT_NOSUMMON: // Reapply SPELL_NO_SUMMON_AURA if (Unit* vehSummoner = CAST_SUM(_tiger)->GetSummoner()) me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner); events.ScheduleEvent(EVENT_NOSUMMON, 50000); break; default: break; } } DoMeleeAttackIfReady(); }
void MoveToSummoner() { if (me->isSummon()) if (Unit* pSummoner = CAST_SUM(me)->GetSummoner()) if (pSummoner) me->GetMotionMaster()->MovePoint(0,pSummoner->GetPositionX(),pSummoner->GetPositionY(),pSummoner->GetPositionZ()); }
void JustDied(Unit * /*killer*/) { if (me->isSummon()) { if (Unit *owner = CAST_SUM(me)->GetSummoner()) CombatAI::JustDied(owner); } }
void UpdateAI(const uint32 /*diff*/) { if (Unit* pSummoner = CAST_SUM(me)->GetSummoner()) WrapTargetGUID = pSummoner->GetGUID(); Unit* temp = Unit::GetUnit((*me), WrapTargetGUID); if ((temp && temp->isAlive() && !temp->HasAura(SPELL_SNAKE_WRAP_STUN)) || !temp) me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); }
void JustDied(Unit* pKiller) { if (m_creature->isSummon()) if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner())) if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI())) pAI->bEventInProgress = false; if (pKiller->GetTypeId() == TYPEID_PLAYER) CAST_PLR(pKiller)->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_MAGNATAUR, CAST_PLR(pKiller)); }
void EnterEvadeMode() { if (uiWhisker) if (Creature *pWhisker = m_creature->GetCreature(*m_creature, uiWhisker)) pWhisker->RemoveFromWorld(); if (m_creature->isSummon()) if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner())) if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI())) pAI->RemoveSummons(); }
void JustDied(Unit* pKiller) { if (me->isSummon()) { if (Unit* pSummoner = CAST_SUM(me)->GetSummoner()) { if (pSummoner && pSummoner->isAlive()) CAST_CRE(pSummoner)->AI()->SetData(1, 0); } } }
void InitScriptData() { Player* pPlayer = NULL; if (me->isSummon()) if (Unit* summoner = CAST_SUM(me)->GetSummoner()) if (summoner->GetTypeId() == TYPEID_PLAYER) pPlayer = CAST_PLR(summoner); if (!pPlayer) return; me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING); Start(false, false, pPlayer->GetGUID()); }
void EnterEvadeMode() { me->DisappearAndDie(); if (me->isSummon()) { if (Unit* pSummoner = CAST_SUM(me)->GetSummoner()) { if (pSummoner && pSummoner->isAlive()) CAST_CRE(pSummoner)->DisappearAndDie(); } } }
void EnterCombat(Unit* pWho) { DoScriptText(SAY_MARZON_2, me); if (me->isSummon()) { if (Unit* pSummoner = CAST_SUM(me)->GetSummoner()) { if (pSummoner && pSummoner->isAlive() && !pSummoner->isInCombat()) CAST_CRE(pSummoner)->AI()->AttackStart(pWho); } } }
void UpdateAI(const uint32 diff) { if (FlyBackTimer <= diff) { Player *plr = NULL; if (me->isSummon()) if (Unit *summoner = CAST_SUM(me)->GetSummoner()) if (summoner->GetTypeId() == TYPEID_PLAYER) plr = CAST_PLR(summoner); if (!plr) phase = 3; switch(phase) { case 0: me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED); FlyBackTimer = 500; break; case 1: plr->GetClosePoint(x, y, z, me->GetObjectSize()); z += 2.5; x -= 2; y -= 1.5; me->GetMotionMaster()->MovePoint(0, x, y, z); me->SetUInt64Value(UNIT_FIELD_TARGET, plr->GetGUID()); me->SetVisible(true); FlyBackTimer = 4500; break; case 2: if (!plr->isRessurectRequested()) { me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01); DoCast(plr, SPELL_REVIVE, true); me->MonsterWhisper(VALK_WHISPER, plr->GetGUID()); } FlyBackTimer = 5000; break; case 3: me->SetVisible(false); FlyBackTimer = 3000; break; case 4: me->DisappearAndDie(); break; default: //Nothing To DO break; } ++phase; } else FlyBackTimer-=diff; }
void KilledUnit(Unit* victim) { if (victim->GetTypeId() != TYPEID_UNIT) return; if (Unit* vehSummoner = CAST_SUM(victim)->GetSummoner()) { vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA); vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS); vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER); vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); } me->ForcedDespawn(); }
void JustDied(Unit* pKiller) { if (uiWhisker) if (Creature *pWhisker = m_creature->GetCreature(*m_creature, uiWhisker)) pWhisker->RemoveFromWorld(); if (pKiller->GetTypeId() == TYPEID_PLAYER) CAST_PLR(pKiller)->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_TUSKARRMAGEDDON, CAST_PLR(pKiller)); if (m_creature->isSummon()) if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner())) if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI())) pAI->bEventInProgress = false; }
void MovementInform(uint32 uiType, uint32 /*uiId*/) { if (uiType != POINT_MOTION_TYPE) return; if (me->isSummon()) { if (Unit* pSummoner = CAST_SUM(me)->GetSummoner()) { CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, CAST_CRE(pSummoner)->AI())->uiTimer = 2000; CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, CAST_CRE(pSummoner)->AI())->uiPhase = 5; //me->ChangeOrient(0.0f, pSummoner); } } }
void JustDied(Unit* pKiller) { if (pKiller->GetTypeId() == TYPEID_PLAYER) { CAST_PLR(pKiller)->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_YGGDRAS_1, CAST_PLR(pKiller)); CAST_PLR(pKiller)->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_YGGDRAS_2, CAST_PLR(pKiller)); } for (uint8 i = 0; i < 2; ++i) DoCast(pKiller, SPELL_JORMUNGAR_SPAWN, true); if (m_creature->isSummon()) if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner())) if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI())) pAI->bEventInProgress = false; }
void WaypointReached(uint32 i) { Player* pPlayer = NULL; if (me->isSummon()) if (Unit* summoner = CAST_SUM(me)->GetSummoner()) if (summoner->GetTypeId() == TYPEID_PLAYER) pPlayer = CAST_PLR(summoner); if (!pPlayer) return; switch (i) { case 26: me->ForcedDespawn(); break; } }
void MovementInform(uint32 uiType, uint32 /*uiId*/) { if (uiType != POINT_MOTION_TYPE) return; if (me->isSummon()) { if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner())) { if (npc_lord_gregor_lescovarAI* pAI = CAST_AI(npc_lord_gregor_lescovarAI,pSummoner->AI())) { pAI->uiTimer = 2000; pAI->uiPhase = 5; } //me->ChangeOrient(0.0f, pSummoner); } } }
void DamageTaken(Unit* attacker, uint32& damage) { if (HealthBelowPct(20)) { damage = 0; me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); if (Unit* vehSummoner = CAST_SUM(attacker)->GetSummoner()) { vehSummoner->AddAura(SPELL_SUMMON_ZENTABRA_TRIGGER, vehSummoner); vehSummoner->CastSpell(vehSummoner, SPELL_SUMMON_ZENTABRA, true); attacker->CastSpell(attacker, SPELL_EJECT_PASSENGERS, true); vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA); vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS); vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER); vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); } me->ForcedDespawn(); } }
void SummonList::DespawnAll() { while(!empty()) { Creature *summon = Unit::GetCreature(*m_creature, *begin()); if (!summon) erase(begin()); else { erase(begin()); if (summon->isSummon()) { summon->DestroyForNearbyPlayers(); CAST_SUM(summon)->UnSummon(); } else summon->DisappearAndDie(); } } }