Feature Auto recharge ammo

xydius

Just an otland wanderer
Joined
Feb 25, 2016
Messages
43
Reaction score
30
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
 

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,772
Reaction score
207
Location
Chile, Santiago
If I am a kngiht, and I loot ammunition from corpses, they will be auto equiped xD
 
OP
Joe Rod

Joe Rod

JoeRod #1189
Joined
Mar 16, 2011
Messages
484
Reaction score
112
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
 

LightTenshimaru

LightTenshimaru
Joined
Mar 15, 2014
Messages
29
Reaction score
1
Works like a charm, thanks for the awesome script.
There's a way to make Spears and T. Stars rechargeable too?

Thanks...
 

Manigold

Member
Joined
Nov 2, 2017
Messages
56
Reaction score
6
Bump , is possible to make it work with distance weapons too?
 

Manigold

Member
Joined
Nov 2, 2017
Messages
56
Reaction score
6
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?
 

Thorn

Excellent OT User
Joined
Sep 24, 2012
Messages
2,174
Reaction score
844
Location
Chile
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:
Top