When I testes my code on the server and run rombot with the quests I had a lot of crap in my bag, so I thought about a function to clean up my bag.
Most of the crap were gear which I don't use. We had that topic before so I went for 5 minutes for want can be done.
If it quest reward you and it is HP and MP potion you can first decide if we have MP if not you take the HP potions and when you have MP than what you have more in total and take the opposite.
For gear you must first see if one can be worn if not random or get with the 1.
Than thinks get more complicate we must score the items on dmg if it is a weapon(which is easy) and score the stats.
I don't know if it is there a function which can parse the stats multi language but this why I would think it must be done e.g.
Code: Select all
if class = Mage then
if stat == magic attack then
score = score + 5 * value
elseif stat == intelligence then
score = score + 4.5 * value
score = score + addResultingMatScore(value)
elseif stat == stamina then
score = score + 3.7 * value
score = score + addResultingLPScore(value)
score = score + addResultingPDefScore(value)
elseif stat == LP then
score = score + 3.5 * value
elseif stat == all_attributes then
score = 11* value;
score = score + addResultingMatScore(value)
score = score + addResultingLPScore(value)
score = score + addResultingManaScore(value)
score = score + addResultingMDefScore(value)
score = score + addResultingPDefScore(value)
elseif stat == wisdom then
score = 1.5* value;
score = score + addResultingManaScore(value)
score = score + addResultingMDefScore(value)
elseif stat == mana then
score = 2* value;
else
-- score of 1 for everything else
score = value;
end
end
http://www.rom-welten.de/articles,id436 ... n_sie.html
With this I would also choose which item to wear and which to drop in the lesser levels.