• 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!

On death transforms into another monster?

kessykins

Intermediate OT User
Joined
Mar 15, 2010
Messages
297
Reaction score
105
Is it possible for a creature to die and on death becomes another monster?

If so.. what would need to be changed in the creature file? ;o
 
Ehh.. basically yes :p
In the end I want a custom monster to transform into another creature on death :p
IE: my zombie does and instantly becomes an exploding corpse xD
 
No fear, high pro is here...

Lemme ask you.. when someone kills a certain monster of yours, this monster will fall into a corpse, but when it does a new monster will appear.. ?
 
Ok I'll spill the details :9

I want a custom monster called "Enraged Zombie" to die<without a corpse> but as soon as it dies, I want another creature to take its place.. Quas mentioned it's do-able but something needs to be changed in the creatureevents.. I just don't know what x.x

Here's what the end result should look like
ondeatheffect.png
 
easy cake, the monster. go monsters/enraged zombie.xml and put "corpse" to "0"..
and then in creaturescripts.. onkill.. put

function onKill (cid, target, pos)
if creature == Enraged Zompie then
pos = getcreaturepos(target)
dosummoncreature (New monster, pos)
end
end

I know that was a cheap one but it's an example. I'm going for swim now so I don't have time to make the script. if you haven't figure it out I'll make a small tutorial when I get back..


have fun
 
ok try this :) [no corpse, no blood, some effect]
Lua:
local monster = "Rat"
local summon = "dog"



function onKill(cid, target)
if getCreatureName(target) == monster then
local t = getThingPos(target)
doCreatureSay(target, "You think I die easy!", TALKTYPE_ORANGE_1)
addEvent(doCleanTile,0.1,t)
doSendMagicEffect(t,49)
doSendMagicEffect({x= t.x+1, y= t.y ,z= t.z},49)
doSendMagicEffect({x= t.x-1, y= t.y, z= t.z},49)
doSendMagicEffect({x= t.x, y= t.y-1, z= t.z},49)
doSendMagicEffect({x= t.x, y= t.y-1, z= t.z},49)
doSendMagicEffect({x= t.x-1, y= t.y-1, z= t.z},49)
doSendMagicEffect({x= t.x+1, y= t.y-1, z= t.z},49)
doSendMagicEffect({x= t.x+1, y= t.y+1, z= t.z},49)
doSendMagicEffect({x= t.x-1, y= t.y+1, z= t.z},49)
doSummonCreature(summon, t)
end
 return true
end
 
Last edited:
It loaded fine but on testing.. nothing was summoned :/


I tried this and my server crashed as soon as the creature died:
local monster = "Enraged Zombie"
local summon = "Exploding Corpse"



function onKill(cid, target)
if getCreatureName(target) == monster then
local t = getThingPos(target)
doCreatureSay(target, "I'm not finished with you yet! ", TALKTYPE_ORANGE_1)
doSummonCreature(summon, t)
doSendMagicEffect(t,49)
doSendMagicEffect({x= t.x+1, y= t.y ,z= t.z},49)
doSendMagicEffect({x= t.x-1, y= t.y, z= t.z},49)
doSendMagicEffect({x= t.x, y= t.y-1, z= t.z},49)
doSendMagicEffect({x= t.x, y= t.y-1, z= t.z},49)
doSendMagicEffect({x= t.x-1, y= t.y-1, z= t.z},49)
doSendMagicEffect({x= t.x+1, y= t.y-1, z= t.z},49)
doSendMagicEffect({x= t.x+1, y= t.y+1, z= t.z},49)
doSendMagicEffect({x= t.x-1, y= t.y+1, z= t.z},49)
addEvent(doCleanTile,0.1,t)
end
return true
end
 
tfs?try again cause i tested on 0.3.6 ....[if still crash after you retry then
Lua:
local monster = "Enraged Zombie"
local summon = "Exploding Corpse"
function onKill(cid, target)
        if getCreatureName(target) == monster then
                         local t = getThingPos(target)
               addEvent(doCleanTile,0.1,t)
               doCreatureSay(target, "I'm not finished with you yet! ", TALKTYPE_ORANGE_1)
               doSummonCreature(summon, t)
              doSendMagicEffect(t,49)
       end
      return true
end
 
Should the creaturescript be this?

<event type="kill" name="EnragedZombie" event="script" value="enragedzombie.lua"/>



Ok I copied and pasted what you wrote and onKill the server crashed wtfff
 
ok so I made the enragedzombie.lua
local monster = "Enraged Zombie"
local summon = "Exploding Corpse"
function onKill(cid, target)
if getCreatureName(target) == monster then
local t = getThingPos(target)
doCreatureSay(target, "I'm not finished with you yet! ", TALKTYPE_ORANGE_1)
doSummonCreature(summon, t)
doSendMagicEffect(t,49)
end
return true
end

the login.lua
registerCreatureEvent(cid, "EnragedZombie")

return true
end

and the creature script
<event type="kill" name="EnragedZombie" event="script" value="Enragedzombie.lua"/>

and it's now crashing the server when anyone logs on x.x
 
so let me do somthng and try ..

goto creature event create lua called xxx.lua
Lua:
local monster = "Enraged Zombie"
local summon = "Exploding Corpse"
function onKill(cid, target)
if isPlayer(target) then
return true
end
if isPlayer(cid) and getCreatureName(target) == monster then
local t = getThingPos(target)
doCreatureSay(target, "I'm not finished with you yet! ", TALKTYPE_ORANGE_1)
doSummonCreature(summon, t)
doSendMagicEffect(t,49)
end
return true
end

creature.xml
Code:
<event type="kill" name="t" event="script" value="xxx.lua"/>

in log in
Code:
registerCreatureEvent(cid, "t")

Btw you made somthng wron when making the line to log.lua as this script has nothng to do with log in
 
ok so i followed you instructions and just put the registercreatureevent at the bottom of the login.lua.. it's now giving me this error..when logging on it instantly crashes the server x.x

[14/08/2010 05:13:11] [Error - CreatureScript Interface]
[14/08/2010 05:13:11] data/creaturescripts/scripts/login.lua
[14/08/2010 05:13:11] Description:
[14/08/2010 05:13:11] (luaRegisterCreatureEvent) Creature not found
[14/08/2010 05:13:11] Reloaded creature events.


oh god.. i can see it now.. it's going to be 1 little typo >.< it always is!! lmao
 
where did you put the regestire it must be like that : [scroll down till you see where it is , must be after the function onlogin, and before its end]
Code:
local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	
[B][I][U][COLOR="red"]registerCreatureEvent(cid, "t")[/COLOR][/U][/I][/B]
	

registerCreatureEvent(cid, "Idle")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end

	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "AdvanceSave")
	return true
end
 
Back
Top