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

CreatureEvent Creating teleport after monster dies.

Code:
local config = {
    message = "Go into the teleporter in 3 minutes, else it will disappear.",
    timeToRemove = 180, -- seconds
    teleportId = 1387,
[B]    actionId = {
    ["ushuriel"] = 41610,
    ["zugurosh"] = 41611,
    ["madareth"] = 41612,
    ["latrivan"] = 41613,
    ["annihilion"] = 41614,
    ["hellgorak"] = 41615
    },[/B]
    bosses = { -- Monster Name, Teleport To Position, Teleport Position
        ["ushuriel"] = { { x = 1178, y = 1142, z = 5 }, { x = 1119, y = 1219, z = 5, stackpos = 1 } },
        ["annihilion"] = { { x = 1251, y = 1301, z = 5 }, { x = 1192, y = 1204, z = 5, stackpos = 1 } },
        ["hellgorak"] = { { x = 1070, y = 1313, z = 6 }, { x = 1197, y = 1246, z = 5, stackpos = 1 } },
        ["madareth"] = { { x = 1050, y = 1209, z = 6 }, { x = 1117, y = 1246, z = 5, stackpos = 1 } },
        ["zugurosh"] = { { x = 1133, y = 1156, z = 5 }, { x = 1153, y = 1218, z = 5, stackpos = 1 } },
        ["latrivan"] = { { x = 1157, y = 1200, z = 6 }, { x = 1152, y = 1250, z = 5, stackpos = 1 } }
    }
}

local function removal(position)
    if getThingfromPos(position).itemid == config.teleportId then
        doRemoveItem(getThingfromPos(position).uid)
    end
    return TRUE
end

function onDeath(cid, corpse, killer)
    local position = getCreaturePosition(cid)
    for name, pos in pairs(config.bosses) do
        if name == getCreatureName(cid) then
            teleport = doCreateTeleport(config.teleportId, pos[1], pos[2])
            [B]doSetItemActionId(teleport,config.actionId)[/B]
            doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
            addEvent(removal, config.timeToRemove * 1000, pos[2])
        end
    end
    return TRUE
end
I'm trying edit this script... but i dont know much about lua..
What am I doing wrong?
how to make this actionid part work? ;x
 
Code:
local config = {
    message = "Go into the teleporter in 3 minutes, else it will disappear.",
    timeToRemove = 180, -- seconds
    teleportId = 1387,
    bosses = { -- Monster Name, Teleport To Position, Teleport Position, Action ID
        ["ushuriel"] = { { x = 1178, y = 1142, z = 5 }, { x = 1119, y = 1219, z = 5, stackpos = 1 }, 41610 },
        ["annihilion"] = { { x = 1251, y = 1301, z = 5 }, { x = 1192, y = 1204, z = 5, stackpos = 1 }, 41611 },
        ["hellgorak"] = { { x = 1070, y = 1313, z = 6 }, { x = 1197, y = 1246, z = 5, stackpos = 1 }, 41612 },
        ["madareth"] = { { x = 1050, y = 1209, z = 6 }, { x = 1117, y = 1246, z = 5, stackpos = 1 }, 41613 },
        ["zugurosh"] = { { x = 1133, y = 1156, z = 5 }, { x = 1153, y = 1218, z = 5, stackpos = 1 }, 41614 },
        ["latrivan"] = { { x = 1157, y = 1200, z = 6 }, { x = 1152, y = 1250, z = 5, stackpos = 1 }, 41615 }
    }
}

local function removal(position)
    if getThingfromPos(position).itemid == config.teleportId then
        doRemoveItem(getThingfromPos(position).uid)
    end
    return TRUE
end

function onDeath(cid, corpse, killer)
    local position = getCreaturePosition(cid)
    for name, pos in pairs(config.bosses) do
        if name == getCreatureName(cid) then
            teleport = doCreateTeleport(config.teleportId, pos[1], pos[2])
            doSetItemActionId(teleport, pos[3])
            doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
            addEvent(removal, config.timeToRemove * 1000, pos[2])
        end
    end
    return TRUE
end
 
yep work for me too, i úsed a another script before the one frmo christiandb ^^ thats why its not worked.
 
