Joe Rod
Discord: joerod1
Hi, with this modification your ammo slot will be refilled if you have enough ammo on your equipment.
go to weapon.cpp and find:
case WEAPONACTION_REMOVECOUNT:
before "Weapon::decrementItemCount(item);" paste this
now on player.h
after "friend class ProtocolGameBase;"
put this:
Tested on OTX, however it will work on TFS 1.X i guess
Next updates (only if i get enough feedback):
Enjoy it and report bugs
go to weapon.cpp and find:
case WEAPONACTION_REMOVECOUNT:
before "Weapon::decrementItemCount(item);" paste this
C++:
uint32_t count = item->getItemCount();
if (count - 1 == 0)
{
uint32_t playerCount = player->getItemTypeCount(item->getID(), -1);
playerCount--;
if (playerCount > 0)
{
int32_t removeCount = std::max<int32_t>(1, std::min<int32_t>(100, playerCount));
bool test = player->removeItemOfType(item->getID(), removeCount, -1, true);
if (test)
{
g_game.transformItem(item, item->getID(), removeCount);
std::ostringstream ss;
ss << "Your " << item->getPluralName() << " were charged.";
player->sendTextMessage(MESSAGE_STATUS_SMALL, ss.str());
break;
}
}
}
now on player.h
after "friend class ProtocolGameBase;"
put this:
C++:
friend class Weapon;
Tested on OTX, however it will work on TFS 1.X i guess
Next updates (only if i get enough feedback):
- Enable/Disable on config
Enjoy it and report bugs
Last edited by a moderator: