What I've always done in my looting code was simply placing loots firstQuote:
Can anyone helpme on developing a HasToLoot code? like a looting over attacking priority code
anyone pls?
IE: Following stages
if(!C.Looting)
goto Hunt;
if(PullItem(C) == null)
goto Hunt;
GroundItem Item = PullItem(C);
if(DistanceToItem(C, Item) < 1 || C.TryingItem)
{
//loot or move to item
//TryingItem = false;
goto END;
}
else if(DistanceToItem < MoveDist)
//move towards item
//TryingItem = true;
else if(C.TryingItem)
C.TryingItem = false;
Hunt:
{
if(!C.Hunting)
goto END;
Mob M = ClosestMonster(C);
if(M == null)
goto END;
if(C.InXp)
{
//Check if in fatal strike, if so attack mob and update coords
//else use xp speed settings to move towards/attack target
}
else
{
//check for distance in atk range/attack
//Check non xp speed settings for move/atk
//else move to/towards target
}
}
END:{
return true;}
Simple stuff.