From 17061cb9e52d409f70dbe063b73cae9cd02c7db3 Mon Sep 17 00:00:00 2001 From: Trista Date: Fri, 8 Mar 2013 04:45:15 +0200 Subject: Scripts/Icecrown: Add script* support for Borrowed Technology/Volatility quests * There are heavy core problems that make it not fully functional for now. 1) Enter vehicle of 31578 is being overriding the vehicle aura of the accessory so it kicks it out. (both get applied to 1, but instead decoy should be to 0). 2) Even if mentioned above get fixed the accessory is supposed to implicitly hit another passenger with explosion and no seat flags for it even unknown. 3) Armored Decoy doesn't keep emote from freeze mechanic when enter vehicle connected with a not supported flag. 4) Vehicle speed seems too fast (there is some general vehicle not correct speed problem with spline being involved). Connected with: #5757 --- src/server/scripts/Northrend/zone_icecrown.cpp | 88 ++++++++++++++++++++++++++ src/server/scripts/Spells/spell_quest.cpp | 81 ++++++++++++++++++++++++ 2 files changed, 169 insertions(+) (limited to 'src') diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index d5641b0fcc7..457eaccec8c 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -32,6 +32,7 @@ EndContentData */ #include "ScriptedGossip.h" #include "SpellAuras.h" #include "Player.h" +#include "TemporarySummon.h" /*###### ## npc_arete @@ -874,6 +875,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 +970,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(); } -- cgit v1.2.3 From c41b53605c22d07d2127558a2137fe7f4212588a Mon Sep 17 00:00:00 2001 From: Trista Date: Fri, 8 Mar 2013 04:54:50 +0200 Subject: Core/Vehicles: Give description to unknown seat flag * There are 28 vehicles using for what is stated in the description - it handles keeping specific emote states (animations) for passengers entering vehicles, I'm not 100% sure if is connected with the aura states that apply them. There are videos for every single known creature that is using it. 31583 - is clearest example since has only this flag as unknown on seat 0. Putting it here only to give direction to where researching should be made if someone dig into it more or can implement support for it. --- src/server/game/DataStores/DBCEnums.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 922d29b0f50..141c1060af3 100644 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -406,7 +406,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, -- cgit v1.2.3 From b4542c65048344019007a666a2bd35f9453d5664 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Fri, 8 Mar 2013 06:20:38 +0100 Subject: Core: Fix non pch build --- src/server/scripts/Northrend/zone_icecrown.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index 457eaccec8c..70b500166c9 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -33,6 +33,7 @@ EndContentData */ #include "SpellAuras.h" #include "Player.h" #include "TemporarySummon.h" +#include "CombatAI.h" /*###### ## npc_arete -- cgit v1.2.3 From 377cfdb5602cec4ce13d9d50937836aa7e03c446 Mon Sep 17 00:00:00 2001 From: Spp Date: Fri, 8 Mar 2013 13:15:25 +0100 Subject: Core/RBAC: Fix multiple permissions and remove multiple config options that are currently implementes by RBAC - Remove config options: CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT, CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL, CONFIG_GM_LOG_TRADE, CONFIG_ALLOW_TWO_SIDE_ACCOUNTS, CONFIG_ALLOW_TWO_SIDE_WHO_LIST, CONFIG_ALLOW_GM_FRIEND, CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND, CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL - Fix RBAC_PERM_SKIP_CHECK_CHAT_SPAM (Was checking spam for those that had the permission) - Only check RBAC_PERM_TWO_SIDE_INTERACTION_CHAT for sender of whispers (Restores GM being able to whisper players) - Only check RBAC_PERM_TWO_SIDE_INTERACTION_MAIL for sender - Fix .ticket assign , with last RBAC change it was changed by mistake from Player to Account --- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 49 ++++++++--------- src/server/game/Chat/Channels/Channel.cpp | 26 ++++----- src/server/game/Entities/Player/Player.cpp | 4 +- src/server/game/Entities/Player/SocialMgr.cpp | 17 ++---- src/server/game/Guilds/Guild.cpp | 5 +- src/server/game/Handlers/AuctionHouseHandler.cpp | 4 +- src/server/game/Handlers/CharacterHandler.cpp | 6 +- src/server/game/Handlers/ChatHandler.cpp | 16 ++---- src/server/game/Handlers/MailHandler.cpp | 12 +--- src/server/game/Handlers/MiscHandler.cpp | 8 +-- src/server/game/Handlers/TradeHandler.cpp | 6 +- src/server/game/Spells/SpellEffects.cpp | 6 +- src/server/game/World/World.cpp | 10 +--- src/server/game/World/World.h | 8 --- src/server/scripts/Commands/cs_ticket.cpp | 5 +- .../Northrend/Nexus/EyeOfEternity/boss_malygos.cpp | 6 +- src/server/worldserver/worldserver.conf.dist | 64 ---------------------- 17 files changed, 72 insertions(+), 180 deletions(-) (limited to 'src') diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 586a42c9f7e..9883a7231b3 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/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9b447be81f7..7447868d763 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -19817,7 +19817,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); @@ -20273,7 +20273,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::Whisper(const std::string& text, uint32 language, uint64 receiver) diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp index 7a2b36e23bf..6f5927492bf 100644 --- a/src/server/game/Entities/Player/SocialMgr.cpp +++ b/src/server/game/Entities/Player/SocialMgr.cpp @@ -232,8 +232,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)) @@ -299,6 +298,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()); @@ -308,20 +308,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 a1ab1b22b08..eabe4589c33 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -983,8 +983,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)", @@ -1732,7 +1731,7 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount) std::string aux = ByteArrayToHexStr(reinterpret_cast(&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: %u) to guild bank (Guild ID %u)", diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 22070d4c2c2..47ad7ffa568 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -245,7 +245,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()); @@ -291,7 +291,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 eb9db1439c6..34352706005 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -492,7 +492,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(); @@ -516,7 +516,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); @@ -1909,7 +1909,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 efb3a3b6d7c..9f942024851 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -129,8 +129,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) lang = LANG_UNIVERSAL; else { - // send in universal language in two side iteration allowed mode - if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT)) + Unit::AuraEffectList const& ModLangAuras = sender->GetAuraEffectsByType(SPELL_AURA_MOD_LANGUAGE); + if (!ModLangAuras.empty()) + lang = ModLangAuras.front()->GetMiscValue(); + else if (HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHAT)) lang = LANG_UNIVERSAL; else { @@ -153,11 +155,6 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) break; } } - - // but overwrite it by SPELL_AURA_MOD_LANGUAGE auras (only single case used) - Unit::AuraEffectList const& ModLangAuras = sender->GetAuraEffectsByType(SPELL_AURA_MOD_LANGUAGE); - if (!ModLangAuras.empty()) - lang = ModLangAuras.front()->GetMiscValue(); } if (!sender->CanSpeak()) @@ -281,10 +278,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 f3201401c8d..ac3471471a2 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -117,7 +117,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) { @@ -125,7 +124,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 { @@ -152,7 +150,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.. @@ -177,10 +174,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; @@ -257,7 +251,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) @@ -466,7 +460,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 3cd937216b8..475d3474391 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 @@ -573,14 +572,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 7fbb68b70f8..8155dacf1d8 100644 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -152,7 +152,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(), @@ -170,7 +170,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(), @@ -473,7 +473,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 2aa8b6daed8..11b5b9138ad 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2763,7 +2763,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(), @@ -2828,7 +2828,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(), @@ -2962,7 +2962,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 12aa8c9587b..21bac606941 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -654,16 +654,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); @@ -857,7 +852,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]) { @@ -871,7 +865,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); @@ -990,8 +983,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); @@ -3123,6 +3114,7 @@ CharacterNameData const* World::GetCharacterNameData(uint32 guid) const 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 bb87be89a61..e2c0e54344c 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -90,25 +90,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, @@ -118,7 +111,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..1a4579b1bae 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -359,8 +359,8 @@ public: _summonDeaths = 0; _preparingPulsesChecker = 0; - _arcaneOverloadGUID = NULL; - _lastHitByArcaneBarrageGUID = NULL; + _arcaneOverloadGUID = 0; + _lastHitByArcaneBarrageGUID = 0; memset(_surgeTargetGUID, 0, sizeof(_surgeTargetGUID)); _killSpamFilter = false; @@ -2054,7 +2054,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/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 612793649b2..0802aca43ce 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -1200,13 +1200,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. @@ -1215,14 +1208,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. @@ -1255,30 +1240,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. @@ -1533,15 +1494,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. @@ -1645,14 +1597,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. @@ -1668,14 +1612,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 -- cgit v1.2.3 From 2dbe3d6cfe2d174b5edf9fdb6720fee21c7009d2 Mon Sep 17 00:00:00 2001 From: Trista Date: Fri, 8 Mar 2013 19:17:27 +0200 Subject: Scripts/Eye of Eternity: Fix not being able to press release button on death during phase III --- .../scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp | 11 ++++------- .../Nexus/EyeOfEternity/instance_eye_of_eternity.cpp | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 1a4579b1bae..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" 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) -- cgit v1.2.3