• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Creature Script] onDeath [Fixed]

Evangelion

New Member
Joined
May 8, 2008
Messages
13
Reaction score
0
What I need please, is that when monster dies it removes a statue. What I did was following these steps, so that does not work.

Also I have changed the stackpos for 1,2,3,254,255

TFS v 0.2.5


data/creaturescripts/creaturescripts.xml
Code:
<event type="death" name="Zebelon" script="Zebelon.lua"/>

data/creaturescripts/scripts/Zebelon.lua
Lua:
-- Fixed By me
local function moveStone(p)
	if isPlayer(getThingfromPos(p.stonePosition).uid) == TRUE then
		doMoveCreature(cid, 2)
	end
	doSendMagicEffect(p.stonePosition, CONST_ME_POFF)
	doCreateItem(p.stoneid, 1, p.stonePosition)
end

function onDeath(cid, corpse, killer)

registerCreatureEvent(cid, "Zebelon") -- The registered event this way


local timeLimit = 60 * 1000
local stonePosition = {x=3992,y=3767,z=15,stackpos=1} -- Position of the Statue
local stoneid = 9306 -- ID of Statue
local stone = getThingfromPos{x=3992,y=3767,z=15,stackpos=1}

	if stone.itemid == stoneid then
		doRemoveItem(stone.uid, 1)
		doSendMagicEffect(stonePosition, CONST_ME_POFF)
		addEvent(moveStone, timeLimit, {stonePosition = stonePosition, stoneid = stoneid})
	end

	return TRUE
end

data/monsters/Zebelon.xml
Code:
<script>
<event name="Zebelon"/>
</script>

data/creaturescripts/scripts/login.lua
Lua:
function onLogin(cid)
        registerCreatureEvent(cid, "Zebelon") -- The registered event this way
	registerCreatureEvent(cid, "createwall")
	registerCreatureEvent(cid, "PlayerDeath")
	registerCreatureEvent(cid, "DeathBroadcast")
	registerCreatureEvent(cid, "SkullAttack")
	registerCreatureEvent(cid, "RainbowOutfit")
	registerCreatureEvent(cid, "PlayerDeathPrepare")  
	return TRUE
end
 
Last edited:
Back
Top