Contents:
A) Potion-buying fix, to make sure bot buys highest level potion available.
B) Options to choose not to buy potions under certain circumstances. (bot level, difficulty, etc)
C) (coming) Mod to make bot go to another act to buy potions (for higher level pots)
D) (coming) Create Juvs (full) if needed.
E) (coming) Potion-Usage Delays
Want any other potion-mods? Say it!
A) Potion-Buying Fix
Issue: Checks each item 1 at a time, comparing it for the potions (starting from super). This is bad because it can return true if any potion is found, which may not be the best potion available. Switching the for loops makes it check every item for super, then every item for greater and so down the list.
ntTown.ntl
at the top, add:
/////////////////////////////////////////////////////////////////////////
//Potions
var NTT_maxPotionLevel = 5;
var NTT_minPotionLevel = 1;
//1: Minor, 2: Lesser, 3: Normal, 4: Greater, 5: Super
/////////////////////////////////////////////////////////////////////////then,
find: function NTT_GetPotionAtNPCInt(type, npc)
Replace the function with this:
function NTT_GetPotionAtNPCInt(type, npc)
{
var _items;
if(!type)
return null;
if(type == "hp" || type == "mp")
{
_items = npc.GetItems();
if(_items)
{
var n;
for(n = NTT_maxPotionLevel ; n >= NTT_minPotionLevel ; n--)
{
for(var i = 0 ; i < _items.length ; i++)
{
if(_items[i].code == (type+n) )
return _items[i];
}
}
}
}
else
{
if(type == "rv")
return null;
_items = npc.GetItems(type);
if(_items && _items.length > 0)
return _items[0];
}
return null;
}