From 2317af8dd3faac12b583978e14e47fd90ade4520 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 9 Sep 2012 03:59:34 +0200 Subject: Core/Spells: Convert Gift of the Naaru in spell script Closes #6545 --- src/server/game/Entities/Unit/Unit.cpp | 10 ------ src/server/scripts/Spells/spell_generic.cpp | 53 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 737d75cdf1c..52e282157b8 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11263,16 +11263,6 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod); } - // Gift of the Naaru - if (spellProto->SpellFamilyFlags[2] & 0x80000000 && spellProto->SpellIconID == 329) - { - int32 apBonus = int32(std::max(GetTotalAttackPowerValue(BASE_ATTACK), GetTotalAttackPowerValue(RANGED_ATTACK))); - if (apBonus > DoneAdvertisedBenefit) - DoneTotal += int32(apBonus * 0.22f); // 22% of AP per tick - else - DoneTotal += int32(DoneAdvertisedBenefit * 0.377f); // 37.7% of BH per tick - } - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { switch (spellProto->Effects[i].ApplyAuraName) diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index ed4148cd033..0a947afaa25 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -3250,6 +3250,58 @@ class spell_gen_bonked : public SpellScriptLoader } }; +class spell_gen_gift_of_naaru : public SpellScriptLoader +{ + public: + spell_gen_gift_of_naaru() : SpellScriptLoader("spell_gen_gift_of_naaru") { } + + class spell_gen_gift_of_naaru_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_gift_of_naaru_AuraScript); + + void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (!GetCaster()) + return; + + float heal = 0.0f; + switch (GetSpellInfo()->SpellFamilyName) + { + case SPELLFAMILY_MAGE: + case SPELLFAMILY_WARLOCK: + case SPELLFAMILY_PRIEST: + heal = 1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask())); + break; + case SPELLFAMILY_PALADIN: + case SPELLFAMILY_SHAMAN: + heal = std::max(1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask())), 1.1f * float(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK))); + break; + case SPELLFAMILY_WARRIOR: + case SPELLFAMILY_HUNTER: + case SPELLFAMILY_DEATHKNIGHT: + heal = 1.1f * float(std::max(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetCaster()->GetTotalAttackPowerValue(RANGED_ATTACK))); + break; + case SPELLFAMILY_GENERIC: + default: + break; + } + + int32 healTick = floor(heal / aurEff->GetTotalTicks()); + amount += int32(std::max(heal, 0.0f)); + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_gift_of_naaru_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_gift_of_naaru_AuraScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -3325,4 +3377,5 @@ void AddSC_generic_spell_scripts() new spell_gen_mount("spell_x53_touring_rocket", 0, 0, 0, SPELL_X53_TOURING_ROCKET_150, SPELL_X53_TOURING_ROCKET_280, SPELL_X53_TOURING_ROCKET_310); new spell_gen_upper_deck_create_foam_sword(); new spell_gen_bonked(); + new spell_gen_gift_of_naaru(); } -- cgit v1.2.3 From 637894da1ae8186eeb921f3b8f7ce959d4965eec Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 9 Sep 2012 04:19:17 +0200 Subject: Core/Spells: Fix typo (I need sleep) --- src/server/scripts/Spells/spell_generic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 0a947afaa25..d10d7725e2e 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -3287,7 +3287,7 @@ class spell_gen_gift_of_naaru : public SpellScriptLoader } int32 healTick = floor(heal / aurEff->GetTotalTicks()); - amount += int32(std::max(heal, 0.0f)); + amount += int32(std::max(healTick, 0)); } void Register() -- cgit v1.2.3 From 6677908382dde7fac1a6a6ea9793c2270ab95bc3 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 9 Sep 2012 07:44:17 -0500 Subject: Core/Achievements: Change ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE behavior Allow it to be used with value1 = 0 and value2 = 0 to only check if the target is a player. Fixes some startup errors. --- src/server/game/Achievements/AchievementMgr.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 037000133c4..d06d0849eff 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -128,12 +128,6 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) } return true; case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE: - if (!classRace.class_id && !classRace.race_id) - { - sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.", - criteria->ID, criteria->requiredType, dataType); - return false; - } if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.", -- cgit v1.2.3 From e3775502801ba36568795937aa324f6185d8fe3c Mon Sep 17 00:00:00 2001 From: oMadMano <> Date: Sun, 9 Sep 2012 16:24:06 +0200 Subject: Scripts/Karazhan: Fix Prince Malchezaar Infernal start timer Closes #5700 --- src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index d5add0f0bb7..f4195620dda 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -233,7 +233,7 @@ public: SWPainTimer = 20000; AmplifyDamageTimer = 5000; Cleave_Timer = 8000; - InfernalTimer = 45000; + InfernalTimer = 40000; InfernalCleanupTimer = 47000; AxesTargetSwitchTimer = urand(7500, 20000); SunderArmorTimer = urand(5000, 10000); -- cgit v1.2.3 From 53002dfe03012e5f725016da1ac882f9a80e55b6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 9 Sep 2012 17:52:27 +0200 Subject: Core/Spells: Set UNIT_FIELD_CHANNEL_OBJECT also for spells that don't have explicit target unit but use NEARBY selection, fixes #7246 --- src/server/game/Spells/Spell.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 4d095e0f951..cdf17b05040 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4278,6 +4278,10 @@ void Spell::SendChannelUpdate(uint32 time) void Spell::SendChannelStart(uint32 duration) { uint64 channelTarget = m_targets.GetObjectTargetGUID(); + if (!channelTarget && !m_spellInfo->NeedsExplicitUnitTarget()) + if (m_UniqueTargetInfo.size() + m_UniqueGOTargetInfo.size() == 1) // this is for TARGET_SELECT_CATEGORY_NEARBY + if (!m_UniqueTargetInfo.empty()) + channelTarget = !m_UniqueTargetInfo.empty() ? m_UniqueTargetInfo.front().targetGUID : m_UniqueGOTargetInfo.front().targetGUID; WorldPacket data(MSG_CHANNEL_START, (8+4+4)); data.append(m_caster->GetPackGUID()); -- cgit v1.2.3 From 97a92036d153e1c47f3f35fa7ec713fb9b50e699 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 9 Sep 2012 19:22:30 +0200 Subject: Core/Spells: Fixed typo in previous commit --- src/server/game/Spells/Spell.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index cdf17b05040..fea299cf163 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4280,8 +4280,7 @@ void Spell::SendChannelStart(uint32 duration) uint64 channelTarget = m_targets.GetObjectTargetGUID(); if (!channelTarget && !m_spellInfo->NeedsExplicitUnitTarget()) if (m_UniqueTargetInfo.size() + m_UniqueGOTargetInfo.size() == 1) // this is for TARGET_SELECT_CATEGORY_NEARBY - if (!m_UniqueTargetInfo.empty()) - channelTarget = !m_UniqueTargetInfo.empty() ? m_UniqueTargetInfo.front().targetGUID : m_UniqueGOTargetInfo.front().targetGUID; + channelTarget = !m_UniqueTargetInfo.empty() ? m_UniqueTargetInfo.front().targetGUID : m_UniqueGOTargetInfo.front().targetGUID; WorldPacket data(MSG_CHANNEL_START, (8+4+4)); data.append(m_caster->GetPackGUID()); -- cgit v1.2.3 From 83817afd996af9eedadc366037cc73c83caa8fd0 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 9 Sep 2012 19:56:00 +0200 Subject: Core/Vehicles: Improved vehicle passenger position calculation (still not complete) --- src/server/game/Entities/Transport/Transport.cpp | 10 +++---- src/server/game/Entities/Transport/Transport.h | 8 +++++- src/server/game/Entities/Unit/Unit.cpp | 18 ++++++------ src/server/game/Entities/Unit/Unit.h | 3 ++ src/server/game/Entities/Vehicle/Vehicle.cpp | 32 ++++++++++++++++++---- src/server/game/Entities/Vehicle/Vehicle.h | 8 +++++- src/server/game/Entities/Vehicle/VehicleDefines.h | 10 +++++++ src/server/game/Movement/Spline/MoveSplineInit.cpp | 12 ++------ 8 files changed, 68 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 88d3108dbe2..558fdd72a95 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -704,17 +704,15 @@ void Transport::UpdateNPCPositions() } } -//! This method transforms supplied transport offsets into global coordinates void Transport::CalculatePassengerPosition(float& x, float& y, float& z, float& o) { float inx = x, iny = y, inz = z, ino = o; o = GetOrientation() + ino; - x = GetPositionX() + (inx * cos(GetOrientation()) + iny * sin(GetOrientation() + M_PI)); - y = GetPositionY() + (iny * cos(GetOrientation()) + inx * sin(GetOrientation())); + x = GetPositionX() + inx * cos(GetOrientation()) - iny * sin(GetOrientation()); + y = GetPositionY() + iny * cos(GetOrientation()) + inx * sin(GetOrientation()); z = GetPositionZ() + inz; } -//! This method transforms supplied global coordinates into local offsets void Transport::CalculatePassengerOffset(float& x, float& y, float& z, float& o) { o -= GetOrientation(); @@ -722,6 +720,6 @@ void Transport::CalculatePassengerOffset(float& x, float& y, float& z, float& o) y -= GetPositionY(); // y = searchedY * cos(o) + searchedX * sin(o) x -= GetPositionX(); // x = searchedX * cos(o) + searchedY * sin(o + pi) float inx = x, iny = y; - y = (iny - inx * tan(GetOrientation())) / (cos(GetOrientation()) - sin(GetOrientation() + M_PI) * tan(GetOrientation())); - x = (inx - iny * sin(GetOrientation() + M_PI) / cos(GetOrientation())) / (cos(GetOrientation()) - tan(GetOrientation()) * sin(GetOrientation() + M_PI)); + y = (iny - inx * tan(GetOrientation())) / (cos(GetOrientation()) + sin(GetOrientation()) * tan(GetOrientation())); + x = (inx + iny * tan(GetOrientation())) / (cos(GetOrientation()) + sin(GetOrientation()) * tan(GetOrientation())); } diff --git a/src/server/game/Entities/Transport/Transport.h b/src/server/game/Entities/Transport/Transport.h index 4b0c42c9071..8fd12b50695 100755 --- a/src/server/game/Entities/Transport/Transport.h +++ b/src/server/game/Entities/Transport/Transport.h @@ -20,12 +20,13 @@ #define TRANSPORTS_H #include "GameObject.h" +#include "VehicleDefines.h" #include #include #include -class Transport : public GameObject +class Transport : public GameObject, public TransportBase { public: Transport(uint32 period, uint32 script); @@ -47,8 +48,13 @@ class Transport : public GameObject uint32 AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, float z, float o, uint32 anim=0); void UpdatePosition(MovementInfo* mi); void UpdateNPCPositions(); + + /// This method transforms supplied transport offsets into global coordinates void CalculatePassengerPosition(float& x, float& y, float& z, float& o); + + /// This method transforms supplied global coordinates into local offsets void CalculatePassengerOffset(float& x, float& y, float& z, float& o); + void BuildStartMovePacket(Map const* targetMap); void BuildStopMovePacket(Map const* targetMap); uint32 GetScriptId() const { return ScriptId; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 52e282157b8..ffe45c63df5 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -406,15 +406,8 @@ void Unit::UpdateSplineMovement(uint32 t_diff) pos.m_positionZ = loc.z; pos.m_orientation = loc.orientation; - if (Unit* vehicle = GetVehicleBase()) - { - loc.x += vehicle->GetPositionX(); - loc.y += vehicle->GetPositionY(); - loc.z += vehicle->GetPositionZMinusOffset(); - loc.orientation = vehicle->GetOrientation(); - } - else if (Transport* trans = GetTransport()) - trans->CalculatePassengerPosition(loc.x, loc.y, loc.z, loc.orientation); + if (TransportBase* transport = GetDirectTransport()) + transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, loc.orientation); } UpdatePosition(loc.x, loc.y, loc.z, loc.orientation); @@ -16289,6 +16282,13 @@ uint64 Unit::GetTransGUID() const return 0; } +TransportBase* Unit::GetDirectTransport() const +{ + if (Vehicle* veh = GetVehicle()) + return veh; + return GetTransport(); +} + bool Unit::IsInPartyWith(Unit const* unit) const { if (this == unit) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 415d63a0c84..d0edd55040d 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -339,6 +339,7 @@ class UnitAI; class Totem; class Transport; class Vehicle; +class TransportBase; typedef std::list UnitList; typedef std::list< std::pair > DispelChargesList; @@ -2169,6 +2170,8 @@ class Unit : public WorldObject uint32 GetTransTime() const { return m_movementInfo.t_time; } int8 GetTransSeat() const { return m_movementInfo.t_seat; } uint64 GetTransGUID() const; + /// Returns the transport this unit is on directly (if on vehicle and transport, return vehicle) + TransportBase* GetDirectTransport() const; bool m_ControlledByPlayer; diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index 710821f2f24..f8eacf8f7c9 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -441,19 +441,19 @@ void Vehicle::RelocatePassengers(float x, float y, float z, float ang) { ASSERT(_me->GetMap()); - // not sure that absolute position calculation is correct, it must depend on vehicle orientation and pitch angle + // not sure that absolute position calculation is correct, it must depend on vehicle pitch angle for (SeatMap::const_iterator itr = Seats.begin(); itr != Seats.end(); ++itr) + { if (Unit* passenger = ObjectAccessor::GetUnit(*GetBase(), itr->second.Passenger)) { ASSERT(passenger->IsInWorld()); - float px = x + passenger->m_movementInfo.t_pos.m_positionX; - float py = y + passenger->m_movementInfo.t_pos.m_positionY; - float pz = z + passenger->m_movementInfo.t_pos.m_positionZ; - float po = ang + passenger->m_movementInfo.t_pos.m_orientation; - + float px, py, pz, po; + passenger->m_movementInfo.t_pos.GetPosition(px, py, pz, po); + CalculatePassengerPosition(px, py, pz, po); passenger->UpdatePosition(px, py, pz, po); } + } } void Vehicle::Dismiss() @@ -512,3 +512,23 @@ uint8 Vehicle::GetAvailableSeatCount() const return ret; } + +void Vehicle::CalculatePassengerPosition(float& x, float& y, float& z, float& o) +{ + float inx = x, iny = y, inz = z, ino = o; + o = GetBase()->GetOrientation() + ino; + x = GetBase()->GetPositionX() + inx * cos(GetBase()->GetOrientation()) - iny * sin(GetBase()->GetOrientation()); + y = GetBase()->GetPositionY() + iny * cos(GetBase()->GetOrientation()) + inx * sin(GetBase()->GetOrientation()); + z = GetBase()->GetPositionZ() + inz; +} + +void Vehicle::CalculatePassengerOffset(float& x, float& y, float& z, float& o) +{ + o -= GetBase()->GetOrientation(); + z -= GetBase()->GetPositionZ(); + y -= GetBase()->GetPositionY(); // y = searchedY * cos(o) + searchedX * sin(o) + x -= GetBase()->GetPositionX(); // x = searchedX * cos(o) + searchedY * sin(o + pi) + float inx = x, iny = y; + y = (iny - inx * tan(GetBase()->GetOrientation())) / (cos(GetBase()->GetOrientation()) + sin(GetBase()->GetOrientation()) * tan(GetBase()->GetOrientation())); + x = (inx + iny * tan(GetBase()->GetOrientation())) / (cos(GetBase()->GetOrientation()) + sin(GetBase()->GetOrientation()) * tan(GetBase()->GetOrientation())); +} diff --git a/src/server/game/Entities/Vehicle/Vehicle.h b/src/server/game/Entities/Vehicle/Vehicle.h index 95fc2364256..e5d39e5339f 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.h +++ b/src/server/game/Entities/Vehicle/Vehicle.h @@ -27,7 +27,7 @@ class Unit; typedef std::set GuidSet; -class Vehicle +class Vehicle : public TransportBase { public: explicit Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry); @@ -66,6 +66,12 @@ class Vehicle SeatMap::iterator GetSeatIteratorForPassenger(Unit* passenger); void InitMovementInfoForBase(); + /// This method transforms supplied transport offsets into global coordinates + void CalculatePassengerPosition(float& x, float& y, float& z, float& o); + + /// This method transforms supplied global coordinates into local offsets + void CalculatePassengerOffset(float& x, float& y, float& z, float& o); + Unit* _me; VehicleEntry const* _vehicleInfo; GuidSet vehiclePlayers; diff --git a/src/server/game/Entities/Vehicle/VehicleDefines.h b/src/server/game/Entities/Vehicle/VehicleDefines.h index df34a61d444..423497660b4 100644 --- a/src/server/game/Entities/Vehicle/VehicleDefines.h +++ b/src/server/game/Entities/Vehicle/VehicleDefines.h @@ -75,4 +75,14 @@ typedef std::vector VehicleAccessoryList; typedef std::map VehicleAccessoryContainer; typedef std::map SeatMap; +class TransportBase +{ + public: + /// This method transforms supplied transport offsets into global coordinates + virtual void CalculatePassengerPosition(float& x, float& y, float& z, float& o) = 0; + + /// This method transforms supplied global coordinates into local offsets + virtual void CalculatePassengerOffset(float& x, float& y, float& z, float& o) = 0; +}; + #endif diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index 76215ec83c1..fec629c3329 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -160,17 +160,9 @@ namespace Movement { if (_transformForTransport) { - if (Unit* vehicle = _owner.GetVehicleBase()) - { - input.x -= vehicle->GetPositionX(); - input.y -= vehicle->GetPositionY(); - input.z -= vehicle->GetPositionZMinusOffset(); - } - else if (Transport* transport = _owner.GetTransport()) - { - float unused = 0.0f; + float unused = 0.0f; + if (TransportBase* transport = _owner.GetDirectTransport()) transport->CalculatePassengerOffset(input.x, input.y, input.z, unused); - } } return input; -- cgit v1.2.3 From 7a8652c06f71e430c3cff9667edcbb0335be7cc0 Mon Sep 17 00:00:00 2001 From: "e@cacaw.net" Date: Sun, 9 Sep 2012 23:41:36 +0100 Subject: Core/Players: Do not allow polearm to be equipped in the offhand. Signed-off-by: Nay Closes #7709 --- src/server/game/Entities/Player/Player.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index dc3fe6b0f0b..3ad3eb0ddd6 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -11531,7 +11531,11 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool if (eslot == EQUIPMENT_SLOT_OFFHAND) { - if (type == INVTYPE_WEAPON || type == INVTYPE_WEAPONOFFHAND) + // Do not allow polearm to be equipped in the offhand (rare case for the only 1h polearm 41750) + if (pProto->SubClass == ITEM_SUBCLASS_WEAPON_POLEARM) + return EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT; + + else if (type == INVTYPE_WEAPON || type == INVTYPE_WEAPONOFFHAND) { if (!CanDualWield()) return EQUIP_ERR_CANT_DUAL_WIELD; -- cgit v1.2.3