Jump to content

[patch in dev 3.0] Spell Effect 155


Guest terranz

Recommended Posts

That spelleffect used in spell http://wowhead.com/?spell=46917

what works now:

equip 2h+2h

2h+shield

2h+1h

doesn't work:

can equip all 2h except staff

ps: i know, this is only hack =\\ if anyone know how to do this in a better way, plz post it =)

diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 8456e39..825a304 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -715,8 +715,10 @@ bool Player::Create( uint32 guidlow, std::string name, uint8 race, uint8 class_,

    for (PlayerCreateInfoItems::const_iterator item_id_itr = info->item.begin(); item_id_itr!=info->item.end(); ++item_id_itr++)
        StoreNewItemInBestSlot(item_id_itr->item_id, item_id_itr->item_amount);
-
-    // bags and main-hand weapon must equipped at this moment
+    
+    effect155 = false;
+    
+    // bags and main-hand weapon must equipped at this moment
    // now second pass for not equipped (offhand weapon/shield if it attempt equipped before main-hand weapon)
    // or ammo not equipped in special bag
    for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
@@ -8007,6 +8009,9 @@ uint8 Player::FindEquipSlot( ItemPrototype const* proto, uint32 slot, bool swap
            // (this will be replace mainhand weapon at auto equip instead unwonted "you don't known dual wielding" ...
            if(CanDualWield())
                slots[1] = EQUIPMENT_SLOT_OFFHAND;
+            if (effect155)
+                slots[1] = EQUIPMENT_SLOT_OFFHAND;
+
        };break;
        case INVTYPE_SHIELD:
            slots[0] = EQUIPMENT_SLOT_OFFHAND;
@@ -8016,6 +8021,8 @@ uint8 Player::FindEquipSlot( ItemPrototype const* proto, uint32 slot, bool swap
            break;
        case INVTYPE_2HWEAPON:
            slots[0] = EQUIPMENT_SLOT_MAINHAND;
+            if (effect155)
+                slots[1] = EQUIPMENT_SLOT_OFFHAND;
            break;
        case INVTYPE_TABARD:
            slots[0] = EQUIPMENT_SLOT_TABARD;
@@ -9784,7 +9791,8 @@ uint8 Player::CanEquipItem( uint8 slot, uint16 &dest, Item *pItem, bool swap, bo
                if(mainItem)
                {
                    if(mainItem->GetProto()->InventoryType == INVTYPE_2HWEAPON)
-                        return EQUIP_ERR_CANT_EQUIP_WITH_TWOHANDED;
+                        if (!effect155)//can eq 2h wep on one hand
+                            return EQUIP_ERR_CANT_EQUIP_WITH_TWOHANDED;
                }
            }

@@ -9792,8 +9800,9 @@ uint8 Player::CanEquipItem( uint8 slot, uint16 &dest, Item *pItem, bool swap, bo
            if( type == INVTYPE_2HWEAPON )
            {
                if(eslot != EQUIPMENT_SLOT_MAINHAND)
-                    return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
-
+                    if (!effect155)//can eq 2h wep on one hand
+                        return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
+                if (!effect155) {
                // offhand item must can be stored in inventory for offhand item and it also must be unequipped
                Item *offItem = GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND );
                ItemPosCountVec off_dest;
@@ -9801,6 +9810,7 @@ uint8 Player::CanEquipItem( uint8 slot, uint16 &dest, Item *pItem, bool swap, bo
                    CanUnequipItem(uint16(INVENTORY_SLOT_BAG_0) << 8 | EQUIPMENT_SLOT_OFFHAND,false) !=  EQUIP_ERR_OK ||
                    CanStoreItem( NULL_BAG, NULL_SLOT, off_dest, offItem, false ) !=  EQUIP_ERR_OK ) )
                    return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_INVENTORY_FULL;
+                }
            }
            dest = ((INVENTORY_SLOT_BAG_0 << 8) | eslot);
            return EQUIP_ERR_OK;
@@ -18172,7 +18182,7 @@ void Player::AutoUnequipOffhandIfNeed()

    Item *mainItem = GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND );

-    if(!mainItem || mainItem->GetProto()->InventoryType != INVTYPE_2HWEAPON)
+    if(!mainItem || mainItem->GetProto()->InventoryType != INVTYPE_2HWEAPON || effect155)
        return;

    ItemPosCountVec off_dest;
diff --git a/src/game/Player.h b/src/game/Player.h
index b302d64..b558081 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -947,7 +947,7 @@ class MANGOS_DLL_SPEC Player : public Unit
    public:
        explicit Player (WorldSession *session);
        ~Player ( );
-
+        bool effect155;
        void CleanupsBeforeDelete();

        static UpdateMask updateVisualBits;
@@ -2303,6 +2303,7 @@ class MANGOS_DLL_SPEC Player : public Unit
        bool m_canDualWield;
        uint8 m_swingErrorMsg;
        float m_ammoDPS;
+        
        ////////////////////Rest System/////////////////////
        int time_inn_enter;
        uint32 inn_pos_mapid;
diff --git a/src/game/Spell.h b/src/game/Spell.h
index 60c8fc8..e65db44 100644
--- a/src/game/Spell.h
+++ b/src/game/Spell.h
@@ -316,6 +316,7 @@ class Spell
        void EffectKillCredit(uint32 i);
        void EffectQuestFail(uint32 i);
        void EffectActivateRune(uint32 i);
+        void Effect155(uint32 i);

        Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID = 0, Spell** triggeringContainer = NULL );
        ~Spell();
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index b15ffec..59c921b 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -212,7 +212,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
    &Spell::EffectNULL,                                     //152 SPELL_EFFECT_152                      summon Refer-a-Friend
    &Spell::EffectNULL,                                     //153 SPELL_EFFECT_CREATE_PET               misc value is creature entry
    &Spell::EffectNULL,                                     //154 unused
-    &Spell::EffectNULL,                                     //155 Allows you to equip two-handed axes, maces and swords in one hand, but you attack $49152s1% slower than normal.
+    &Spell::Effect155,                                      //155 Allows you to equip two-handed axes, maces and swords in one hand, but you attack $49152s1% slower than normal.
    &Spell::EffectNULL,                                     //156 Add Socket
    &Spell::EffectNULL,                                     //157 create/learn random item/spell for profession
    &Spell::EffectMilling,                                  //158 milling
@@ -6340,3 +6340,10 @@ void Spell::EffectActivateRune(uint32 i)
        }
    }
}
+
+void Spell::Effect155(uint32 i)
+{
+    Player *plr = (Player*)m_caster;
+    sLog.outDebug("Spell Effect 155 started...");
+    plr->effect155 = true;
+}

http://filebeam.com/28b181732d6c740676147a0861b023f0

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use