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

Solved Problem with doSetItemActionId

Komigz

New Member
Joined
May 27, 2013
Messages
9
Reaction score
0
Location
Poland
Hello, i have problem with inq script.
When i kill boss script create teleport but dont set action id
11212.jpg

I'm using TFS Mystic Spirit 0.2.15

How can I fix it?

here is my script

Code:
local config = {
        timeToRemove = 30, -- seconds
		message = "You now have 30 seconds to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear",
        teleportId = 1387,
        bosses = { -- Monster Name,  Teleport Position
                ["Ushuriel"] = {  pos={ x=1329, y=433, z=11, stackpos=1 }, aid=1001 },
		["Zugurosh"] = {  pos={ x=33123, y=31689, z=11, stackpos=1 }, aid=1002},
		["Madareth"] = {  pos={ x=33194, y=31768, z=11, stackpos=1 }, aid=1003},
                ["Annihilon"] = {  pos={ x=33200, y=31704, z=11, stackpos=1 }, aid=1005},
                ["Hellgorak"] = {  pos={ x=33107, y=31735, z=11, stackpos=1 }, aid=1006}
				},
		brothers ={
        ["Golgordan"] = {pos={ x=33235, y=31734, z=11, stackpos=1 },aid=1004, brother = "Latrivan"},
        ["Latrivan"] = {pos={ x=33235, y=31734, z=11, stackpos=1 },aid=1004, brother = "Golgordan"},
        brothersArea ={
                fromPos = {x = 33224, y = 31722, z = 11},
                toPos = {x = 33240, y = 31734, z = 11} } }
}
local function removal(position)
	doRemoveItem(getTileItemById(position, config.teleportId).uid, 1)
    return TRUE
end
 
function onKill(cid, target, lastHit)
    if(config.bosses[getCreatureName(target)]) then
		local t = config.bosses[getCreatureName(target)]
	    local teleport = doCreateItem(config.teleportId, t.pos)
		local position = t.pos
		doSetItemActionId(uid, "aid", t.aid)
        doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
		addEvent(removal, config.timeToRemove * 1000, position)
	elseif(config.brothers[getCreatureName(target)]) then
		local t = config.brothers[getCreatureName(target)]
        local brother = getCreatureByName(t.brother)
		if(isMonster(brother) == true) then
            if(isInRange(getCreaturePosition(brother), config.brothers.brothersArea.fromPos, config.brothers.brothersArea.toPos) == true) then
                return TRUE
			end
        else
			local teleport = doCreateItem(config.teleportId, t.pos)
			local position = t.pos
			doSetItemActionId(teleport, "aid", t.aid)
			doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
			addEvent(removal, config.timeToRemove * 1000, position)
		end
	end
	return TRUE
end
 
Hi there!

This function in 0.2.15 -> //doSetItemActionId(uid, actionid)

Try this:

Lua:
    local config = {
            timeToRemove = 30, -- seconds
    		message = "You now have 30 seconds to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear",
            teleportId = 1387,
            bosses = { -- Monster Name,  Teleport Position
                    ["Ushuriel"] = {  pos={ x=1329, y=433, z=11, stackpos=1 }, aid=1001 },
    		["Zugurosh"] = {  pos={ x=33123, y=31689, z=11, stackpos=1 }, aid=1002},
    		["Madareth"] = {  pos={ x=33194, y=31768, z=11, stackpos=1 }, aid=1003},
                    ["Annihilon"] = {  pos={ x=33200, y=31704, z=11, stackpos=1 }, aid=1005},
                    ["Hellgorak"] = {  pos={ x=33107, y=31735, z=11, stackpos=1 }, aid=1006}
    				},
    		brothers ={
            ["Golgordan"] = {pos={ x=33235, y=31734, z=11, stackpos=1 },aid=1004, brother = "Latrivan"},
            ["Latrivan"] = {pos={ x=33235, y=31734, z=11, stackpos=1 },aid=1004, brother = "Golgordan"},
            brothersArea ={
                    fromPos = {x = 33224, y = 31722, z = 11},
                    toPos = {x = 33240, y = 31734, z = 11} } }
    }
    local function removal(position)
    	doRemoveItem(getTileItemById(position, config.teleportId).uid, 1)
        return TRUE
    end
     
    function onKill(cid, target, lastHit)
        if(config.bosses[getCreatureName(target)]) then
    		local t = config.bosses[getCreatureName(target)]
    	    local teleport = doCreateItem(config.teleportId, t.pos)
    		local position = t.pos
    		doSetItemActionId(teleport.uid, t.aid)
            doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
    		addEvent(removal, config.timeToRemove * 1000, position)
    	elseif(config.brothers[getCreatureName(target)]) then
    		local t = config.brothers[getCreatureName(target)]
            local brother = getCreatureByName(t.brother)
    		if(isMonster(brother) == true) then
                if(isInRange(getCreaturePosition(brother), config.brothers.brothersArea.fromPos, config.brothers.brothersArea.toPos) == true) then
                    return TRUE
    			end
            else
    			local teleport = doCreateItem(config.teleportId, t.pos)
    			local position = t.pos
    			doSetItemActionId(teleport.uid, t.aid)
    			doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
    			addEvent(removal, config.timeToRemove * 1000, position)
    		end
    	end
    	return TRUE
    end
 
@psychomen
still not work

@tetra 20
ye, i know. Its better way but i need this AID to save a room.

anyway, solved, I used other script.
CLOSE
 
Back
Top