Ok I have another question. Can a spawned mob be lua scripted? by spawned I mean the mob is spawned by a script be it LUA or C++
Ok I have another question. Can a spawned mob be lua scripted? by spawned I mean the mob is spawned by a script be it LUA or C++
yes, and here is how:
:SpawnCreature(entryID, x, y, z, o, faction, duration) : Spawns a creature at a position with specified faction, despawning after duration milliseconds.
Example script:
Code:function Boss_Combat(Unit, event) Unit:SendChatMessage(14, 0, "You will never kill me!! Minions, attack!!") Unit:RegisterEvent("Boss_SpawnMinion", 1000, 1) end function Boss_SpawnMinion(Unit, event) x = Unit:GetX() y = Unit:GetY() z = Unit:GetZ() o = Unit:GetO() Unit:SpawnCreature(MINIONENTRYID, x - 3, y - 3, z, o, 14, 60000) -- Spawns beside the boss with Faction 14 for 1 minute end RegisterUnitEvent(BOSSENTRYID, 1, "Boss_Combat")
Thanks guys, but no, I mean exactly this:
- I spawned a mob via C++ on item spell use (something lua cant make right now):
- I need to update the mobs flags at a certain reached health.
error, the spawned mob didnt do anything once he reached the health percent defined.
Oddly enough it works perfect on mobs that are already spawned via creature_spawns tables in the database.
EDIT: Nevermind I already found another way to fix my problem, I am gonna to release it soon.
Last edited by marcelo_20xx; 12-01-2008 at 11:00 PM.