bool WeaponMelee::useWeapon(Player* player, Item* item, Creature* target) const { int32_t damageModifier = playerWeaponCheck(player, target); if (damageModifier == 0) { return false; } return internalUseWeapon(player, item, target, damageModifier); }
bool Weapon::useWeapon(Player* player, Item* item, Creature* target) const { int32_t damageModifier = playerWeaponCheck(player, target, item->getShootRange()); if (damageModifier == 0) { return false; } internalUseWeapon(player, item, target, damageModifier); return true; }
bool WeaponMelee::useWeapon(Player* player, Item* item, Creature* target) const { int32_t damageModifier = playerWeaponCheck(player, target); if(damageModifier == 0) return false; if(elementDamage != 0) { int32_t damage = getElementDamage(player, item); CombatParams eParams; eParams.combatType = elementType; eParams.isAggressive = true; eParams.useCharges = true; Combat::doCombatHealth(player, target, damage, damage, eParams); } return internalUseWeapon(player, item, target, damageModifier); }