From 8f187edc2a4df535fc7ac584a078fdbc16deeb02 Mon Sep 17 00:00:00 2001 From: Gargarensis Date: Fri, 5 Aug 2016 13:11:01 +0200 Subject: [PATCH 1/4] hotfix rele price --- .../sql/db-world/azth_world_relentless_price_reduction.sql | 6 +++++- .../data/sql/updates/world/hotfix_rele_price_frost.sql | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 modules/azerothshard/data/sql/updates/world/hotfix_rele_price_frost.sql diff --git a/modules/azerothshard/data/sql/db-world/azth_world_relentless_price_reduction.sql b/modules/azerothshard/data/sql/db-world/azth_world_relentless_price_reduction.sql index 01e765e70e..cb8d54bb9e 100644 --- a/modules/azerothshard/data/sql/db-world/azth_world_relentless_price_reduction.sql +++ b/modules/azerothshard/data/sql/db-world/azth_world_relentless_price_reduction.sql @@ -1,4 +1,8 @@ UPDATE npc_vendor SET extendedcost = 2440 WHERE item IN (41088,41158,41206,41679,41668,41662,40791,40830,40851,41994,41999,42006,41322,41299,41311,41673,41656,41651,41082,41152,41200,40995,41020,41034,41855,41865,41860,40910,40934,40940,40790,40829,40850,40994,41014,41028,41916,41928,41922,40792,40831,40852,41947,41954,41960,41328,41305,41317); UPDATE npc_vendor SET extendedcost = 2445 WHERE item IN (41218,41716,40871,42012,41276,41684,41212,41045,41870,40964,40870,41039,41935,40872,41966,41282); UPDATE npc_vendor SET extendedcost = 2443 WHERE item IN (41144,41774,40811,42018,41288,41768,41138,41008,41875,40928,40810,41002,41941,40812,41972,41294); -UPDATE npc_vendor SET extendedcost = 2444 WHERE item IN (42591,42585,42580,42854,42616,42622,42609,42604,42599); \ No newline at end of file +UPDATE npc_vendor SET extendedcost = 2444 WHERE item IN (42591,42585,42580,42854,42616,42622,42609,42604,42599); + +UPDATE npc_vendor SET extendedcost = 2742 WHERE item IN (41088,41158,41206,41679,41668,41662,40791,40830,40851,41994,41999,42006,41322,41299,41311,41673,41656,41651,41082,41152,41200,40995,41020,41034,41855,41865,41860,40910,40934,40940,40790,40829,40850,40994,41014,41028,41916,41928,41922,40792,40831,40852,41947,41954,41960,41328,41305,41317) AND entry IN (37941, 37942, 38858);; +UPDATE npc_vendor SET extendedcost = 2740 WHERE item IN (41218,41716,40871,42012,41276,41684,41212,41045,41870,40964,40870,41039,41935,40872,41966,41282) AND entry IN (37941, 37942, 38858);; +UPDATE npc_vendor SET extendedcost = 2740 WHERE item IN (41144,41774,40811,42018,41288,41768,41138,41008,41875,40928,40810,41002,41941,40812,41972,41294) AND entry IN (37941, 37942, 38858);; \ No newline at end of file diff --git a/modules/azerothshard/data/sql/updates/world/hotfix_rele_price_frost.sql b/modules/azerothshard/data/sql/updates/world/hotfix_rele_price_frost.sql new file mode 100644 index 0000000000..41c6c8cbb1 --- /dev/null +++ b/modules/azerothshard/data/sql/updates/world/hotfix_rele_price_frost.sql @@ -0,0 +1,3 @@ +UPDATE npc_vendor SET extendedcost = 2742 WHERE item IN (41088,41158,41206,41679,41668,41662,40791,40830,40851,41994,41999,42006,41322,41299,41311,41673,41656,41651,41082,41152,41200,40995,41020,41034,41855,41865,41860,40910,40934,40940,40790,40829,40850,40994,41014,41028,41916,41928,41922,40792,40831,40852,41947,41954,41960,41328,41305,41317) AND entry IN (37941, 37942, 38858);; +UPDATE npc_vendor SET extendedcost = 2740 WHERE item IN (41218,41716,40871,42012,41276,41684,41212,41045,41870,40964,40870,41039,41935,40872,41966,41282) AND entry IN (37941, 37942, 38858);; +UPDATE npc_vendor SET extendedcost = 2740 WHERE item IN (41144,41774,40811,42018,41288,41768,41138,41008,41875,40928,40810,41002,41941,40812,41972,41294) AND entry IN (37941, 37942, 38858);; \ No newline at end of file From 415436d802d98fd0ca5c61c040c0c48a8b983adb Mon Sep 17 00:00:00 2001 From: Gargarensis Date: Sat, 6 Aug 2016 01:10:13 +0200 Subject: [PATCH 2/4] patch item and player gossip --- src/server/game/Handlers/MiscHandler.cpp | 38 ++++++++++++++++++++++-- src/server/game/Scripting/ScriptMgr.cpp | 28 +++++++++++++++++ src/server/game/Scripting/ScriptMgr.h | 26 ++++++++++++++++ 3 files changed, 90 insertions(+), 2 deletions(-) diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 03ebb65c17..d23105a42f 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -101,6 +101,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) Creature* unit = NULL; GameObject* go = NULL; + Item* item = NULL; if (IS_CRE_OR_VEH_GUID(guid)) { unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); @@ -119,6 +120,23 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) return; } } + else if (IS_ITEM_GUID(guid)) + { + item = _player->GetItemByGuid(guid); + if (!item || _player->IsBankPos(item->GetPos())) + { + //TC_LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - %s not found.", guid.ToString().c_str()); + return; + } + } + else if (IS_PLAYER_GUID(guid)) + { + if (guid != _player->GetGUID() || menuId != _player->PlayerTalkClass->GetGossipMenu().GetMenuId()) + { + //TC_LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - %s not found.", guid.ToString().c_str()); + return; + } + } else { ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - unsupported GUID type for highguid %u. lowpart %u.", uint32(GUID_HIPART(guid)), uint32(GUID_LOPART(guid))); @@ -147,11 +165,19 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) if (!sScriptMgr->OnGossipSelectCode(_player, unit, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId), code.c_str())) _player->OnGossipSelect(unit, gossipListId, menuId); } - else + else if (go) { go->AI()->GossipSelectCode(_player, menuId, gossipListId, code.c_str()); sScriptMgr->OnGossipSelectCode(_player, go, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId), code.c_str()); } + else if (item) + { + sScriptMgr->OnGossipSelectCode(_player, item, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId), code.c_str()); + } + else + { + sScriptMgr->OnGossipSelectCode(_player, menuId, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId), code.c_str()); + } } else { @@ -161,12 +187,20 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) if (!sScriptMgr->OnGossipSelect(_player, unit, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId))) _player->OnGossipSelect(unit, gossipListId, menuId); } - else + else if (go) { go->AI()->GossipSelect(_player, menuId, gossipListId); if (!sScriptMgr->OnGossipSelect(_player, go, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId))) _player->OnGossipSelect(go, gossipListId, menuId); } + else if (item) + { + sScriptMgr->OnGossipSelect(_player, item, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId)); + } + else + { + sScriptMgr->OnGossipSelect(_player, menuId, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId)); + } } } diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 089105b9b6..d568af8be4 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -703,6 +703,34 @@ bool ScriptMgr::OnItemExpire(Player* player, ItemTemplate const* proto) return tmpscript->OnExpire(player, proto); } +void ScriptMgr::OnGossipSelect(Player* player, Item* item, uint32 sender, uint32 action) +{ + ASSERT(player); + ASSERT(item); + + GET_SCRIPT(ItemScript, item->GetScriptId(), tmpscript); + tmpscript->OnGossipSelect(player, item, sender, action); +} + +void ScriptMgr::OnGossipSelectCode(Player* player, Item* item, uint32 sender, uint32 action, const char* code) +{ + ASSERT(player); + ASSERT(item); + + GET_SCRIPT(ItemScript, item->GetScriptId(), tmpscript); + tmpscript->OnGossipSelectCode(player, item, sender, action, code); +} + +void ScriptMgr::OnGossipSelect(Player* player, uint32 menu_id, uint32 sender, uint32 action) +{ + FOREACH_SCRIPT(PlayerScript)->OnGossipSelect(player, menu_id, sender, action); +} + +void ScriptMgr::OnGossipSelectCode(Player* player, uint32 menu_id, uint32 sender, uint32 action, const char* code) +{ + FOREACH_SCRIPT(PlayerScript)->OnGossipSelectCode(player, menu_id, sender, action, code); +} + bool ScriptMgr::OnGossipHello(Player* player, Creature* creature) { ASSERT(player); diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 7c1a87811f..ce0a4ce044 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -422,6 +422,15 @@ class ItemScript : public ScriptObject // Called when the item expires (is destroyed). virtual bool OnExpire(Player* /*player*/, ItemTemplate const* /*proto*/) { return false; } + + + // AZTH }; class CreatureScript : public ScriptObject, public UpdatableScript @@ -767,6 +776,15 @@ class PlayerScript : public ScriptObject virtual void OnAchiSave(SQLTransaction& /*trans*/, Player* /*player*/, uint16 /*achId*/, CompletedAchievementData /*achiData*/) { } virtual void OnCriteriaSave(SQLTransaction& /*trans*/, Player* /*player*/, uint16 /*achId*/, CriteriaProgress /*criteriaData*/) { } + + + // Called when a player selects an option in a player gossip window + virtual void OnGossipSelect(Player* /*player*/, uint32 /*menu_id*/, uint32 /*sender*/, uint32 /*action*/) { } + + // Called when a player selects an option in a player gossip window + virtual void OnGossipSelectCode(Player* /*player*/, uint32 /*menu_id*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/) { } + + //[/AZTH] }; @@ -924,6 +942,12 @@ class ScriptMgr bool OnItemUse(Player* player, Item* item, SpellCastTargets const& targets); bool OnItemExpire(Player* player, ItemTemplate const* proto); + // AZTH + + public: /* CreatureScript */ bool OnGossipHello(Player* player, Creature* creature); @@ -1044,6 +1068,8 @@ class ScriptMgr void OnCriteriaProgress(Player *player, AchievementCriteriaEntry const* criteria); void OnAchievementSave(SQLTransaction& trans, Player* player, uint16 achiId, CompletedAchievementData achiData); void OnCriteriaSave(SQLTransaction& trans, Player* player, uint16 critId, CriteriaProgress criteriaData); + void OnGossipSelect(Player* player, uint32 menu_id, uint32 sender, uint32 action); + void OnGossipSelectCode(Player* player, uint32 menu_id, uint32 sender, uint32 action, const char* code); // [/AZTH] public: /* GuildScript */ From 671e3a6f30763e2acc105857cef41f53909b53b5 Mon Sep 17 00:00:00 2001 From: Gargarensis Date: Sat, 6 Aug 2016 13:07:44 +0200 Subject: [PATCH 3/4] i forgot something --- data/sql/updates/world/2016_07_28_00.sql | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/data/sql/updates/world/2016_07_28_00.sql b/data/sql/updates/world/2016_07_28_00.sql index 90b69837cd..8fa38d7a9e 100644 --- a/data/sql/updates/world/2016_07_28_00.sql +++ b/data/sql/updates/world/2016_07_28_00.sql @@ -6,10 +6,10 @@ INSERT INTO `creature_loot_template` (`Entry`, `Item`, `ChanceOrQuestChance`, `L (26536, 26011, 1, 1, 1, -26011, 1), (26536, 26012, 1, 1, 1, -26012, 1), (26536, 26040, 21.4, 1, 0, -26040, 1), -(26536, 33370, 3.6, 0, 1, 1, 1), -(26536, 33399, 3.6, 0, 1, 1, 1), +(26536, 33370, 3.6, 1, 1, 1, 1), +(26536, 33399, 3.6, 1, 1, 1, 1), (26536, 33454, 35.5, 1, 0, 1, 1), -(26536, 37068, 0.69, 0, 1, 1, 1), -(26536, 37069, 0.69, 0, 1, 1, 1), -(26536, 37070, 0.69, 0, 1, 1, 1), -(26536, 45912, 0.1, 0, 1, 1, 1); \ No newline at end of file +(26536, 37068, 0.69, 1, 1, 1, 1), +(26536, 37069, 0.69, 1, 1, 1, 1), +(26536, 37070, 0.69, 1, 1, 1, 1), +(26536, 45912, 0.1, 1, 1, 1, 1); \ No newline at end of file From 511bd0982e47b18bc68e2b8448de8280df3e8855 Mon Sep 17 00:00:00 2001 From: MadAgos Date: Sat, 6 Aug 2016 15:01:31 +0200 Subject: [PATCH 4/4] minor fix --- .../src/server/plugins/CrossFaction/CrossFaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/azerothshard/src/server/plugins/CrossFaction/CrossFaction.cpp b/modules/azerothshard/src/server/plugins/CrossFaction/CrossFaction.cpp index 7c71059636..e76532613c 100644 --- a/modules/azerothshard/src/server/plugins/CrossFaction/CrossFaction.cpp +++ b/modules/azerothshard/src/server/plugins/CrossFaction/CrossFaction.cpp @@ -91,7 +91,7 @@ void CrossFaction::UpdateGroupLeaderMap(uint64 leaderGuid, bool remove) void CrossFaction::UpdateAllGroups() { for (UNORDERED_MAP::iterator itr = LeaderRaceMap.begin(); itr != LeaderRaceMap.end(); itr++) - if (Player* leader = ObjectAccessor::ObjectAccessor::FindPlayer(itr->first)) + if (Player* leader = ObjectAccessor::FindPlayer(itr->first)) if(Group* group = leader->GetGroup()) { sLog->outError("Updating faction for group of leader %s", leader->GetName().c_str());