yep work for me too, i úsed a another script before the one frmo christiandb ^^ thats why its not worked.

which version r u using bro
this used to work for me on alpha 4 but it doenst work on beta 2
 
Wath can i do if i want a script that setplayerstoragevalue when you kill x boss?

I did this, but when the monster die only get a value to the killer and no all who hit the monster. I think i must use the funcion OnKill

function onDeath(cid, corpse, killer)
local position = getCreaturePosition(cid)
for name, pos in pairs(config.bosses) do
if name == getCreatureName(cid) then
teleport = doCreateTeleport(config.teleportId, pos[1], pos[2])
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, pos[2])
if "Annihilon" == getCreatureName(cid) then
setPlayerStorageValue(killer, 10000,1)
end
end
end
return TRUE
end

Sorry for my english i dont speak that lenguage, and thx to all the comunity i really like this forum
 
Last edited:
#UP
Code:
local config = {
	message = "Go into the teleporter in 3 minutes, else it will disappear.",
	timeToRemove = 180, -- seconds
	teleportId = 1387,
	bosses = { -- Monster Name, Teleport To Position, Teleport Position
		["Ushuriel"] = { { x = 222, y = 564, z = 6 }, { x = 218, y = 564, z = 6, stackpos = 1 }, 12345 },
		["Annihilion"] = { { x = 276, y = 1045, z = 6 }, { x = 218, y = 564, z = 6, stackpos = 1 }, 123456 },
		["Hellgorak"] = { { x = 169, y = 1047, z = 6 }, { x = 218, y = 564, z = 6, stackpos = 1 }, 1234567 },
		["Madareth"] = { { x = 416, y = 1017, z = 6 }, { x = 218, y = 564, z = 6, stackpos = 1 }, 12345678 },
		["Zugurosh"] = { { x = 424, y = 1119, z = 7 }, { x = 218, y = 564, z = 6, stackpos = 1 }, 123456789 },
		["Latrivan"] = { { x = 46, y = 1109, z = 7 }, { x = 218, y = 564, z = 6, stackpos = 1 }, 1234567890 }
	}
}

local function removal(position)
	if getThingfromPos(position).itemid == config.teleportId then
		doRemoveItem(getThingfromPos(position).uid)
	end
	return TRUE
end

function onDeath(cid, corpse, killer)
	local position = getCreaturePosition(cid)
	for name, pos in pairs(config.bosses) do
		if name == getCreatureName(cid) then
			teleport = doCreateTeleport(config.teleportId, pos[1], pos[2])
			doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
                        setStorageValue(killer, pos[3])
			addEvent(removal, config.timeToRemove * 1000, pos[2])
		end
	end
	return TRUE
end

It should be works :)
 
Last edited:
Stream, dont add it in a table. Just
Code:
["Ushuriel"] = { { x = 222, y = 564, z = 6 }, { x = 218, y = 564, z = 6, stackpos = 1 }, 12345 },
 
Last edited:
#UP
Code:
local config = {
	message = "Go into the teleporter in 3 minutes, else it will disappear.",
	timeToRemove = 180, -- seconds
	teleportId = 1387,
	bosses = { -- Monster Name, Teleport To Position, Teleport Position
		["Ushuriel"] = { { x = 222, y = 564, z = 6 }, { x = 218, y = 564, z = 6, stackpos = 1 }, 12345 },
		["Annihilion"] = { { x = 276, y = 1045, z = 6 }, { x = 218, y = 564, z = 6, stackpos = 1 }, 123456 },
		["Hellgorak"] = { { x = 169, y = 1047, z = 6 }, { x = 218, y = 564, z = 6, stackpos = 1 }, 1234567 },
		["Madareth"] = { { x = 416, y = 1017, z = 6 }, { x = 218, y = 564, z = 6, stackpos = 1 }, 12345678 },
		["Zugurosh"] = { { x = 424, y = 1119, z = 7 }, { x = 218, y = 564, z = 6, stackpos = 1 }, 123456789 },
		["Latrivan"] = { { x = 46, y = 1109, z = 7 }, { x = 218, y = 564, z = 6, stackpos = 1 }, 1234567890 }
	}
}

