void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override { if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER) { m_creature->SetFactionTemporary(FACTION_ESCORT_N_NEUTRAL_ACTIVE, TEMPFACTION_RESTORE_RESPAWN); Start(false, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue)); // ToDo: add additional WP when DB will support it if (m_creature->GetPositionZ() < 310.0f) { SetEscortPaused(true); //SetCurrentWaypoint(WP_ID_SPAWN_1); //SetEscortPaused(false); script_error_log("NPC entry %u, location %f, %f, %f does not have waypoints implemented for current spawn location. Please contact customer support!", m_creature->GetEntry(), m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); } else if (m_creature->GetPositionZ() < 330.0f) { SetEscortPaused(true); //SetCurrentWaypoint(WP_ID_SPAWN_2); //SetEscortPaused(false); script_error_log("NPC entry %u, location %f, %f, %f does not have waypoints implemented for current spawn location. Please contact customer support!", m_creature->GetEntry(), m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); } // else just use standard WP // open cage if (GameObject* pCage = GetClosestGameObjectWithEntry(m_creature, GO_PRISONER_CAGE, 10.0f)) pCage->Use(m_creature); } }
void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override { if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER) { Start(true, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue)); SetEscortPaused(true); // set alternative waypoints if required if (m_creature->GetPositionX() > 6650.0f) SetCurrentWaypoint(7); else if (m_creature->GetPositionX() > 6635.0f) SetCurrentWaypoint(35); DoScriptText(SAY_MINER_READY, m_creature); m_creature->SetStandState(UNIT_STAND_STATE_STAND); m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); m_creature->RemoveAurasDueToSpell(SPELL_FEIGN_DEATH); m_creature->SetFactionTemporary(FACTION_ESCORT_N_FRIEND_ACTIVE, TEMPFACTION_RESTORE_RESPAWN); } else if (eventType == AI_EVENT_CUSTOM_A && pInvoker->GetTypeId() == TYPEID_PLAYER) { SetEscortPaused(false); m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); } }
void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override { if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER) { if (m_creature->GetEntry() == NPC_MAGHAR_CAPTIVE) { m_creature->SetStandState(UNIT_STAND_STATE_STAND); m_creature->SetFactionTemporary(FACTION_ESCORT_H_NEUTRAL_ACTIVE, TEMPFACTION_RESTORE_RESPAWN); DoScriptText(SAY_MAG_START, m_creature); m_creature->SummonCreature(NPC_MURK_RAIDER, m_afAmbushA[0] + 2.5f, m_afAmbushA[1] - 2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_OOC_DESPAWN, 25000); m_creature->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushA[0] - 2.5f, m_afAmbushA[1] + 2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_OOC_DESPAWN, 25000); m_creature->SummonCreature(NPC_MURK_BRUTE, m_afAmbushA[0], m_afAmbushA[1], m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_OOC_DESPAWN, 25000); } else if (m_creature->GetEntry() == NPC_KURENAI_CAPTIVE) { m_creature->SetFactionTemporary(FACTION_ESCORT_A_NEUTRAL_ACTIVE, TEMPFACTION_RESTORE_RESPAWN); DoScriptText(SAY_KUR_START, m_creature); m_creature->SummonCreature(NPC_MURK_RAIDER, -1509.606f, 8484.284f, -3.841f, 0.0f, TEMPSUMMON_TIMED_OOC_DESPAWN, 25000); m_creature->SummonCreature(NPC_MURK_PUTRIFIER, -1532.475f, 8454.706f, -4.102f, 0.0f, TEMPSUMMON_TIMED_OOC_DESPAWN, 25000); m_creature->SummonCreature(NPC_MURK_BRUTE, -1525.484f, 8475.383f, -2.482f, 0.0f, TEMPSUMMON_TIMED_OOC_DESPAWN, 25000); } Start(false, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue)); } }
void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override { if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER) { m_creature->SetFactionTemporary(FACTION_ESCORT_A_NEUTRAL_PASSIVE, TEMPFACTION_RESTORE_RESPAWN); Start(false, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue)); } }
void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override { if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER) { DoScriptText(SAY_START, m_creature); Start(false, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue), true); } }
void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override { if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER) { m_creature->SetStandState(UNIT_STAND_STATE_STAND); Start(false, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue)); } }
void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override { if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER) { Start(false, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue)); SendAIEventAround(AI_EVENT_CUSTOM_A, pInvoker, 0, 12.0f); } }
void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override { if (eventType == AI_EVENT_START_EVENT && pInvoker->GetTypeId() == TYPEID_PLAYER) { // No idea why he has UNIT_STAND_STATE_DEAD in UDB .. m_creature->SetStandState(UNIT_STAND_STATE_STAND); StartFollow((Player*)pInvoker, 0, GetQuestTemplateStore(uiMiscValue)); } }
void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override { if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER) { Start(true, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue)); DoScriptText(SAY_HANES_ESCORT_START, m_creature); m_creature->SetFactionTemporary(FACTION_ESCORT_H_ACTIVE, TEMPFACTION_RESTORE_RESPAWN); } }
void ReceiveAIEvent(AIEventType eventType, Unit* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override { if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER) { DoScriptText(SAY_STINKY_BEGIN, m_creature); Start(false, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue)); m_creature->SetFactionTemporary(FACTION_ESCORT_N_NEUTRAL_PASSIVE, TEMPFACTION_RESTORE_RESPAWN); m_creature->SetStandState(UNIT_STAND_STATE_STAND); } }
void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override { if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER) { DoScriptText(SAY_CORPORAL_KEESHAN_1, m_creature); #if defined (WOTLK) || defined (CATA) m_creature->SetFactionTemporary(FACTION_ESCORT_A_NEUTRAL_ACTIVE, TEMPFACTION_RESTORE_RESPAWN); #endif Start(false, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue)); } }
void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override { if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER) { DoScriptText(SAY_HARRISON_ESCORT_START, m_creature); Start(false, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue)); if (GameObject* pCage = GetClosestGameObjectWithEntry(m_creature, GO_HARRISON_CAGE, 5.0f)) pCage->Use(m_creature); } }
void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override { if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER) { m_creature->SetStandState(UNIT_STAND_STATE_STAND); m_creature->SetFactionTemporary(FACTION_ESCORT_N_NEUTRAL_ACTIVE, TEMPFACTION_RESTORE_RESPAWN); Start(false, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue)); if (GameObject* pCage = GetClosestGameObjectWithEntry(m_creature, GO_ARKONARIN_CAGE, 5.0f)) pCage->Use(m_creature); } }
void ReceiveAIEvent(AIEventType eventType, Unit* pSender, Unit* pInvoker, uint32 uiMiscValue) override { // start quest if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER) { m_bFirstExplosives = true; DoScriptText(SAY_ESCORT_START, m_creature, pInvoker); m_creature->SetFactionTemporary(FACTION_ESCORT_A_NEUTRAL_ACTIVE, TEMPFACTION_RESTORE_RESPAWN); Start(true, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue)); } // start event epilog else if (eventType == AI_EVENT_CUSTOM_EVENTAI_A && pSender->GetEntry() == NPC_SIRONAS) StartNextDialogueText(POINT_ID_EXPLOSIVES_8); }
void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override { // start following if (eventType == AI_EVENT_START_EVENT && pInvoker->GetTypeId() == TYPEID_PLAYER) { StartFollow((Player*)pInvoker, 0, GetQuestTemplateStore(uiMiscValue)); m_uiWanderTimer = 30000; } else if (eventType == AI_EVENT_CUSTOM_A) { // resume following m_bIsRecalled = true; SetFollowPaused(false); } }
void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 uiMiscValue) override { if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER) { Start(false, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue)); DoScriptText(SAY_ESCORT_START, m_creature); m_creature->SetFactionTemporary(FACTION_ESCORT_N_FRIEND_PASSIVE, TEMPFACTION_RESTORE_RESPAWN); } else if (eventType == AI_EVENT_CUSTOM_A && pInvoker->GetTypeId() == TYPEID_PLAYER && uiMiscValue == QUEST_ID_SCARLET_SUBTERFUGE) StartNextDialogueText(NPC_SCARLET_CAVALIER); else if (eventType == AI_EVENT_CUSTOM_B && pInvoker->GetEntry() == NPC_ISILLIEN) { StartNextDialogueText(NPC_TIRION_FORDRING); m_creature->SummonCreature(NPC_TIRION_FORDRING, 2620.273f, -1920.917f, 74.25f, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 15 * MINUTE * IN_MILLISECONDS); } }
void ReceiveAIEvent(AIEventType eventType, Creature* pSender, Unit* pInvoker, uint32 uiMiscValue) override { if (eventType == AI_EVENT_START_ESCORT && pInvoker->GetTypeId() == TYPEID_PLAYER) { Start(false, (Player*)pInvoker, GetQuestTemplateStore(uiMiscValue)); if (Creature* pFloppy = GetClosestCreatureWithEntry(m_creature, NPC_MR_FLOPPY, 10.0f)) m_floppyGuid = pFloppy->GetObjectGuid(); } else if (eventType == AI_EVENT_JUST_DIED && pSender->GetEntry() == NPC_MR_FLOPPY) { npc_escortAI::JustDied(m_creature); m_creature->ForcedDespawn(); } else if (eventType == AI_EVENT_CRITICAL_HEALTH && pSender->GetEntry() == NPC_MR_FLOPPY) DoScriptText(SAY_FLOPPY_ALMOST_DEAD, m_creature); else if (eventType == AI_EVENT_LOST_SOME_HEALTH && pSender->GetEntry() == NPC_MR_FLOPPY) DoScriptText(urand(0, 1) ? SAY_HELP_FLOPPY_1 : SAY_HELP_FLOPPY_2, m_creature); }
void UpdateFollowerAI(const uint32 uiDiff) { if (!m_bFollowStarted) { if (Player* pSummoner = m_creature->GetCharmerOrOwnerPlayerOrPlayerItself()) { StartFollow(pSummoner, pSummoner->getFaction(), GetQuestTemplateStore(QUEST_ID_LOADER_UP)); if (DoCastSpellIfCan(m_creature, SPELL_CREATES_CARRIED) == CAST_OK) m_bFollowStarted = true; } } if (m_uiDropDelayTimer) { if (m_uiDropDelayTimer <= uiDiff) m_uiDropDelayTimer = 0; else m_uiDropDelayTimer -= uiDiff; } if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; }