Dankoo
Active Member
- Joined
- Sep 4, 2010
- Messages
- 1,007
- Reaction score
- 27
There's an script from Jano, and I'm trying to optimize an function of his script, wich is:
http://otland.net/f82/autoloot-91385/
When you kill a monster, it records monster name and position.
If monster corpse contains monster name (like, creature was a demon, his corpse is a slain demon), then it's assigned as creature corpse, for the rest of the script
But there are some monsters, like bosses, who corpses does not have it's name, like Demodras (dead dragon), Morgaroth (demon dust) and so on.
How could I add some exceptions to this script, like "if creaturename = demodras then target = ID_DEAD_DRAGON"
http://otland.net/f82/autoloot-91385/
LUA:
local corpse = -1
for _, item in ipairs(items) do
local name = getItemName(item.uid):lower()
if name:find(target:lower()) then
corpse = item.uid
break
end
end
When you kill a monster, it records monster name and position.
If monster corpse contains monster name (like, creature was a demon, his corpse is a slain demon), then it's assigned as creature corpse, for the rest of the script
But there are some monsters, like bosses, who corpses does not have it's name, like Demodras (dead dragon), Morgaroth (demon dust) and so on.
How could I add some exceptions to this script, like "if creaturename = demodras then target = ID_DEAD_DRAGON"
Last edited: