local creature = Creature(...)
creature:setTarget(some_userdata)
local monster = Monster(...)
monster:addTarget(some_userdata, false)
local monster = Monster(...)
if monster:isFriend(some_userdata) then
monster:removeFriend(some_userdata)
end
I am looking for help with a script like in the subject. I would like the monster to attack other monsters. Simple and so difficult. Maybe some hints. Thank you for your help.
local creature = Creature(...)
creature:setTarget(some_userdata)
local monster = Monster(...)
monster:addTarget(some_userdata, false)
local monster = Monster(...)
if monster:isFriend(some_userdata) then
monster:removeFriend(some_userdata)
end
<event type="think" name="monsterdeath" event="script" value="monsterdeath.lua"/>
<script>
<event name="monsterdeath"/>
</script>
-- How many seconds shall monster stay alive?
seconds = 4
-- Do you want people to be able to loot monster
-- after its dead? 0 = NO, 1 = YES.
loot = 0
function onThink(cid)
addEvent(fuckmylife,1000*seconds, {cid=cid})
return true
end
function fuckmylife(cid)
local cid = cid.cid
if isCreature(cid) then
if loot > 0 then
doCreatureAddHealth(cid, -getCreatureHealth(cid))
else
doRemoveCreature(cid)
end
end
return true
end
#1 Option - Make the monsters you want to be attacked summons of a player. Then add custom AI to the monster in the form of onThink creaturescripts or custom spells.
#2 Option - Make the monsters non-hostile (so they don't target anyone), then make custom AI scripts (onThink or Spells) that have them follow creatures, and then cast spells on them.
#3 Option - Actually edit the source, which is actually pretty easy, and maybe I'll make a tutorial of how I did it.
(My creatures attack each other and can be allied to certain players as you can see in the below video at around 1:30 seconds)
how do i add <event name="monsterdeath"/>, if i'm working on otbr?