spawning monsters and loot.
Posted: Sun Oct 05, 2014 7:54 am
I cloned a monster. I cloned a coffin. When the champions destory the coffin my cloned skeleton is spawned. So far so good. Next I want to have a list of possible loot, and to have one item to spawn onDie of the monster. That don't work. I have tried having the spawn loot in the cloned monster .lua file (did not work), I tried a call to a script_entity (still did not work). Also tried hudPrint() command to try to trouble shoot. I get a " '}' expected (to close '}' at line 5) near onDie. " error.
cloneObject {
name="my_skeleton_warrior",
baseObject="skeleton_warrior",
OnDie=function(self)
-- skeletonDead.getSkeletonLoot(self.level, self.x, self.y)
skeletonLoot={
"torch",
"dm_bone_arm",
"dagger",
"tar_bead",
"tattered_cloak",
"dm_waterskin_full",
"peasant_cap",
"sack",
"dm_weapon_club",
"shuriken"
}
spawn(skeletonLoot[math.random(1, #skeletonLoot)], level,x,y,0)
end
}
Thanks inadvance for any help.
cloneObject {
name="my_skeleton_warrior",
baseObject="skeleton_warrior",
OnDie=function(self)
-- skeletonDead.getSkeletonLoot(self.level, self.x, self.y)
skeletonLoot={
"torch",
"dm_bone_arm",
"dagger",
"tar_bead",
"tattered_cloak",
"dm_waterskin_full",
"peasant_cap",
"sack",
"dm_weapon_club",
"shuriken"
}
spawn(skeletonLoot[math.random(1, #skeletonLoot)], level,x,y,0)
end
}
Thanks inadvance for any help.