Quote:
Originally Posted by wtbmacestun
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));
}