local function removal(position)
	if getThingfromPos(position).itemid == config.teleportId then
		doRemoveItem(getThingfromPos(position).uid)
	end
	return TRUE
end

function onDeath(cid, corpse, killer)
	local position = getCreaturePosition(cid)
	for name, pos in pairs(config.bosses) do
		if name == getCreatureName(cid) then
			teleport = doCreateTeleport(config.teleportId, pos[1], pos[2])
			doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
                        setStorageValue(killer, pos[3])
			addEvent(removal, config.timeToRemove * 1000, pos[2])
		end
	end
	return TRUE
end

It should be works :)

Hello again.

There was a error on this line
" setStorageValue(killer, pos[3])"
I change it for this one
" setPlayerStorageValue(killer, pos[3])"
but now i get a error that say can not find player.


I just need SetPlayerStorageValue OnDeath function or on an OnStep function when this script create a new teleport.
I need this because in the room of the rewards you will need to has deafeated all the bosses.

Sorry for my english and thanks for your atention
 
[04/03/2009 04:38:23] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
[04/03/2009 04:38:23] * The Forgotten Server, version 0.3 (Beta 2) *
[04/03/2009 04:38:23] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
[04/03/2009 04:38:23] * A server developed by Elf, Talaturen, Lithium, Kiper, Kornholijo, Jonern & Nightmare. *
[04/03/2009 04:38:23] * Visit our forum for updates, support and resources: http://otland.net. *
[04/03/2009 04:38:23] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

[04/03/2009 04:38:42] Test has logged in.

[04/03/2009 04:39:32] Lua Script Error: [CreatureScript Interface]
[04/03/2009 04:39:32] data/creaturescripts/scripts/inquisition.lua:eek:nDeath

[04/03/2009 04:39:32] luaSetPlayerStorageValue(). Player not found
 
local config = {
message = "Go into the teleporter in 3 minutes, else it will disappear.",
timeToRemove = 180, -- seconds
teleportId = 1387,
bosses = { -- Monster Name, Teleport To Position, Teleport Position
["Ushuriel"] = { { x = 1178, y = 1143, z = 5 }, { x = 1102, y = 1219, z = 5, stackpos = 1 }, 12001 },
["Annihilon"] = { { x = 1251, y = 1301, z = 5 }, { x = 1192, y = 1218, z = 5, stackpos = 1 }, 12002 },
["Hellgorak"] = { { x = 1069, y = 1316, z = 6 }, { x = 1197, y = 1261, z = 5, stackpos = 1 }, 12003 },
["Madareth"] = { { x = 1049, y = 1208, z = 6 }, { x = 1117, y = 1259, z = 5, stackpos = 1 }, 12004 },
["Zugurosh"] = { { x = 1133, y = 1155, z = 5 }, { x = 1134, y = 1218, z = 5, stackpos = 1 }, 12005 },
["Latrivan"] = { { x = 1157, y = 1200, z = 6 }, { x = 1152, y = 1259, z = 5, stackpos = 1 }, 12006 },
["Golgordan"] = { { x = 1157, y = 1200, z = 6 }, { x = 1152, y = 1259, z = 5, stackpos = 1 }, 12007 },
}
}

local function removal(position)
if getThingfromPos(position).itemid == config.teleportId then
doRemoveItem(getThingfromPos(position).uid)
end
return TRUE
end

function onDeath(cid, corpse, killer)
local position = getCreaturePosition(cid)
for name, pos in pairs(config.bosses) do
if name == getCreatureName(cid) then
teleport = doCreateTeleport(config.teleportId, pos[1], pos[2])
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
setPlayerStorageValue(killer, pos[3])
addEvent(removal, config.timeToRemove * 1000, pos[2])
end
end
return TRUE
end

I tryed this and it give this error


[04/03/2009 05:31:59] Lua Script Error: [CreatureScript Interface]
[04/03/2009 05:31:59] data/creaturescripts/scripts/inquisition.lua:eek:nDeath

[04/03/2009 05:31:59] luaSetPlayerStorageValue(). Player not found
 
Back
Top