EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=587)
-   -   Hands not magic with gloves (https://www.eqemulator.org/forums/showthread.php?t=36804)

wtbmacestun 05-01-2013 11:52 PM

Hands not magic with gloves
 
Boots are making kick magic but gloves will not make hands magic. Anyone know how to fix this?

lerxst2112 05-02-2013 12:01 AM

Change Client::Attack to pass what's in the gloves slot as the weapon when there is no primary or secondary weapon.

wtbmacestun 05-02-2013 09:14 AM

the code for boots making kick magic is in Mob::getweapondamage. Should i still put it in client::attack?

wtbmacestun 05-02-2013 10:22 AM

I tried adding this in at line 783 but wont compile. Ive tried multiple different things but I cant get it work right.

Code:

else if(InventorySlot(12)->(database.GetItem()->Magic))
                  {
                  dmg = 1;
                  }

Whenever I compile it I get.

Code:

2>..\..\zone\attack.cpp(783): error C2059: syntax error : '('
2>..\..\zone\attack.cpp(784): error C2143: syntax error : missing ';' before '{'
2>..\..\zone\attack.cpp(785): error C2227: left of '->dmg' must point to class/struct/union/generic type
2>          type is 'InventorySlot'
2>..\..\zone\attack.cpp(787): error C2181: illegal else without matching if
2>..\..\zone\attack.cpp(797): error C2227: left of '->Damage' must point to class/struct/union/generic type
2>          type is ''unknown-type''


I see that dmg should be pointing to something but I am not sure what it should be pointing to.

wtbmacestun 05-02-2013 12:01 PM

Correct me if I am wrong, but because Client::Attack is a bool that only says when you can attack... aka true or false.

wtbmacestun 05-02-2013 12:11 PM

I tried this at line 927 but i need some help with the code

Code:

                        else if(weapon_item == NULL && SLOT_HANDS() == ItemAttribMagic){
                                dmg = 1;

How do I say that my SLOT_HANDS = a magic item?

Edit:

I also tried

Code:

                        else if(weapon_item == NULL && SLOT_HANDS()->Magic){
                                dmg = 1;

and that didnt work.

lerxst2112 05-02-2013 06:02 PM

Quote:

Originally Posted by wtbmacestun (Post 220690)
the code for boots making kick magic is in Mob::getweapondamage. Should i still put it in client::attack?

The code for checking if a target requires magic to hit and if the weapon being used to try and hit it is magic is in Mob::GetWeaponDamage, but the code that passes that "weapon" into the function is elsewhere. In the case of kick and bash it is in Client::DoClassAttacks. I would look at that code, and the code for bash/slam, make sure you understand it, then try and add it for the hands slot if they have no weapon.

Here's an example of where it might work in Client::Attack. I didn't test it, and it might break other things. The new code is at the bottom, the rest is for context.
Code:

        /// Now figure out damage
        int damage = 0;
        uint8 mylevel = GetLevel() ? GetLevel() : 1;
        uint32 hate = 0;
        if (weapon) hate = weapon->GetItem()->Damage + weapon->GetItem()->ElemDmgAmt;
        int weapon_damage = GetWeaponDamage(other, weapon, &hate);

        // If no weapon and no damage, maybe it's a magic immune mob.  Check using the gloves to see if that helps.
        if(!weapon && weapon_damage < 1)
        {
                weapon_damage = GetWeaponDamage(other, GetInv().GetItem(SLOT_HANDS));
        }


wtbmacestun 05-02-2013 06:10 PM

ok thanks for the reply ill test it out

wtbmacestun 05-02-2013 06:25 PM

works with magic gloves and not non magic gloves.

Thank you very much sir!

Edit: I posted this fix on another website giving you the credit for fixing it lerxst2112


All times are GMT -4. The time now is 03:27 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.