diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2017-06-06 15:36:01 -0300 |
|---|---|---|
| committer | ariel- <ariel-@users.noreply.github.com> | 2017-06-06 17:57:04 -0300 |
| commit | 2335b9de1a46a409c714a1dc89cbd0565545e70e (patch) | |
| tree | d711b7cf6206e5dde3432dd4d0accae5b8243135 /src/server/scripts/World | |
| parent | 47d54bf5e20617d04055e1102e7688fb93e9f985 (diff) | |
Core/AI: segregate GameObject ReportUse from normal Use (lock open/normal click)
Closes #19819
Diffstat (limited to 'src/server/scripts/World')
| -rw-r--r-- | src/server/scripts/World/go_scripts.cpp | 70 |
1 files changed, 33 insertions, 37 deletions
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 0e0641932f2..c6a61a1d508 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -73,7 +73,7 @@ public: { go_cat_figurineAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { player->CastSpell(player, SPELL_SUMMON_GHOST_SABER, true); return false; @@ -99,7 +99,7 @@ public: { go_barov_journalAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 280 && !player->HasSpell(26086)) player->CastSpell(player, 26095, false); @@ -133,7 +133,7 @@ public: { go_gilded_brazierAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (me->GetGoType() == GAMEOBJECT_TYPE_GOOBER) { @@ -166,7 +166,7 @@ public: { go_orb_of_commandAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (player->GetQuestRewardStatus(7761)) player->CastSpell(player, 23460, true); @@ -194,7 +194,7 @@ public: { go_tablet_of_madnessAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (player->HasSkill(SKILL_ALCHEMY) && player->GetSkillValue(SKILL_ALCHEMY) >= 300 && !player->HasSpell(24266)) player->CastSpell(player, 24267, false); @@ -223,7 +223,7 @@ public: go_tablet_of_the_sevenAI(GameObject* go) : GameObjectAI(go) { } /// @todo use gossip option ("Transcript the Tablet") instead, if Trinity adds support. - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (me->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER) return true; @@ -254,7 +254,7 @@ public: { go_jump_a_tronAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (player->GetQuestStatus(10111) == QUEST_STATUS_INCOMPLETE) player->CastSpell(player, 33382, true); @@ -298,7 +298,7 @@ public: { go_ethereum_prisonAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { me->UseDoorOrButton(); int Random = rand32() % (sizeof(NpcPrisonEntry) / sizeof(uint32)); @@ -358,7 +358,7 @@ public: { go_ethereum_stasisAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { me->UseDoorOrButton(); int Random = rand32() % (sizeof(NpcStasisEntry) / sizeof(uint32)); @@ -394,7 +394,7 @@ public: { go_resonite_caskAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* /*player*/, bool /*reportUse*/) override + bool GossipHello(Player* /*player*/) override { if (me->GetGoType() == GAMEOBJECT_TYPE_GOOBER) me->SummonCreature(NPC_GOGGEROC, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000); @@ -427,7 +427,7 @@ public: { go_sacred_fire_of_lifeAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (me->GetGoType() == GAMEOBJECT_TYPE_GOOBER) player->SummonCreature(NPC_ARIKARA, -5008.338f, -2118.894f, 83.657f, 0.874f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); @@ -465,7 +465,7 @@ public: { go_shrine_of_the_birdsAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { uint32 BirdEntry = 0; @@ -518,7 +518,7 @@ public: { go_southfury_moonstoneAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { //implicitTarget=48 not implemented as of writing this code, and manual summon may be just ok for our purpose //player->CastSpell(player, SPELL_SUMMON_RIZZLE, false); @@ -557,7 +557,7 @@ public: { go_tele_to_dalaran_crystalAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (player->GetQuestRewardStatus(QUEST_TELE_CRYSTAL_FLAG)) return false; @@ -586,7 +586,7 @@ public: { go_tele_to_violet_standAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (player->GetQuestRewardStatus(QUEST_LEARN_LEAVE_RETURN) || player->GetQuestStatus(QUEST_LEARN_LEAVE_RETURN) == QUEST_STATUS_INCOMPLETE) return false; @@ -626,7 +626,7 @@ public: { go_fel_crystalforgeAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (me->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) /* != GAMEOBJECT_TYPE_QUESTGIVER) */ player->PrepareQuestMenu(me->GetGUID()); /* return true*/ @@ -696,7 +696,7 @@ public: { go_bashir_crystalforgeAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (me->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) /* != GAMEOBJECT_TYPE_QUESTGIVER) */ player->PrepareQuestMenu(me->GetGUID()); /* return true*/ @@ -771,7 +771,7 @@ public: { go_matrix_punchographAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { switch (me->GetEntry()) { @@ -834,7 +834,7 @@ public: { go_scourge_cageAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { me->UseDoorOrButton(); if (Creature* pNearestPrisoner = me->FindNearestCreature(NPC_SCOURGE_PRISONER, 5.0f, true)) @@ -872,7 +872,7 @@ public: { go_arcane_prisonAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (player->GetQuestStatus(QUEST_PRISON_BREAK) == QUEST_STATUS_INCOMPLETE) { @@ -909,7 +909,7 @@ public: { go_blood_filled_orbAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (me->GetGoType() == GAMEOBJECT_TYPE_GOOBER) player->SummonCreature(NPC_ZELEMAR, -369.746f, 166.759f, -21.50f, 5.235f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); @@ -950,7 +950,7 @@ public: { go_jotunheim_cageAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { me->UseDoorOrButton(); Creature* pPrisoner = me->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true); @@ -1010,7 +1010,7 @@ public: { go_table_thekaAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (player->GetQuestStatus(QUEST_SPIDER_GOLD) == QUEST_STATUS_INCOMPLETE) player->AreaExploredOrEventHappens(QUEST_SPIDER_GOLD); @@ -1045,7 +1045,7 @@ public: { go_inconspicuous_landmarkAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (player->HasItemCount(ITEM_CUERGOS_KEY)) return false; @@ -1126,11 +1126,7 @@ class go_soulwell : public GameObjectScript _stoneId = spellInfo->Effects[EFFECT_0].ItemType; } - /// Due to the fact that this GameObject triggers CMSG_GAMEOBJECT_USE - /// _and_ CMSG_GAMEOBJECT_REPORT_USE, this GossipHello hook is called - /// twice. The script's handling is fine as it won't remove two charges - /// on the well. We have to find how to segregate REPORT_USE and USE. - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { Unit* owner = me->GetOwner(); if (_stoneSpell == 0 || _stoneId == 0) @@ -1189,7 +1185,7 @@ public: { go_dragonflayer_cageAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { me->UseDoorOrButton(); if (player->GetQuestStatus(QUEST_PRISONERS_OF_WYRMSKULL) != QUEST_STATUS_INCOMPLETE) @@ -1247,7 +1243,7 @@ public: { go_tadpole_cageAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { me->UseDoorOrButton(); if (player->GetQuestStatus(QUEST_OH_NOES_THE_TADPOLES) == QUEST_STATUS_INCOMPLETE) @@ -1298,7 +1294,7 @@ public: { go_amberpine_outhouseAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { QuestStatus status = player->GetQuestStatus(QUEST_DOING_YOUR_DUTY); if (status == QUEST_STATUS_INCOMPLETE || status == QUEST_STATUS_COMPLETE || status == QUEST_STATUS_REWARDED) @@ -1365,7 +1361,7 @@ public: { go_hive_podAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { player->SendLoot(me->GetGUID(), LOOT_CORPSE); me->SummonCreature(NPC_HIVE_AMBUSHER, me->GetPositionX() + 1, me->GetPositionY(), me->GetPositionZ(), me->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); @@ -1389,7 +1385,7 @@ class go_massive_seaforium_charge : public GameObjectScript { go_massive_seaforium_chargeAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* /*player*/, bool /*reportUse*/) override + bool GossipHello(Player* /*player*/) override { me->SetLootState(GO_JUST_DEACTIVATED); return true; @@ -1422,7 +1418,7 @@ class go_veil_skith_cage : public GameObjectScript { go_veil_skith_cageAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { me->UseDoorOrButton(); if (player->GetQuestStatus(QUEST_MISSING_FRIENDS) == QUEST_STATUS_INCOMPLETE) @@ -1469,7 +1465,7 @@ public: { go_frostblade_shrineAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { me->UseDoorOrButton(10); if (!player->HasAura(SPELL_RECENT_MEDITATION)) @@ -1539,7 +1535,7 @@ public: { go_midsummer_ribbon_poleAI(GameObject* go) : GameObjectAI(go) { } - bool GossipHello(Player* player, bool /*reportUse*/) override + bool GossipHello(Player* player) override { if (Creature* creature = me->FindNearestCreature(NPC_POLE_RIBBON_BUNNY, 10.0f)) { |
