Itutorial
Legendary OT User
- Joined
- Dec 23, 2014
- Messages
- 2,394
- Solutions
- 68
- Reaction score
- 1,065
This is make it so paladins do not stop attacking while using mana potions.
open player.cpp
find
replace with
REMOVE MISS TARGET
open weapons.cpp
replace whole function
with this
DONE
open player.cpp
find
Code:
if (weapon) {
if (!weapon->interruptSwing()) {
result = weapon->useWeapon(this, tool, attackedCreature);
} else if (!classicSpeed && !canDoAction()) {
delay = getNextActionTime();
} else {
result = weapon->useWeapon(this, tool, attackedCreature);
}
} else {
result = Weapon::useFist(this, attackedCreature);
}
replace with
Code:
if (weapon) {
result = weapon->useWeapon(this, tool, attackedCreature);
} else {
result = Weapon::useFist(this, attackedCreature);
}
REMOVE MISS TARGET
open weapons.cpp
replace whole function
Code:
bool WeaponDistance::useWeapon(Player* player, Item* item, Creature* target) const
with this
Code:
bool WeaponDistance::useWeapon(Player* player, Item* item, Creature* target) const
{
int32_t damageModifier;
const ItemType& it = Item::items[id];
if (it.weaponType == WEAPON_AMMO) {
Item* mainWeaponItem = player->getWeapon(true);
const Weapon* mainWeapon = g_weapons->getWeapon(mainWeaponItem);
if (mainWeapon) {
damageModifier = mainWeapon->playerWeaponCheck(player, target, mainWeaponItem->getShootRange());
} else {
damageModifier = playerWeaponCheck(player, target, mainWeaponItem->getShootRange());
}
} else {
damageModifier = playerWeaponCheck(player, target, item->getShootRange());
}
if (damageModifier == 0) {
return false;
}
Weapon::internalUseWeapon(player, item, destTile);
return true;
}
DONE