• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Need fix in CreatureEvent script

Sorbal

Member
Joined
Jul 23, 2010
Messages
406
Reaction score
11
Location
Poland
Hello, can someone fix my script? The script is working but I want to after killing God Essence Snake, Snake Thing appeared in the place of death Snake God Essence. Here is my script:
PHP:
local config = {
message = "Now fight with my second form!",
bosses = {
["Snake God Essence"] = { x = 1034, y = 973, z = 8 },


}
}

function onDeath(cid, corpse, killer)
registerCreatureEvent(cid, "wrathy")
local position = getCreaturePosition(cid)

for name, pos in pairs(config.bosses) do
if name == getCreatureName(cid) then
teleport = 	doSummonCreature("snake thing", { x = 1034, y = 973, z = 8 })
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
doSendMagicEffect(position,65)
end
end
return TRUE
end
 
LUA:
-- ver. 1.2 2011-12-05 16:40
-- author tfs, otland.net/members/andypsylon
local c = {
	["Snake God Essence"] = {
		wco = "Snake Thing",
		message = "IT'S NOT THAT EASY, MORTALS! FEEL THE POWER OF A GOD!"
	},
	["Snake Thing"] = {
		wco = "Lizard Abomination",
		message = "NOOOO! NOW YOU HERETICS WILL FACE MY GODLY WRATH!"
	},
	["Lizard Abomination"] = {
		wco = "Mutated Zalamon",
		message = "YOU ... WILL ... PAY WITH AN ETERNITY ... OF AGONY!"
	}
}
 
function onDeath(cid, corpse, deathList)
	if isPlayer(cid) or getCreatureMaster(cid) then return true end
 
	local m = getCreatureName(cid)
	local pos = getThingPosition(cid)
 
-- wrath of emperor mission 11
	if c[m] and c[m].wco then
		doCreatureSay(cid, c[m].message, TALKTYPE_MONSTER_SAY)
		addEvent(doCreateMonster, 30, c[m].wco, pos)
--/wrath of emperor mission 11
	end
	return true
end
As usual, the script is written so that it can be easy to add the next mobs
 
Last edited:
Thanks for the quick response but script doesn't work. After killing the Snake God Essence the new monster does not appear and there is no errors in console.
 
LUA:
local c = {
["snake god essence"] = "snake thing",
["snake thing"] = "lizard abomination",
["lizard abomination"] = "mutated zalamon"
}

function onKill(cid, target)
if isMonster(target) then
   for k, v in pairs(c) do
       if getCreatureName(target):lower() == k then
          addEvent(doCreateMonster, 30, v, getThingPos(target))
		  doCreatureSay(cid, "Now fight with my second form!", TALKTYPE_MONSTER)
	   end
   end
end
return true
end

And login.lua stuff.
 
Last edited:
Just change this line:
LUA:
if c[m] and c.wco then
for:
LUA:
if c[m] and c[m].wco then
and
LUA:
addEvent(doCreateMonster, 30, c.wco, pos)
for
LUA:
addEvent(doCreateMonster, 30, c[m].wco, pos)
it will work fine :]
 
@santi onkill ist here not effizient (this comment with script version is helpful for people and for me to help. Please delete it :P )
@xFalcon thanx ;)
 
Last edited:
Hello, im tried to make this things in Santi's script but it didn't work. So i need help in this functions.. is possible to set display text after killing the monster appeared in his place, not the character who killed him? Also good if there will be
Code:
CONST_ME_PLANTATTACK
effect while new monster appear :).
 
LUA:
-- ver. 1.2 2011-12-05 16:40
-- author tfs, otland.net/members/andypsylon
local c = {
	["Snake God Essence"] = {
		wco = "Snake Thing",
		message = "IT'S NOT THAT EASY, MORTALS! FEEL THE POWER OF A GOD!"
	},
	["Snake Thing"] = {
		wco = "Lizard Abomination",
		message = "NOOOO! NOW YOU HERETICS WILL FACE MY GODLY WRATH!"
	},
	["Lizard Abomination"] = {
		wco = "Mutated Zalamon",
		message = "YOU ... WILL ... PAY WITH AN ETERNITY ... OF AGONY!"
	}
}
 
function onDeath(cid, corpse, deathList)
	if isPlayer(cid) or getCreatureMaster(cid) then return true end

	local m = getCreatureName(cid)
	local pos = getThingPosition(cid)

-- wrath of emperor mission 11
	if c[m] and c[m].wco then
		doCreatureSay(cid, c[m].message, TALKTYPE_MONSTER_SAY)
		addEvent(doCreateMonster, 30, c[m].wco, pos)
--/wrath of emperor mission 11
	end
	return true
end

-- edit
of course for TFS 3.6:
TALKTYPE_MONSTER_SAY
--> TALKTYPE_MONSTER
and
if isPlayer(cid) or getCreatureMaster(cid) then return true end
--> if isPlayer(cid) then return true end
 
Last edited:
TFS 0.3.6 - not working. No errors in console. After killing Snake God Essence there is no message and new monster don't appear. I've changed TALKTYPE. Any solution ;)?
 
LUA:
-- ver. 1.2 2011-12-05 16:40
-- author tfs, otland.net/members/andypsylon
local c = {
	["Snake God Essence"] = {
		wco = "Snake Thing",
		message = "IT'S NOT THAT EASY, MORTALS! FEEL THE POWER OF A GOD!"
	},
	["Snake Thing"] = {
		wco = "Lizard Abomination",
		message = "NOOOO! NOW YOU HERETICS WILL FACE MY GODLY WRATH!"
	},
	["Lizard Abomination"] = {
		wco = "Mutated Zalamon",
		message = "YOU ... WILL ... PAY WITH AN ETERNITY ... OF AGONY!"
	}
}
 
function onDeath(cid, corpse, deathList)
	if isPlayer(cid) or getCreatureMaster(cid) then return true end

	local m = getCreatureName(cid)
	local pos = getThingPosition(cid)

-- wrath of emperor mission 11
	if c[m] and c[m].wco then
		doCreatureSay(cid, c[m].message, TALKTYPE_MONSTER_SAY)
		addEvent(doCreateMonster, 30, c[m].wco, pos)
--/wrath of emperor mission 11
	end
	return true
end

-- edit
of course for TFS 3.6:
TALKTYPE_MONSTER_SAY
--> TALKTYPE_MONSTER
and
if isPlayer(cid) or getCreatureMaster(cid) then return true end
--> if isPlayer(cid) then return true end

Why are you checking if strings are true?
 
Back
Top