At the moment I don't know how to make the monster run away, like the gigglers did in DM, but it's a start. Also could be the basis of a rust monster, remove an item and replace it with a rusted version (or otheriwse a "pile of rust").
place this definition in your monsters.lua
Code: Select all
cloneObject{
name="stealer_bird",
baseObject = "crowern",
attackPower = 15,
onDealDamage = function(self,champion,amount)
return stealer_script.stealItem(self,champion,amount)
end,
}add a script_entity called stealer_script and add this code:
Code: Select all
function stealItem(self,champ,amount)
if math.random(1,10) > 4 then
local w = 1
local slot_list = {}
for z = 1,8 do
local temp_item = champ:getItem(z)
if temp_item ~= nil then
slot_list[w] = z
w = w + 1
end
end
if #slot_list > 0 then
champ_slot = slot_list[math.random(1,#slot_list)]
-- hudPrint("Steal now, Steal now!")
local item = champ:getItem(champ_slot)
champ:removeItem(champ_slot)
self:addItem(item)
end
end
endORIGINAL SCRIPT
Code: Select all
function stealItem(self,champ,amount)
if math.random(1,10) > 4 then
hudPrint("Steal now, Steal now!")
local champ_slot = math.random(1,8)
local item = champ:getItem(champ_slot)
if item ~= nil then
champ:removeItem(champ_slot)
self:addItem(spawn(item.name))
end
end
end