diff options
author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-20 17:48:18 +0200 |
---|---|---|
committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-20 17:48:18 +0200 |
commit | 34cd8e808eb7ae2915a970213a37eb2c615fd7fe (patch) | |
tree | 4c1e374a7b70a92d2ec504241d143eae0fd95d1b /src | |
parent | 9727cc49ef05af37c19a10b59c3650fd4cf5cad1 (diff) | |
parent | d74b8f0a1a4c72506d5a287334b6e7ae663da8ac (diff) |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/game/Globals/ObjectMgr.cpp
Diffstat (limited to 'src')
13 files changed, 185 insertions, 277 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 4050797335d..a5c9a3f8391 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -523,12 +523,17 @@ void Creature::Update(uint32 diff) if (!IsAlive()) break; - // if creature is charmed, switch to charmed AI + // if creature is charmed, switch to charmed AI (and back) if (NeedChangeAI) { UpdateCharmAI(); NeedChangeAI = false; IsAIEnabled = true; + if (!IsInEvadeMode() && LastCharmerGUID) + if (Unit* charmer = ObjectAccessor::GetUnit(*this, LastCharmerGUID)) + i_AI->AttackStart(charmer); + + LastCharmerGUID = 0; } if (!IsInEvadeMode() && IsAIEnabled) diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index df0a4055beb..2ea72ccc7e6 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -1196,13 +1196,6 @@ void GameObject::Use(Unit* user) // calculate the distance between the player and this slot float thisDistance = player->GetDistance2d(x_i, y_i); - /* debug code. It will spawn a npc on each slot to visualize them. - Creature* helper = player->SummonCreature(14496, x_i, y_i, GetPositionZ(), GetOrientation(), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 10000); - std::ostringstream output; - output << i << ": thisDist: " << thisDistance; - helper->MonsterSay(output.str().c_str(), LANG_UNIVERSAL, 0); - */ - if (thisDistance <= lowestDist) { nearest_slot = itr->first; @@ -1223,8 +1216,6 @@ void GameObject::Use(Unit* user) return; } } - //else - //player->GetSession()->SendNotification("There's nowhere left for you to sit."); return; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 473cc3a8ed4..3c99026228f 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -162,7 +162,7 @@ ProcEventInfo::ProcEventInfo(Unit* actor, Unit* actionTarget, Unit* procTarget, #endif Unit::Unit(bool isWorldObject) : WorldObject(isWorldObject), m_movedPlayer(NULL), m_lastSanctuaryTime(0), - IsAIEnabled(false), NeedChangeAI(false), + IsAIEnabled(false), NeedChangeAI(false), LastCharmerGUID(0), m_ControlledByPlayer(false), movespline(new Movement::MoveSpline()), i_AI(NULL), i_disabledAI(NULL), m_AutoRepeatFirstCast(false), m_procDeep(0), m_removedAurasCount(0), i_motionMaster(this), m_ThreatManager(this), @@ -14096,16 +14096,13 @@ void Unit::RemoveCharmedBy(Unit* charmer) if (Creature* creature = ToCreature()) { + // Creature will restore its old AI on next update if (creature->AI()) creature->AI()->OnCharmed(false); - if (type != CHARM_TYPE_VEHICLE) // Vehicles' AI is never modified - { - creature->AIM_Initialize(); - - if (creature->AI() && charmer && charmer->IsAlive()) - creature->AI()->AttackStart(charmer); - } + // Vehicle should not attack its passenger after he exists the seat + if (type != CHARM_TYPE_VEHICLE) + LastCharmerGUID = charmer->GetGUID(); } else ToPlayer()->SetClientControl(this, 1); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index e5005e0ad02..6f8290bb409 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2084,6 +2084,7 @@ class Unit : public WorldObject friend class VehicleJoinEvent; bool IsAIEnabled, NeedChangeAI; + uint64 LastCharmerGUID; bool CreateVehicleKit(uint32 id, uint32 creatureEntry); void RemoveVehicleKit(); Vehicle* GetVehicleKit()const { return m_vehicleKit; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 038a3147ab6..86a6a906df5 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8211,10 +8211,8 @@ void ObjectMgr::LoadGossipMenuItems() _gossipMenuItemsStore.clear(); QueryResult result = WorldDatabase.Query( - // 0 1 2 3 4 5 - "SELECT menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, " - // 6 7 8 9 10 - "action_menu_id, action_poi_id, box_coded, box_money, box_text " + // 0 1 2 3 4 5 6 7 8 9 10 + "SELECT menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, action_menu_id, action_poi_id, box_coded, box_money, box_text " "FROM gossip_menu_option ORDER BY menu_id, id"); if (!result) diff --git a/src/server/game/Grids/ObjectGridLoader.cpp b/src/server/game/Grids/ObjectGridLoader.cpp index 50a54cd7263..9293f9e9b84 100644 --- a/src/server/game/Grids/ObjectGridLoader.cpp +++ b/src/server/game/Grids/ObjectGridLoader.cpp @@ -218,8 +218,7 @@ void ObjectGridStoper::Visit(CreatureMapType &m) { iter->GetSource()->CombatStop(); iter->GetSource()->DeleteThreatList(); - if (iter->GetSource()->IsAIEnabled) - iter->GetSource()->AI()->EnterEvadeMode(); + iter->GetSource()->AI()->EnterEvadeMode(); } } } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 6c120d079bb..3cdefb70617 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -505,93 +505,89 @@ public: ## npc_dark_rider_of_acherus ######*/ -enum Spells_DR +enum DarkRiderOfAcherus { + SAY_DARK_RIDER = 0, SPELL_DESPAWN_HORSE = 51918 }; -enum Says_DR -{ - SAY_DARK_RIDER = 0 -}; - class npc_dark_rider_of_acherus : public CreatureScript { -public: - npc_dark_rider_of_acherus() : CreatureScript("npc_dark_rider_of_acherus") { } - - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_dark_rider_of_acherusAI(creature); - } - - struct npc_dark_rider_of_acherusAI : public ScriptedAI - { - npc_dark_rider_of_acherusAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 PhaseTimer; - uint32 Phase; - bool Intro; - uint64 TargetGUID; + public: + npc_dark_rider_of_acherus() : CreatureScript("npc_dark_rider_of_acherus") { } - void Reset() OVERRIDE + struct npc_dark_rider_of_acherusAI : public ScriptedAI { - PhaseTimer = 4000; - Phase = 0; - Intro = false; - TargetGUID = 0; - } + npc_dark_rider_of_acherusAI(Creature* creature) : ScriptedAI(creature) { } - void UpdateAI(uint32 diff) OVERRIDE - { - if (!Intro || !TargetGUID) - return; + void Reset() OVERRIDE + { + PhaseTimer = 4000; + Phase = 0; + Intro = false; + TargetGUID = 0; + } - if (PhaseTimer <= diff) + void UpdateAI(uint32 diff) OVERRIDE { - switch (Phase) + if (!Intro || !TargetGUID) + return; + + if (PhaseTimer <= diff) { - case 0: - me->MonsterSay(SAY_DARK_RIDER, LANG_UNIVERSAL, 0); - PhaseTimer = 5000; - Phase = 1; - break; - case 1: - if (Unit* target = Unit::GetUnit(*me, TargetGUID)) - DoCast(target, SPELL_DESPAWN_HORSE, true); - PhaseTimer = 3000; - Phase = 2; - break; - case 2: - me->SetVisible(false); - PhaseTimer = 2000; - Phase = 3; - break; - case 3: - me->DespawnOrUnsummon(); - break; - default: - break; + switch (Phase) + { + case 0: + Talk(SAY_DARK_RIDER); + PhaseTimer = 5000; + Phase = 1; + break; + case 1: + if (Unit* target = ObjectAccessor::GetUnit(*me, TargetGUID)) + DoCast(target, SPELL_DESPAWN_HORSE, true); + PhaseTimer = 3000; + Phase = 2; + break; + case 2: + me->SetVisible(false); + PhaseTimer = 2000; + Phase = 3; + break; + case 3: + me->DespawnOrUnsummon(); + break; + default: + break; + } } - } else PhaseTimer -= diff; - - } + else + PhaseTimer -= diff; + } - void InitDespawnHorse(Unit* who) - { - if (!who) - return; + void InitDespawnHorse(Unit* who) + { + if (!who) + return; - TargetGUID = who->GetGUID(); - me->SetWalk(true); - me->SetSpeed(MOVE_RUN, 0.4f); - me->GetMotionMaster()->MoveChase(who); - me->SetTarget(TargetGUID); - Intro = true; - } + TargetGUID = who->GetGUID(); + me->SetWalk(true); + me->SetSpeed(MOVE_RUN, 0.4f); + me->GetMotionMaster()->MoveChase(who); + me->SetTarget(TargetGUID); + Intro = true; + } - }; + private: + uint32 PhaseTimer; + uint32 Phase; + bool Intro; + uint64 TargetGUID; + }; + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_dark_rider_of_acherusAI(creature); + } }; /*###### @@ -644,7 +640,6 @@ public: } void MoveInLineOfSight(Unit* who) OVERRIDE - { ScriptedAI::MoveInLineOfSight(who); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 4301d666c76..d90ed543376 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -428,13 +428,13 @@ class npc_snobold_vassal : public CreatureScript return; case EVENT_HEAD_CRACK: // commented out while SPELL_SNOBOLLED gets fixed - //if (Unit* target = Unit::GetPlayer(*me, m_uiTargetGUID)) + //if (Unit* target = ObjectAccessor::GetPlayer(*me, m_uiTargetGUID)) DoCastVictim(SPELL_HEAD_CRACK); _events.ScheduleEvent(EVENT_HEAD_CRACK, 30*IN_MILLISECONDS); return; case EVENT_BATTER: // commented out while SPELL_SNOBOLLED gets fixed - //if (Unit* target = Unit::GetPlayer(*me, m_uiTargetGUID)) + //if (Unit* target = ObjectAccessor::GetPlayer(*me, m_uiTargetGUID)) DoCastVictim(SPELL_BATTER); _events.ScheduleEvent(EVENT_BATTER, 10*IN_MILLISECONDS); return; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 999e7081d52..1b03022c9bd 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -196,6 +196,22 @@ class FrostBombExplosion : public BasicEvent uint64 _sindragosaGUID; }; +class FrostBeaconSelector +{ + public: + FrostBeaconSelector(Unit* source) : _source(source) { } + + bool operator()(Unit* target) const + { + return target->GetTypeId() == TYPEID_PLAYER && + target != _source->GetVictim() && + !target->HasAura(SPELL_ICE_TOMB_UNTARGETABLE); + } + + private: + Unit* _source; +}; + class boss_sindragosa : public CreatureScript { public: @@ -466,7 +482,7 @@ class boss_sindragosa : public CreatureScript me->GetMotionMaster()->MovePoint(POINT_AIR_PHASE_FAR, SindragosaAirPosFar); break; case EVENT_ICE_TOMB: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_ICE_TOMB_UNTARGETABLE)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, FrostBeaconSelector(me))) { Talk(EMOTE_WARN_FROZEN_ORB, target->GetGUID()); DoCast(target, SPELL_ICE_TOMB_DUMMY, true); diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index 0178a9056f2..86a65e98561 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -465,23 +465,18 @@ public: #####*/ #define SAY_OFFER "Care to try Grimbooze Thunderbrew's new jungle punch?" -#define SAY_HEMET_1 "Aye, I'll try it." -#define SAY_HEMET_2 "That's exactly what I needed!" -#define SAY_HEMET_3 "It's got my vote! That'll put hair on your chest like nothing else will." -#define SAY_HADRIUS_1 "I'm always up for something of Grimbooze's." -#define SAY_HADRIUS_2 "Well, so far, it tastes like something my wife would drink..." -#define SAY_HADRIUS_3 "Now, there's the kick I've come to expect from Grimbooze's drinks! I like it!" -#define SAY_TAMARA_1 "Sure!" -#define SAY_TAMARA_2 "Oh my..." -#define SAY_TAMARA_3 "Tastes like I'm drinking... engine degreaser!" - -enum utils + +enum JunglePunch { - NPC_HEMET = 27986, - NPC_HADRIUS = 28047, - NPC_TAMARA = 28568, SPELL_OFFER = 51962, - QUEST_ENTRY = 12645, + QUEST_TASTE_TEST = 12645, + + SAY_HEMET_HADRIUS_TAMARA_1 = 0, + SAY_HEMET_HADRIUS_TAMARA_2 = 1, + SAY_HEMET_HADRIUS_TAMARA_3 = 2, + + SAY_HEMET_4 = 3, // unused + SAY_HEMET_5 = 4 // unused }; enum NesingwaryChildrensWeek @@ -492,12 +487,12 @@ enum NesingwaryChildrensWeek ORPHAN_WOLVAR = 33532, + TEXT_NESINGWARY_1 = 5, + TEXT_WOLVAR_ORPHAN_6 = 6, TEXT_WOLVAR_ORPHAN_7 = 7, TEXT_WOLVAR_ORPHAN_8 = 8, - TEXT_WOLVAR_ORPHAN_9 = 9, - - TEXT_NESINGWARY_1 = 1, + TEXT_WOLVAR_ORPHAN_9 = 9 }; class npc_jungle_punch_target : public CreatureScript @@ -520,7 +515,6 @@ public: } void MoveInLineOfSight(Unit* who) OVERRIDE - { if (!phase && who && who->GetDistance2d(me) < 10.0f) if (Player* player = who->ToPlayer()) @@ -585,99 +579,55 @@ public: timer -= diff; } - void UpdateAI(uint32 uiDiff) OVERRIDE + void UpdateAI(uint32 diff) OVERRIDE { if (phase) - proceedCwEvent(uiDiff); + proceedCwEvent(diff); if (!sayStep) return; - if (sayTimer < uiDiff) + if (sayTimer < diff) { - switch (sayStep) - { - case 0: - { - switch (me->GetEntry()) - { - case NPC_HEMET: me->MonsterSay(SAY_HEMET_1, LANG_UNIVERSAL, 0); break; - case NPC_HADRIUS: me->MonsterSay(SAY_HADRIUS_1, LANG_UNIVERSAL, 0); break; - case NPC_TAMARA: me->MonsterSay(SAY_TAMARA_1, LANG_UNIVERSAL, 0); break; - } - sayTimer = 3000; - sayStep++; - break; - } - case 1: - { - switch (me->GetEntry()) - { - case NPC_HEMET: me->MonsterSay(SAY_HEMET_2, LANG_UNIVERSAL, 0); break; - case NPC_HADRIUS: me->MonsterSay(SAY_HADRIUS_2, LANG_UNIVERSAL, 0); break; - case NPC_TAMARA: me->MonsterSay(SAY_TAMARA_2, LANG_UNIVERSAL, 0); break; - } - sayTimer = 3000; - sayStep++; - break; - } - case 2: - { - switch (me->GetEntry()) - { - case NPC_HEMET: me->MonsterSay(SAY_HEMET_3, LANG_UNIVERSAL, 0); break; - case NPC_HADRIUS: me->MonsterSay(SAY_HADRIUS_3, LANG_UNIVERSAL, 0); break; - case NPC_TAMARA: me->MonsterSay(SAY_TAMARA_3, LANG_UNIVERSAL, 0); break; - } - sayTimer = 3000; - sayStep = 0; - break; - } - } + Talk(SAY_HEMET_HADRIUS_TAMARA_1 + sayStep - 1); + sayTimer = 3000; + sayStep++; + + if (sayStep > 3) // end + sayStep = 0; } else - sayTimer -= uiDiff; + sayTimer -= diff; } - void SpellHit(Unit* caster, const SpellInfo* proto) OVERRIDE + void SpellHit(Unit* caster, SpellInfo const* spellInfo) OVERRIDE { - if (!proto || proto->Id != SPELL_OFFER) + if (spellInfo->Id != SPELL_OFFER) return; - if (!caster->ToPlayer()) + Player* player = caster->ToPlayer(); + if (!player) + return; + + Quest const* quest = sObjectMgr->GetQuestTemplate(QUEST_TASTE_TEST); + if (!quest) return; - QuestStatusMap::const_iterator itr = caster->ToPlayer()->getQuestStatusMap().find(QUEST_ENTRY); + QuestStatusMap::const_iterator itr = player->getQuestStatusMap().find(QUEST_TASTE_TEST); if (itr->second.Status != QUEST_STATUS_INCOMPLETE) return; - for (uint8 i=0; i<3; i++) + for (uint8 i = 0; i < 3; ++i) { - switch (i) - { - case 0: - if (NPC_HEMET != me->GetEntry()) - continue; - else - break; - case 1: - if (NPC_HADRIUS != me->GetEntry()) - continue; - else - break; - case 2: - if (NPC_TAMARA != me->GetEntry()) - continue; - else - break; - } + if (quest->RequiredNpcOrGo[i] != me->GetEntry()) + continue; if (itr->second.CreatureOrGOCount[i] != 0) continue; - caster->ToPlayer()->KilledMonsterCredit(me->GetEntry(), 0); - caster->ToPlayer()->Say(SAY_OFFER, LANG_UNIVERSAL); - sayStep = 0; + player->KilledMonsterCredit(me->GetEntry(), 0); + player->Say(SAY_OFFER, LANG_UNIVERSAL); + sayStep = 1; break; } } diff --git a/src/server/scripts/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp index 0b9c319bf56..a27ce0324ff 100644 --- a/src/server/scripts/Northrend/zone_wintergrasp.cpp +++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp @@ -334,13 +334,19 @@ class npc_wg_quest_giver : public CreatureScript bool OnGossipHello(Player* player, Creature* creature) OVERRIDE { - if (creature->IsQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG); if (!wintergrasp) return true; + if (creature->IsVendor()) + { + player->ADD_GOSSIP_ITEM_DB(Player::GetDefaultGossipMenuForSource(creature), 0, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_VENDOR); + player->PlayerTalkClass->GetGossipMenu().AddGossipMenuItemData(0, 0, 0); + } + + /// @todo: move this to conditions or something else + + // Player::PrepareQuestMenu(guid) if (creature->IsQuestGiver()) { QuestRelationBounds objectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry()); @@ -368,6 +374,9 @@ class npc_wg_quest_giver : public CreatureScript if (!quest) continue; + if (!player->CanTakeQuest(quest, false)) + continue; + switch (questId) { // Horde attacker @@ -377,15 +386,8 @@ class npc_wg_quest_giver : public CreatureScript case QUEST_FUELING_THE_DEMOLISHERS_HORDE_ATT: case QUEST_HEALING_WITH_ROSES_HORDE_ATT: case QUEST_DEFEND_THE_SIEGE_HORDE_ATT: - if (wintergrasp->GetAttackerTeam() == TEAM_HORDE) - { - QuestStatus status = player->GetQuestStatus(questId); - - if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false)) - qm.AddMenuItem(questId, 4); - else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false)) - qm.AddMenuItem(questId, 2); - } + if (wintergrasp->GetAttackerTeam() != TEAM_HORDE) + continue; break; // Horde defender case QUEST_BONES_AND_ARROWS_HORDE_DEF: @@ -395,15 +397,8 @@ class npc_wg_quest_giver : public CreatureScript case QUEST_HEALING_WITH_ROSES_HORDE_DEF: case QUEST_TOPPLING_THE_TOWERS_HORDE_DEF: case QUEST_STOP_THE_SIEGE_HORDE_DEF: - if (wintergrasp->GetDefenderTeam() == TEAM_HORDE) - { - QuestStatus status = player->GetQuestStatus(questId); - - if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false)) - qm.AddMenuItem(questId, 4); - else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false)) - qm.AddMenuItem(questId, 2); - } + if (wintergrasp->GetDefenderTeam() != TEAM_HORDE) + continue; break; // Alliance attacker case QUEST_BONES_AND_ARROWS_ALLIANCE_ATT: @@ -411,15 +406,8 @@ class npc_wg_quest_giver : public CreatureScript case QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_ATT: case QUEST_DEFEND_THE_SIEGE_ALLIANCE_ATT: case QUEST_A_RARE_HERB_ALLIANCE_ATT: - if (wintergrasp->GetAttackerTeam() == TEAM_ALLIANCE) - { - QuestStatus status = player->GetQuestStatus(questId); - - if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false)) - qm.AddMenuItem(questId, 4); - else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false)) - qm.AddMenuItem(questId, 2); - } + if (wintergrasp->GetAttackerTeam() != TEAM_ALLIANCE) + continue; break; // Alliance defender case QUEST_BONES_AND_ARROWS_ALLIANCE_DEF: @@ -428,27 +416,20 @@ class npc_wg_quest_giver : public CreatureScript case QUEST_SHOUTHERN_SABOTAGE_ALLIANCE_DEF: case QUEST_STOP_THE_SIEGE_ALLIANCE_DEF: case QUEST_A_RARE_HERB_ALLIANCE_DEF: - if (wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE) - { - QuestStatus status = player->GetQuestStatus(questId); - - if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false)) - qm.AddMenuItem(questId, 4); - else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false)) - qm.AddMenuItem(questId, 2); - } + if (wintergrasp->GetDefenderTeam() != TEAM_ALLIANCE) + continue; break; default: - QuestStatus status = player->GetQuestStatus(questId); - - if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false)) - qm.AddMenuItem(questId, 4); - else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false)) - qm.AddMenuItem(questId, 2); break; } + + if (quest->IsAutoComplete()) + qm.AddMenuItem(questId, 4); + else if (player->GetQuestStatus(questId) == QUEST_STATUS_NONE) + qm.AddMenuItem(questId, 2); } } + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp index c115c07c5b8..63ba44f19e8 100644 --- a/src/server/scripts/Northrend/zone_zuldrak.cpp +++ b/src/server/scripts/Northrend/zone_zuldrak.cpp @@ -198,6 +198,9 @@ enum Gurgthock EMOTE_YGGDRAS_SPAWN = 4, SAY_STINKBEARD_SPAWN = 5, SAY_GURGTHOCK_ELEMENTAL_SPAWN = 6, + SAY_GURGTHOCK_7 = 7, + SAY_QUEST_AMPHITHEATER_ANGUISH_YGGDRAS = 8, + SAY_GURGTHOCK_9 = 9, SAY_CALL_FOR_HELP = 0, SAY_RECRUIT = 0, @@ -319,9 +322,9 @@ public: uiTimer = 2000; uiPhase = 12; break; - } - break; - } + } + break; + } } void UpdateAI(uint32 diff) OVERRIDE @@ -341,8 +344,6 @@ public: if (uiPhase) { - Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID); - if (uiTimer <= diff) { switch (uiPhase) @@ -371,27 +372,14 @@ public: uiPhase = 0; break; case 6: - { - if (!player) - return; - - std::string sText = ("The grand Amphitheater of Anguish awaits, " + std::string(player->GetName()) + ". Remember, once a battle starts you have to stay in the area. WIN OR DIE!"); - - me->MonsterSay(sText.c_str(), LANG_UNIVERSAL, 0); - uiTimer = 5000; - uiPhase = 9; - } + Talk(SAY_GURGTHOCK_7, _playerGUID); + uiTimer = 5000; + uiPhase = 9; break; case 7: - { - if (!player) - return; - - std::string sText = ("Prepare to make you stand, " + std::string(player->GetName()) + "! Get in the Amphitheater and stand ready! Remember, you and your opponent must stay in the arena at all times or you will be disqualified!"); - me->MonsterSay(sText.c_str(), LANG_UNIVERSAL, 0); - uiTimer = 3000; - uiPhase = 8; - } + Talk(SAY_GURGTHOCK_9, _playerGUID); + uiTimer = 3000; + uiPhase = 8; break; case 8: Talk(SAY_QUEST_ACCEPT_MAGNATAUR); @@ -399,15 +387,9 @@ public: uiPhase = 11; break; case 9: - { - if (!player) - return; - - std::string sText = ("Here we are once again, ladies and gentlemen. The epic struggle between life and death in the Amphitheater of Anguish! For this round we have " + std::string(player->GetName()) + " versus the hulking jormungar, Yg... Yggd? Yggdoze? Who comes up with these names?! " + std::string(player->GetName()) + " versus big worm!"); - me->MonsterYell(sText.c_str(), LANG_UNIVERSAL, 0); - uiTimer = 10000; - uiPhase = 10; - } + Talk(SAY_QUEST_AMPHITHEATER_ANGUISH_YGGDRAS, _playerGUID); + uiTimer = 10000; + uiPhase = 10; break; case 10: me->SummonCreature(NPC_YGGDRAS, SpawnPosition[1], TEMPSUMMON_CORPSE_DESPAWN, 1000); @@ -420,16 +402,10 @@ public: uiPhase = 0; break; case 12: - { - if (!player) - return; - - std::string sText = ("Prepare to make you stand, " + std::string(player->GetName()) + "! Get in the Amphitheater and stand ready! Remember, you and your opponent must stay in the arena at all times or you will be disqualified!"); - me->MonsterSay(sText.c_str(), LANG_UNIVERSAL, 0); + Talk(SAY_GURGTHOCK_9, _playerGUID); uiTimer = 5000; uiPhase = 13; - } - break; + break; case 13: Talk(SAY_GURGTHOCK_ELEMENTAL_SPAWN); uiTimer = 3000; @@ -443,7 +419,8 @@ public: break; } } - else uiTimer -= diff; + else + uiTimer -= diff; } } diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index 22ea1b70c21..c7de0dea961 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -422,7 +422,6 @@ public: { damage = 0; me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->Yell(SUFF_SAY_RECAP, LANG_UNIVERSAL, 0); Talk(SUFF_SAY_RECAP); me->SetReactState(REACT_PASSIVE); } @@ -431,14 +430,13 @@ public: void EnterCombat(Unit* /*who*/) OVERRIDE { if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) - { + { Talk(SUFF_SAY_FREED); DoZoneInCombat(); DoCast(me, AURA_OF_SUFFERING, true); // linked aura need core support DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE, true); DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE2, true); - } - else return; + } } void KilledUnit(Unit* /*victim*/) OVERRIDE |