diff options
author | Vincent_Michael <Vincent_Michael@gmx.de> | 2013-03-09 00:32:33 +0100 |
---|---|---|
committer | Vincent_Michael <Vincent_Michael@gmx.de> | 2013-03-09 00:32:33 +0100 |
commit | 83a5043741c0ef3d96ff59571305eae30d360ed5 (patch) | |
tree | 923a3e255c0f3801192ce21250c41a64c46e72f8 | |
parent | a196ab60c3c38ed4f986b2a563880e43f1014f99 (diff) | |
parent | 2dbe3d6cfe2d174b5edf9fdb6720fee21c7009d2 (diff) |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/game/Handlers/ChatHandler.cpp
23 files changed, 325 insertions, 182 deletions
diff --git a/sql/updates/auth/2013_03_08_00_auth_misc.sql b/sql/updates/auth/2013_03_08_00_auth_misc.sql new file mode 100644 index 00000000000..46e687b5da5 --- /dev/null +++ b/sql/updates/auth/2013_03_08_00_auth_misc.sql @@ -0,0 +1,9 @@ +-- Delete 'Two side mail interaction', 'Allow say chat between factions' and 'Allow channel chat between factions' from Player group +DELETE FROM `rbac_group_roles` WHERE `groupId` = 1 AND `roleId` IN (19, 28, 30); + +-- Delete 'Join channels without announce' from Moderators+ group +DELETE FROM `rbac_group_roles` WHERE `roleId` = 31; + +-- Add 'Allow two side charater accounts' +DELETE FROM `rbac_group_roles` WHERE `roleId` = 34; +INSERT INTO `rbac_group_roles` (`groupId`, `roleId`) VALUES (1, 34); diff --git a/sql/updates/world/2013_03_08_00_world_borrowed_technology.sql b/sql/updates/world/2013_03_08_00_world_borrowed_technology.sql new file mode 100644 index 00000000000..06363183836 --- /dev/null +++ b/sql/updates/world/2013_03_08_00_world_borrowed_technology.sql @@ -0,0 +1,58 @@ +-- Fix quests Borrowed Technology, The Solution Solution /Daily/, Volatility, Volatility /Daily/ +-- thanks to genjush for corrections on wrong quest ids +SET @Skytalon := 31583; -- Frostbrood Skytalon +SET @Decoy := 31578; -- Armored Decoy +SET @QuestCredit := 59329; -- Fake Soldier Kill Credit +SET @Stun := 59292; -- Freeze animation to look like Decoy +SET @Explosion := 59335; -- The spell that should kill Skytalon and Decoy +SET @Summon := 59303; -- Summon Skyatalon +SET @Immolation := 54690; -- Skytalon burning animation spell +SET @Grab := 59318; +SET @Bunny := 31630; +SET @PingBunny := 59375; -- Skytalon cast on accessory bunny to tell it to explode after 6 seconds +SET @Script := @Bunny * 100; -- Explosion bunny timed action list + +-- Set inhabit type only 4 to Explosion Bunny that is a vehicle accessory of the Skytalon, otherwise it falls and add "Smart_AI" +UPDATE `creature_template` SET `InhabitType`=4,`AIName`='SmartAI',`flags_extra`=flags_extra|128 WHERE `entry`=@Bunny; +UPDATE `creature_template` SET `unit_flags`=unit_flags|0x00000100|0x00008000,`faction_A`=974,`faction_H`=974,`vehicleId`=279,`InhabitType`=4,`AIName`='',`ScriptName`='npc_frostbrood_skytalon',`HoverHeight`=5 WHERE `entry`=@Skytalon; +UPDATE `creature_template` SET `unit_flags`=unit_flags|0x00000100|0x00008000,`faction_A`=190,`faction_H`=190,`AIName`='SmartAI' WHERE `entry`=@Decoy; + +-- Add missing equipment +DELETE FROM `creature_equip_template` WHERE `entry`=@Decoy; +INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(@Decoy,1,21573,0,0); -- Armored Decoy -> Monster - Sword, 1H Alliance PvP + +-- Add creature_addon data +DELETE FROM `creature_template_addon` WHERE `entry`=@Skytalon; +INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES +(@Skytalon,0,0,50331648,1,0, '60534'); + +-- Insert spell_script names +DELETE FROM `spell_script_names` WHERE `spell_id` IN (@Grab,@Summon); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(@Grab, 'spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy'), +(@Summon, 'spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon'); + +-- Quests relations +UPDATE `quest_template` SET `PrevQuestId`=13290,`NextQuestId`=13383 WHERE `id`=13291; -- Borrowed Technology +UPDATE `quest_template` SET `PrevQuestId`=13291,`NextQuestId`=0 WHERE `id`=13292; -- The Solution Solution /Daily/ +UPDATE `quest_template` SET `PrevQuestId`=13238,`NextQuestId`=13379 WHERE `id`=13239; -- Volatility +UPDATE `quest_template` SET `PrevQuestId`=13329,`NextQuestId`=0 WHERE `id`=13261; -- Volatiliy /Daily/ + +-- Add SAI support for Explosion bunny and Decoy +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@Bunny,@Decoy); +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@Script; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@Bunny,0,0,0,8,0,100,0,@PingBunny,0,0,0,80,@Script,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Explosion Bunny - On hit by ping bunny - Start timed action list'), +(@Script,9,0,0,0,0,100,0,6000,6000,0,0,11,@Explosion,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Explosion Bunny - Action 0 - Cast explosion on self'), +(@Decoy,0,0,1,54,0,100,0,0,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Armored Decoy - On just summoned - Store invoker /since target summoner fails/'), +(@Decoy,0,1,2,61,0,100,0,0,0,0,0,11,@Stun,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Armored Decoy - Linked - Cast Freeze animation on self'), +(@Decoy,0,2,0,61,0,100,0,0,0,0,0,11,@Summon,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Armored Decoy - Linked - Cast summon Skytalon behind'), +(@Decoy,0,3,0,8,0,100,0,@Explosion,0,0,0,11,@QuestCredit,0,0,0,0,0,12,1,0,0,0,0,0,0, 'Armored Decoy - On hit by explosion - Cast kill credit to stored target'); + +-- Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (@Explosion,@PingBunny); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,@Explosion,0,0,31,0,3,@Decoy,0,0,0,0,'', 'Explosion Bunny can hit Armored Decoy'), +(13,1,@Explosion,0,1,31,0,3,@Skytalon,0,0,0,0,'', 'Explosion Bunny can hit Skytalon'), +(13,1,@PingBunny,0,0,31,0,3,@Bunny,0,0,0,0,'', 'Ping Bunny can hit only Explosion Bunny'); diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 906ce520bd1..327d2187730 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -97,37 +97,34 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& uint64 bidderGuid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER); Player* bidder = ObjectAccessor::FindPlayer(bidderGuid); // data for gm.log - if (sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) - { - std::string bidderName; - bool logGmTrade = false; + std::string bidderName; + bool logGmTrade = false; - if (bidder) - { - bidderAccId = bidder->GetSession()->GetAccountId(); - bidderName = bidder->GetName(); - logGmTrade = bidder->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE); - } - else - { - bidderAccId = sObjectMgr->GetPlayerAccountIdByGUID(bidderGuid); - logGmTrade = AccountMgr::HasPermission(bidderAccId, RBAC_PERM_LOG_GM_TRADE, realmID); + if (bidder) + { + bidderAccId = bidder->GetSession()->GetAccountId(); + bidderName = bidder->GetName(); + logGmTrade = bidder->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE); + } + else + { + bidderAccId = sObjectMgr->GetPlayerAccountIdByGUID(bidderGuid); + logGmTrade = AccountMgr::HasPermission(bidderAccId, RBAC_PERM_LOG_GM_TRADE, realmID); - if (logGmTrade && !sObjectMgr->GetPlayerNameByGUID(bidderGuid, bidderName)) - bidderName = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); - } + if (logGmTrade && !sObjectMgr->GetPlayerNameByGUID(bidderGuid, bidderName)) + bidderName = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); + } - if (logGmTrade) - { - std::string ownerName; - if (!sObjectMgr->GetPlayerNameByGUID(auction->owner, ownerName)) - ownerName = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); + if (logGmTrade) + { + std::string ownerName; + if (!sObjectMgr->GetPlayerNameByGUID(auction->owner, ownerName)) + ownerName = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); - uint32 ownerAccId = sObjectMgr->GetPlayerAccountIdByGUID(auction->owner); + uint32 ownerAccId = sObjectMgr->GetPlayerAccountIdByGUID(auction->owner); - sLog->outCommand(bidderAccId, "GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)", - bidderName.c_str(), bidderAccId, pItem->GetTemplate()->Name1.c_str(), pItem->GetEntry(), pItem->GetCount(), auction->bid, ownerName.c_str(), ownerAccId); - } + sLog->outCommand(bidderAccId, "GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)", + bidderName.c_str(), bidderAccId, pItem->GetTemplate()->Name1.c_str(), pItem->GetEntry(), pItem->GetCount(), auction->bid, ownerName.c_str(), ownerAccId); } // receiver exist diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 34c8054256c..d6b00fb108a 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -191,8 +191,7 @@ void Channel::JoinChannel(Player* player, std::string const& pass) player->JoinedChannel(this); - if (_announce && (!sWorld->getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL) || - !player->GetSession()->HasPermission(RBAC_PERM_SILENTLY_JOIN_CHANNEL))) + if (_announce && !player->GetSession()->HasPermission(RBAC_PERM_SILENTLY_JOIN_CHANNEL)) { WorldPacket data; MakeJoined(&data, guid); @@ -253,8 +252,7 @@ void Channel::LeaveChannel(Player* player, bool send) playersStore.erase(guid); - if (_announce && (!sWorld->getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL) || - !player->GetSession()->HasPermission(RBAC_PERM_SILENTLY_JOIN_CHANNEL))) + if (_announce && !player->GetSession()->HasPermission(RBAC_PERM_SILENTLY_JOIN_CHANNEL)) { WorldPacket data; MakeLeft(&data, guid); @@ -318,21 +316,19 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b return; } - bool notify = !sWorld->getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL) || !player->GetSession()->HasPermission(RBAC_PERM_SILENTLY_JOIN_CHANNEL); - if (ban && !IsBanned(victim)) { bannedStore.insert(victim); UpdateChannelInDB(); - if (notify) + if (!player->GetSession()->HasPermission(RBAC_PERM_SILENTLY_JOIN_CHANNEL)) { WorldPacket data; MakePlayerBanned(&data, victim, good); SendToAll(&data); } } - else if (notify) + else if (!player->GetSession()->HasPermission(RBAC_PERM_SILENTLY_JOIN_CHANNEL)) { WorldPacket data; MakePlayerKicked(&data, victim, good); @@ -447,11 +443,9 @@ void Channel::SetMode(Player const* player, std::string const& p2n, bool mod, bo uint64 victim = newp ? newp->GetGUID() : 0; if (!victim || !IsOn(victim) || - (player->GetTeam() != newp->GetTeam() && (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL) || - !player->GetSession()->HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL) || + (player->GetTeam() != newp->GetTeam() && + (!player->GetSession()->HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL) || !newp->GetSession()->HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL)))) - // allow make moderator from another team only if both is GMs - // at this moment this only way to show channel post for GM from another team { WorldPacket data; MakePlayerNotFound(&data, p2n); @@ -497,7 +491,9 @@ void Channel::SetOwner(Player const* player, std::string const& newname) uint64 victim = newp ? newp->GetGUID() : 0; if (!victim || !IsOn(victim) || - (newp->GetTeam() != player->GetTeam() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))) + (player->GetTeam() != newp->GetTeam() && + (!player->GetSession()->HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL) || + !newp->GetSession()->HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL)))) { WorldPacket data; MakePlayerNotFound(&data, newname); @@ -671,8 +667,8 @@ void Channel::Invite(Player const* player, std::string const& newname) return; } - if (newp->GetTeam() != player->GetTeam() && (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL) || - !player->GetSession()->HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL) || + if (newp->GetTeam() != player->GetTeam() && + (!player->GetSession()->HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL) || !newp->GetSession()->HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL))) { WorldPacket data; diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 113b5b1e0ec..c6e5e2b9c66 100644 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -503,7 +503,7 @@ enum VehicleSeatFlags VEHICLE_SEAT_FLAG_CAN_ATTACK = 0x00004000, // Can attack, cast spells and use items from vehicle VEHICLE_SEAT_FLAG_SHOULD_USE_VEH_SEAT_EXIT_ANIM_ON_FORCED_EXIT = 0x00008000, VEHICLE_SEAT_FLAG_UNK17 = 0x00010000, - VEHICLE_SEAT_FLAG_UNK18 = 0x00020000, + VEHICLE_SEAT_FLAG_UNK18 = 0x00020000, // Needs research and support (28 vehicles): Allow entering vehicles while keeping specific permanent(?) auras that impose visuals (states like beeing under freeze/stun mechanic, emote state animations). VEHICLE_SEAT_FLAG_HAS_VEH_EXIT_ANIM_VOLUNTARY_EXIT = 0x00040000, VEHICLE_SEAT_FLAG_HAS_VEH_EXIT_ANIM_FORCED_EXIT = 0x00080000, VEHICLE_SEAT_FLAG_UNK21 = 0x00100000, diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 7017a7bad8e..1a59b5ddeba 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -20056,7 +20056,7 @@ void Player::outDebugValues() const void Player::UpdateSpeakTime() { // ignore chat spam protection for GMs in any mode - if (!GetSession()->HasPermission(RBAC_PERM_SKIP_CHECK_CHAT_SPAM)) + if (GetSession()->HasPermission(RBAC_PERM_SKIP_CHECK_CHAT_SPAM)) return; time_t current = time (NULL); @@ -20515,7 +20515,7 @@ void Player::TextEmote(const std::string& text) WorldPacket data(SMSG_MESSAGECHAT, 200); BuildPlayerChat(&data, CHAT_MSG_EMOTE, _text, LANG_UNIVERSAL); - SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true, !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT)); + SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true, !GetSession()->HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHAT)); } void Player::WhisperAddon(const std::string& text, const std::string& prefix, Player* receiver) diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp index ec8e6672508..1b59a097ff3 100644 --- a/src/server/game/Entities/Player/SocialMgr.cpp +++ b/src/server/game/Entities/Player/SocialMgr.cpp @@ -233,8 +233,7 @@ void SocialMgr::GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &fri return; // player can see member of other team only if CONFIG_ALLOW_TWO_SIDE_WHO_LIST - if (target->GetTeam() != player->GetTeam() && - !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST) && !player->GetSession()->HasPermission(RBAC_PERM_TWO_SIDE_WHO_LIST)) + if (target->GetTeam() != player->GetTeam() && !player->GetSession()->HasPermission(RBAC_PERM_TWO_SIDE_WHO_LIST)) return; if (target->IsVisibleGloballyFor(player)) @@ -300,6 +299,7 @@ void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket* packet) if (!player) return; + AccountTypes gmSecLevel = AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST)); for (SocialMap::const_iterator itr = m_socialMap.begin(); itr != m_socialMap.end(); ++itr) { PlayerSocialMap::const_iterator itr2 = itr->second.m_playerSocialMap.find(player->GetGUID()); @@ -309,20 +309,15 @@ void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket* packet) if (!target || !target->IsInWorld()) continue; - if (!target->GetSession()->HasPermission(RBAC_PERM_WHO_SEE_ALL_SEC_LEVELS) && - player->GetSession()->GetSecurity() > AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST))) + WorldSession* session = target->GetSession(); + if (!session->HasPermission(RBAC_PERM_WHO_SEE_ALL_SEC_LEVELS) && player->GetSession()->GetSecurity() > gmSecLevel) continue; - // player can see member of other team only if CONFIG_ALLOW_TWO_SIDE_WHO_LIST - if (target->GetTeam() != player->GetTeam() && - !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST) && - !target->GetSession()->HasPermission(RBAC_PERM_TWO_SIDE_WHO_LIST)) + if (target->GetTeam() != player->GetTeam() && !session->HasPermission(RBAC_PERM_TWO_SIDE_WHO_LIST)) continue; - // PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters - // MODERATOR, GAME MASTER, ADMINISTRATOR can see all if (player->IsVisibleGloballyFor(target)) - target->GetSession()->SendPacket(packet); + session->SendPacket(packet); } } } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 705bdfd8589..0485b272f98 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1019,8 +1019,7 @@ void Guild::BankMoveItemData::LogBankEvent(SQLTransaction& trans, MoveItemData* void Guild::BankMoveItemData::LogAction(MoveItemData* pFrom) const { MoveItemData::LogAction(pFrom); - if (!pFrom->IsBank() && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE) && - m_pPlayer->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE)) + if (!pFrom->IsBank() && m_pPlayer->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE)) { sLog->outCommand(m_pPlayer->GetSession()->GetAccountId(), "GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u)", @@ -2012,7 +2011,7 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint64 amount, bool std::string aux = ByteArrayToHexStr(reinterpret_cast<uint8*>(&amount), 8, true); _BroadcastEvent(GE_BANK_MONEY_CHANGED, 0, aux.c_str()); - if (player->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (player->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE)) { sLog->outCommand(player->GetSession()->GetAccountId(), "GM %s (Account: %u) deposit money (Amount: " UI64FMTD ") to guild bank (Guild ID %u)", diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 59a1bcf6c33..33316338c9e 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -269,7 +269,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData) // Required stack size of auction matches to current item stack size, just move item to auctionhouse if (itemsCount == 1 && item->GetCount() == count[i]) { - if (HasPermission(RBAC_PERM_LOG_GM_TRADE) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (HasPermission(RBAC_PERM_LOG_GM_TRADE)) { sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount()); @@ -318,7 +318,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData) return; } - if (HasPermission(RBAC_PERM_LOG_GM_TRADE) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (HasPermission(RBAC_PERM_LOG_GM_TRADE)) { sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", GetPlayerName().c_str(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount()); diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 71c16d6029e..8ed84db245d 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -517,7 +517,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte } } - bool allowTwoSideAccounts = !sWorld->IsPvPRealm() || sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || HasPermission(RBAC_PERM_TWO_SIDE_CHARACTER_CREATION); + bool allowTwoSideAccounts = !sWorld->IsPvPRealm() || HasPermission(RBAC_PERM_TWO_SIDE_CHARACTER_CREATION); uint32 skipCinematics = sWorld->getIntConfig(CONFIG_SKIP_CINEMATICS); _charCreateCallback.FreeResult(); @@ -541,7 +541,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte bool haveSameRace = false; uint32 heroicReqLevel = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER); bool hasHeroicReqLevel = (heroicReqLevel == 0); - bool allowTwoSideAccounts = !sWorld->IsPvPRealm() || sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || HasPermission(RBAC_PERM_TWO_SIDE_CHARACTER_CREATION); + bool allowTwoSideAccounts = !sWorld->IsPvPRealm() || HasPermission(RBAC_PERM_TWO_SIDE_CHARACTER_CREATION); uint32 skipCinematics = sWorld->getIntConfig(CONFIG_SKIP_CINEMATICS); bool checkHeroicReqs = createInfo->Class == CLASS_DEATH_KNIGHT && !HasPermission(RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_HEROIC_CHARACTER); @@ -2003,7 +2003,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) guild->DeleteMember(MAKE_NEW_GUID(lowGuid, 0, HIGHGUID_PLAYER)); } - if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND)) + if (!HasPermission(RBAC_PERM_TWO_SIDE_ADD_FRIEND)) { // Delete Friend List stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_GUID); diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 40547463323..84c4359365f 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -179,7 +179,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) else { // send in universal language in two side iteration allowed mode - if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT)) + if (HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHAT)) lang = LANG_UNIVERSAL; else { @@ -335,10 +335,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) return; } - if (GetPlayer()->GetTeam() != receiver->GetTeam() && - (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) || - !HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHAT) || - !receiver->GetSession()->HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHAT))) + if (GetPlayer()->GetTeam() != receiver->GetTeam() && !HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHAT)) { SendWrongFactionNotice(); return; diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index b1f42f92a6d..af9b178d587 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -165,7 +165,6 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) uint8 mailsCount = 0; //do not allow to send to one player more than 100 mails uint8 receiverLevel = 0; uint32 receiverAccountId = 0; - bool canReceiveMailFromOtherFaction = false; if (receiver) { @@ -173,7 +172,6 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) mailsCount = receiver->GetMailSize(); receiverLevel = receiver->getLevel(); receiverAccountId = receiver->GetSession()->GetAccountId(); - canReceiveMailFromOtherFaction = receiver->GetSession()->HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_MAIL); } else { @@ -200,7 +198,6 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) } receiverAccountId = sObjectMgr->GetPlayerAccountIdByGUID(receiverGuid); - canReceiveMailFromOtherFaction = AccountMgr::HasPermission(receiverAccountId, RBAC_PERM_TWO_SIDE_INTERACTION_MAIL, realmID); } // do not allow to have more than 100 mails in mailbox.. mails count is in opcode uint8!!! - so max can be 255.. @@ -225,10 +222,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) } } - if (!accountBound && player->GetTeam() != receiverTeam && // Sender and reciver are from different faction - (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL) || // Config not enabled - !HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_MAIL) || // Sender cant mail interact with the other faction - !canReceiveMailFromOtherFaction)) // Receiver cant mail interact with the other faction + if (!accountBound && player->GetTeam() != receiverTeam && !HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_MAIL)) { player->SendMailResult(0, MAIL_SEND, MAIL_ERR_NOT_YOUR_TEAM); return; @@ -305,7 +299,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) if (items_count > 0 || money > 0) { - bool log = sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE) && HasPermission(RBAC_PERM_LOG_GM_TRADE); + bool log = HasPermission(RBAC_PERM_LOG_GM_TRADE); if (items_count > 0) { for (uint8 i = 0; i < items_count; ++i) @@ -507,7 +501,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket& recvData) uint32 sender_accId = 0; - if (HasPermission(RBAC_PERM_LOG_GM_TRADE) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (HasPermission(RBAC_PERM_LOG_GM_TRADE)) { std::string sender_name; if (receiver) diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 8c0cf1a15d8..2df2ed1b15f 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -242,7 +242,6 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData) uint32 team = _player->GetTeam(); - bool allowTwoSideWhoList = sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST); uint32 gmLevelInWhoList = sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST); uint32 displaycount = 0; @@ -256,7 +255,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData) { Player* target = itr->second; // player can see member of other team only if CONFIG_ALLOW_TWO_SIDE_WHO_LIST - if (target->GetTeam() != team && !allowTwoSideWhoList && !HasPermission(RBAC_PERM_TWO_SIDE_WHO_LIST)) + if (target->GetTeam() != team && !HasPermission(RBAC_PERM_TWO_SIDE_WHO_LIST)) continue; // player can see MODERATOR, GAME MASTER, ADMINISTRATOR only if CONFIG_GM_IN_WHO_LIST @@ -572,14 +571,13 @@ void WorldSession::HandleAddFriendOpcodeCallBack(PreparedQueryResult result, std team = Player::TeamForRace(fields[1].GetUInt8()); friendAccountId = fields[2].GetUInt32(); - if (HasPermission(RBAC_PERM_ALLOW_GM_FRIEND) || sWorld->getBoolConfig(CONFIG_ALLOW_GM_FRIEND) || - AccountMgr::IsPlayerAccount(AccountMgr::GetSecurity(friendAccountId, realmID))) + if (HasPermission(RBAC_PERM_ALLOW_GM_FRIEND) || AccountMgr::IsPlayerAccount(AccountMgr::GetSecurity(friendAccountId, realmID))) { if (friendGuid) { if (friendGuid == GetPlayer()->GetGUID()) friendResult = FRIEND_SELF; - else if (GetPlayer()->GetTeam() != team && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND) && !HasPermission(RBAC_PERM_TWO_SIDE_ADD_FRIEND)) + else if (GetPlayer()->GetTeam() != team && !HasPermission(RBAC_PERM_TWO_SIDE_ADD_FRIEND)) friendResult = FRIEND_ENEMY; else if (GetPlayer()->GetSocial()->HasFriend(GUID_LOPART(friendGuid))) friendResult = FRIEND_ALREADY; diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 49bc70dcde3..aa41e3bb391 100644 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -213,7 +213,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) { // logging sLog->outDebug(LOG_FILTER_NETWORKIO, "partner storing: %u", myItems[i]->GetGUIDLow()); - if (HasPermission(RBAC_PERM_LOG_GM_TRADE) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (HasPermission(RBAC_PERM_LOG_GM_TRADE)) { sLog->outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", _player->GetName().c_str(), _player->GetSession()->GetAccountId(), @@ -231,7 +231,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) { // logging sLog->outDebug(LOG_FILTER_NETWORKIO, "player storing: %u", hisItems[i]->GetGUIDLow()); - if (HasPermission(RBAC_PERM_LOG_GM_TRADE) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (HasPermission(RBAC_PERM_LOG_GM_TRADE)) { sLog->outCommand(trader->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", trader->GetName().c_str(), trader->GetSession()->GetAccountId(), @@ -534,7 +534,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) moveItems(myItems, hisItems); // logging money - if (HasPermission(RBAC_PERM_LOG_GM_TRADE) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (HasPermission(RBAC_PERM_LOG_GM_TRADE)) { if (my_trade->GetMoney() > 0) { diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index c4dc26507f3..6c3b21fc4e0 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2593,7 +2593,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex) if (!item_owner) return; - if (item_owner != p_caster && p_caster->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (item_owner != p_caster && p_caster->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE)) { sLog->outCommand(p_caster->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", p_caster->GetName().c_str(), p_caster->GetSession()->GetAccountId(), @@ -2658,7 +2658,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex) if (!item_owner) return; - if (item_owner != p_caster && p_caster->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (item_owner != p_caster && p_caster->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE)) { sLog->outCommand(p_caster->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", p_caster->GetName().c_str(), p_caster->GetSession()->GetAccountId(), @@ -2740,7 +2740,7 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex) if (!item_owner) return; - if (item_owner != p_caster && p_caster->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (item_owner != p_caster && p_caster->GetSession()->HasPermission(RBAC_PERM_LOG_GM_TRADE)) { sLog->outCommand(p_caster->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(temp): %s (Entry: %d) for player: %s (Account: %u)", p_caster->GetName().c_str(), p_caster->GetSession()->GetAccountId(), diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index e54f4c24a6b..ffed29b6aa5 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -656,16 +656,11 @@ void World::LoadConfigSettings(bool reload) else m_int_configs[CONFIG_REALM_ZONE] = ConfigMgr::GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_ACCOUNTS] = ConfigMgr::GetBoolDefault("AllowTwoSide.Accounts", true); m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR]= ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Calendar", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT] = ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Chat", false); m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL] = ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Channel", false); m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP] = ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Group", false); m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD] = ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Guild", false); m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION] = ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Auction", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL] = ConfigMgr::GetBoolDefault("AllowTwoSide.Interaction.Mail", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_WHO_LIST] = ConfigMgr::GetBoolDefault("AllowTwoSide.WhoList", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND] = ConfigMgr::GetBoolDefault("AllowTwoSide.AddFriend", false); m_bool_configs[CONFIG_ALLOW_TWO_SIDE_TRADE] = ConfigMgr::GetBoolDefault("AllowTwoSide.trade", false); m_int_configs[CONFIG_STRICT_PLAYER_NAMES] = ConfigMgr::GetIntDefault ("StrictPlayerNames", 0); m_int_configs[CONFIG_STRICT_CHARTER_NAMES] = ConfigMgr::GetIntDefault ("StrictCharterNames", 0); @@ -886,7 +881,6 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_GM_LEVEL_IN_GM_LIST] = ConfigMgr::GetIntDefault("GM.InGMList.Level", SEC_ADMINISTRATOR); m_int_configs[CONFIG_GM_LEVEL_IN_WHO_LIST] = ConfigMgr::GetIntDefault("GM.InWhoList.Level", SEC_ADMINISTRATOR); - m_bool_configs[CONFIG_GM_LOG_TRADE] = ConfigMgr::GetBoolDefault("GM.LogTrade", false); m_int_configs[CONFIG_START_GM_LEVEL] = ConfigMgr::GetIntDefault("GM.StartLevel", 1); if (m_int_configs[CONFIG_START_GM_LEVEL] < m_int_configs[CONFIG_START_PLAYER_LEVEL]) { @@ -900,7 +894,6 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_START_GM_LEVEL] = MAX_LEVEL; } m_bool_configs[CONFIG_ALLOW_GM_GROUP] = ConfigMgr::GetBoolDefault("GM.AllowInvite", false); - m_bool_configs[CONFIG_ALLOW_GM_FRIEND] = ConfigMgr::GetBoolDefault("GM.AllowFriend", false); m_bool_configs[CONFIG_GM_LOWER_SECURITY] = ConfigMgr::GetBoolDefault("GM.LowerSecurity", false); m_float_configs[CONFIG_CHANCE_OF_GM_SURVEY] = ConfigMgr::GetFloatDefault("GM.TicketSystem.ChanceOfGMSurvey", 50.0f); @@ -1014,8 +1007,6 @@ void World::LoadConfigSettings(bool reload) m_bool_configs[CONFIG_DETECT_POS_COLLISION] = ConfigMgr::GetBoolDefault("DetectPosCollision", true); m_bool_configs[CONFIG_RESTRICTED_LFG_CHANNEL] = ConfigMgr::GetBoolDefault("Channel.RestrictedLfg", true); - m_bool_configs[CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL] = ConfigMgr::GetBoolDefault("Channel.SilentlyGMJoin", false); - m_bool_configs[CONFIG_TALENTS_INSPECTING] = ConfigMgr::GetBoolDefault("TalentsInspecting", true); m_bool_configs[CONFIG_CHAT_FAKE_MESSAGE_PREVENTING] = ConfigMgr::GetBoolDefault("ChatFakeMessagePreventing", false); m_int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY] = ConfigMgr::GetIntDefault("ChatStrictLinkChecking.Severity", 0); @@ -3246,6 +3237,7 @@ void World::UpdatePhaseDefinitions() void World::ReloadRBAC() { + // Pasive reload, we mark the data as invalidated and next time a permission is checked it will be reloaded sLog->outInfo(LOG_FILTER_RBAC, "World::ReloadRBAC()"); for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) if (WorldSession* session = itr->second) diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 678538ba253..a07375bca1e 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -99,25 +99,18 @@ enum WorldBoolConfigs CONFIG_CLEAN_CHARACTER_DB, CONFIG_GRID_UNLOAD, CONFIG_STATS_SAVE_ONLY_ON_LOGOUT, - CONFIG_ALLOW_TWO_SIDE_ACCOUNTS, CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR, - CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT, CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL, CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP, CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD, CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION, - CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL, - CONFIG_ALLOW_TWO_SIDE_WHO_LIST, - CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND, CONFIG_ALLOW_TWO_SIDE_TRADE, CONFIG_ALL_TAXI_PATHS, CONFIG_INSTANT_TAXI, CONFIG_INSTANCE_IGNORE_LEVEL, CONFIG_INSTANCE_IGNORE_RAID, CONFIG_CAST_UNSTUCK, - CONFIG_GM_LOG_TRADE, CONFIG_ALLOW_GM_GROUP, - CONFIG_ALLOW_GM_FRIEND, CONFIG_GM_LOWER_SECURITY, CONFIG_SKILL_PROSPECTING, CONFIG_SKILL_MILLING, @@ -126,7 +119,6 @@ enum WorldBoolConfigs CONFIG_QUEST_IGNORE_RAID, CONFIG_DETECT_POS_COLLISION, CONFIG_RESTRICTED_LFG_CHANNEL, - CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL, CONFIG_TALENTS_INSPECTING, CONFIG_CHAT_FAKE_MESSAGE_PREVENTING, CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP, diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp index 958eb1709d5..95cbf70e1f8 100644 --- a/src/server/scripts/Commands/cs_ticket.cpp +++ b/src/server/scripts/Commands/cs_ticket.cpp @@ -95,7 +95,8 @@ public: return true; } - uint32 accountId = AccountMgr::GetId(target); + uint64 targetGuid = sObjectMgr->GetPlayerGUIDByName(target); + uint32 accountId = sObjectMgr->GetPlayerAccountIdByGUID(targetGuid); // Target must exist and have administrative rights if (!AccountMgr::HasPermission(accountId, RBAC_PERM_COMMANDS_BE_ASSIGNED_TICKET, realmID)) { @@ -103,8 +104,6 @@ public: return true; } - uint64 targetGuid = sObjectMgr->GetPlayerGUIDByName(target); - // If already assigned, leave if (ticket->IsAssignedTo(targetGuid)) { diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 27331acca2b..6f50dbc427a 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -19,13 +19,10 @@ SDName: Boss Malygos Script Data End */ -/* Main problems needing most attention: - 1) Add support for using Exit Portal while on drake which means to - find seat flag that allows casting on passenger or something that - will prevent valid target filtering. - 2) Find what cause client not sending release now availability - if player dies after far falling. For now player needs to logout to get body after - if release button remain unavailable after box popping.*/ +/* Main problem needing most attention: + Add support for using Exit Portal while on drake which means to + find seat flag that allows casting on passenger or something that + will prevent valid target filtering. */ #include "ScriptMgr.h" #include "ScriptedCreature.h" @@ -359,8 +356,8 @@ public: _summonDeaths = 0; _preparingPulsesChecker = 0; - _arcaneOverloadGUID = NULL; - _lastHitByArcaneBarrageGUID = NULL; + _arcaneOverloadGUID = 0; + _lastHitByArcaneBarrageGUID = 0; memset(_surgeTargetGUID, 0, sizeof(_surgeTargetGUID)); _killSpamFilter = false; @@ -2054,7 +2051,7 @@ class spell_scion_of_eternity_arcane_barrage : public SpellScriptLoader // in longer terms this means if spell picks target X then 2nd cast of this spell will pick smth else // and if 3rd picks X again 4th will pick smth else (by not limiting the cast to certain caster). if (targets.size() > 1) - if (malygos && malygos->AI()->GetGUID(DATA_LAST_TARGET_BARRAGE_GUID) != NULL) + if (malygos && malygos->AI()->GetGUID(DATA_LAST_TARGET_BARRAGE_GUID)) targets.remove_if(Trinity::ObjectGUIDCheck(malygos->AI()->GetGUID(DATA_LAST_TARGET_BARRAGE_GUID))); // Remove players not on Hover Disk from second list diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp index 52ce259117f..9099f03c6f0 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp @@ -152,6 +152,20 @@ public: } } + void OnUnitDeath(Unit* unit) + { + if (unit->GetTypeId() != TYPEID_PLAYER) + return; + + // For some reason player continues sometimes to be moving after death on this map, + // perhaps only client side issue am not entirtly sure. + // This fix not being able to press release button. + // Variation of this with some check needs to be implemented somewhere within core code. + // It'll stay here until someone find where and why the leak happens. + if (Player* dyingPlayer = unit->ToPlayer()) + dyingPlayer->StopMoving(); + } + void ProcessEvent(WorldObject* /*obj*/, uint32 eventId) { if (eventId == EVENT_FOCUSING_IRIS) diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index d5641b0fcc7..70b500166c9 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -32,6 +32,8 @@ EndContentData */ #include "ScriptedGossip.h" #include "SpellAuras.h" #include "Player.h" +#include "TemporarySummon.h" +#include "CombatAI.h" /*###### ## npc_arete @@ -874,6 +876,92 @@ public: } }; +/*###### +## Borrowed Technology - Id: 13291, The Solution Solution (daily) - Id: 13292, Volatility - Id: 13239, Volatiliy - Id: 13261 (daily) +######*/ + +enum BorrowedTechnologyAndVolatility +{ + // Spells + SPELL_GRAB = 59318, + SPELL_PING_BUNNY = 59375, + SPELL_IMMOLATION = 54690, + SPELL_EXPLOSION = 59335, + SPELL_RIDE = 56687, + + // Points + POINT_GRAB_DECOY = 1, + POINT_FLY_AWAY = 2, + + // Events + EVENT_FLY_AWAY = 1 +}; + +class npc_frostbrood_skytalon : public CreatureScript +{ + public: + npc_frostbrood_skytalon() : CreatureScript("npc_frostbrood_skytalon") { } + + struct npc_frostbrood_skytalonAI : public VehicleAI + { + npc_frostbrood_skytalonAI(Creature* creature) : VehicleAI(creature) { } + + EventMap events; + + void IsSummonedBy(Unit* summoner) + { + me->GetMotionMaster()->MovePoint(POINT_GRAB_DECOY, summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ()); + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == POINT_GRAB_DECOY) + if (TempSummon* summon = me->ToTempSummon()) + if (Unit* summoner = summon->GetSummoner()) + DoCast(summoner, SPELL_GRAB); + } + + void UpdateAI(uint32 diff) + { + VehicleAI::UpdateAI(diff); + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + if (eventId == EVENT_FLY_AWAY) + { + Position randomPosOnRadius; + randomPosOnRadius.m_positionZ = (me->GetPositionZ() + 40.0f); + me->GetNearPoint2D(randomPosOnRadius.m_positionX, randomPosOnRadius.m_positionY, 40.0f, me->GetAngle(me)); + me->GetMotionMaster()->MovePoint(POINT_FLY_AWAY, randomPosOnRadius); + } + } + } + + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) + { + switch (spell->Id) + { + case SPELL_EXPLOSION: + DoCast(me, SPELL_IMMOLATION); + break; + case SPELL_RIDE: + DoCastAOE(SPELL_PING_BUNNY); + events.ScheduleEvent(EVENT_FLY_AWAY, 100); + break; + } + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_frostbrood_skytalonAI(creature); + } +}; + void AddSC_icecrown() { new npc_arete; @@ -883,4 +971,5 @@ void AddSC_icecrown() new npc_vereth_the_cunning; new npc_tournament_training_dummy; new npc_blessed_banner(); + new npc_frostbrood_skytalon(); } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 49a47a17392..3036c52876d 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1561,6 +1561,85 @@ class spell_q12527_zuldrak_rat : public SpellScriptLoader } }; +// 13291 - Borrowed Technology/13292 - The Solution Solution /Daily//13239 - Volatility/13261 - Volatiliy /Daily// +enum Quest13291_13292_13239_13261Data +{ + // NPCs + NPC_SKYTALON = 31583, + NPC_DECOY = 31578, + // Spells + SPELL_RIDE = 56687 +}; + +class spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy : public SpellScriptLoader +{ + public: + spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy() : SpellScriptLoader("spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy") { } + + class spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_RIDE)) + return false; + + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (!GetHitCreature()) + return; + // TO DO: Being triggered is hack, but in checkcast it doesn't pass aurastate requirements. + // Beside that the decoy won't keep it's freeze animation state when enter. + GetHitCreature()->CastSpell(GetCaster(), SPELL_RIDE, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy_SpellScript(); + } +}; + +class spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon : public SpellScriptLoader +{ + public: + spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon() : SpellScriptLoader("spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon") { } + + class spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon_SpellScript); + + void ChangeSummonPos(SpellEffIndex /*effIndex*/) + { + // Adjust effect summon position + WorldLocation summonPos = *GetExplTargetDest(); + Position offset = { 0.0f, 0.0f, 20.0f, 0.0f }; + summonPos.RelocateOffset(offset); + SetExplTargetDest(summonPos); + GetHitDest()->RelocateOffset(offset); + } + + void Register() + { + OnEffectHit += SpellEffectFn(spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -1599,4 +1678,6 @@ void AddSC_quest_spell_scripts() new spell_q11010_q11102_q11023_q11008_check_fly_mount(); new spell_q12372_azure_on_death_force_whisper(); new spell_q12527_zuldrak_rat(); + new spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy(); + new spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon(); } diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 68969b45351..a4b279c4b0c 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -1174,13 +1174,6 @@ Warden.BanDuration = 86400 ################################################################################################### # PLAYER INTERACTION # -# AllowTwoSide.Accounts -# Description: Allow creating characters of both factions on the same account. -# Default: 1 - (Enabled) -# 0 - (Disabled) - -AllowTwoSide.Accounts = 1 - # # AllowTwoSide.Interaction.Calendar # Description: Allow calendar invites between factions. @@ -1190,14 +1183,6 @@ AllowTwoSide.Accounts = 1 AllowTwoSide.Interaction.Calendar = 0 # -# AllowTwoSide.Interaction.Chat -# Description: Allow say chat between factions. -# Default: 0 - (Disabled) -# 1 - (Enabled) - -AllowTwoSide.Interaction.Chat = 0 - -# # AllowTwoSide.Interaction.Channel # Description: Allow channel chat between factions. # Default: 0 - (Disabled) @@ -1230,30 +1215,6 @@ AllowTwoSide.Interaction.Guild = 0 AllowTwoSide.Interaction.Auction = 0 # -# AllowTwoSide.Interaction.Mail -# Description: Allow sending mails between factions. -# Default: 0 - (Disabled) -# 1 - (Enabled) - -AllowTwoSide.Interaction.Mail = 0 - -# -# AllowTwoSide.WhoList -# Description: Show characters from both factions in the /who list. -# Default: 0 - (Disabled) -# 1 - (Enabled) - -AllowTwoSide.WhoList = 0 - -# -# AllowTwoSide.AddFriend -# Description: Allow adding friends from other faction the friends list. -# Default: 0 - (Disabled) -# 1 - (Enabled) - -AllowTwoSide.AddFriend = 0 - -# # AllowTwoSide.Trade # Description: Allow trading between factions. # Default: 0 - (Disabled) @@ -1508,15 +1469,6 @@ ChatFlood.MuteTime = 10 Channel.RestrictedLfg = 1 # -# Channel.SilentlyGMJoin -# Description: Silently join GM characters to channels. If set to 1, channel kick and ban -# commands issued by a GM will not be broadcasted. -# Default: 0 - (Disabled, Join with announcement) -# 1 - (Enabled, Join without announcement) - -Channel.SilentlyGMJoin = 0 - -# # ChatLevelReq.Channel # Description: Level requirement for characters to be able to write in chat channels. # Default: 1 @@ -1620,14 +1572,6 @@ GM.InGMList.Level = 3 GM.InWhoList.Level = 3 # -# GM.LogTrade -# Description: Include GM trade and trade slot enchanting operations in GM log. -# Default: 1 - (Enabled) -# 0 - (Disabled) - -GM.LogTrade = 1 - -# # GM.StartLevel # Description: GM character starting level. # Default: 1 @@ -1643,14 +1587,6 @@ GM.StartLevel = 1 GM.AllowInvite = 0 # -# GM.AllowFriend -# Description: Allow players to add GM characters to their friends list. -# Default: 0 - (Disabled) -# 1 - (Enabled) - -GM.AllowFriend = 0 - -# # GM.LowerSecurity # Description: Allow lower security levels to use commands on higher security level # characters. |