• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Feature Auto recharge ammo

This should have a condition that works only for paladins.
what for? i mean i dont think a knight would use a bow and arrows, also that restriction can be made on movements onequip so only pallys use bows and xbows
 
Code:
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;
       }   
      
   }            
}
solved two bugs:
  • It was not deep searching
  • It was not removing items from store inbox
Thanks to @StreamSide for report it and @Mkalo for answer me a doubt

@cbrm @Cornex @Red or another mod
edit main post plz. Thanks in advance
 
Works like a charm, thanks for the awesome script.
There's a way to make Spears and T. Stars rechargeable too?

Thanks...
 
Bump , is possible to make it work with distance weapons too?
 
Is working correctly with items that use removecount but not with those that use breakchance(spears, assassin stars, etc), sometimes it works but not always .Does anyone know how to fix it?
 
Heey, i have a problem with this, i have spears on my backpack, and im using arrows, but from time to time, very often actually, it starts using the spears, but i dont want it, because im using arrows, i just want this to refill my arrows, not to change the weapon im using :S any solution??

forget it, my bad, it was making conflict with some bot tool D:
 
Last edited:
Back
Top