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

inquisition - Create tp with actionid or uniqueid

Tofflarn

New Member
Joined
Mar 22, 2008
Messages
360
Reaction score
1
Location
Sweden
Hello! :D

It's time for me to host a server again! But to make the server almost perfect i need some help from you guys!

I wan't my inquisition quest work almost as Real tibia.
I have a script now that creates a tp after killing a monster. If i wan't to make the tps in main room work i need this- When a tp is cretaed in for exampel Ushuriel seal a actionid or uniqueid will be created to. Now there is just a tp with postions.

This is how it looks like..

Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Inquisition"

version="1.0" author="Tommy" contact="[email protected]" enabled="yes">

        <event type="login" name="inquisitionRegister" event="script"><![CDATA[
        function onLogin(cid)
    registerCreatureEvent(cid, "Inquisition")
        return true
end]]></event>

    <event type="kill" name="Inquisition" event="script"><![CDATA[
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=1173, y=1141, z=12}, { x=1115, y=1214, z=12, stackpos=1 } },

["Annihilon"] = { { x=1244, y=1297, z=12 }, { x=1187, y=1198, z=12, stackpos=1 } },

["Hellgorak"] = { { x=1067, y=1307, z=13 }, { x=1192, y=1240, z=12, stackpos=1 } },

["Madareth"] = { { x=1045, y=1130, z=13}, { x=1111, y=1240, z=12, stackpos=1 } },

["Zugurosh"] = { { x=1126, y=1151, z=12 }, { x=1149, y=1213, z=12, stackpos=1 } },

["Latrivan"] = { { x=1153, y=1196, z=13}, { x=1147, y=1244, z=12, stackpos=1 } }

    }

}



local function removal(position)

    if getThingfromPos(position).itemid == config.teleportId then

        doRemoveItem(getThingfromPos(position).uid)

    end

    return TRUE

end



function onKill(cid, target, lastHit)
if lastHit == true then

    local position = getCreaturePosition(target)

    for name, pos in pairs(config.bosses) do

        if name == getCreatureName(target) then

            teleport = doCreateTeleport(config.teleportId, pos[1], pos[2])

            doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)

            addEvent(removal, config.timeToRemove * 1000, pos[2])
            doSendMagicEffect(pos[2], 10)

        end

    end
end

    return TRUE

end]]></event>

         <action fromuid="1300" touid="1308" event="script"><![CDATA[
       if item.uid == 1300 then

        queststatus = getPlayerStorageValue(cid,50301)

           if queststatus == -1 then

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found robe of the underworld.")

               doPlayerAddItem(cid,8890,1)

               setPlayerStorageValue(cid,50301,1)

           else

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")

           end

       elseif item.uid == 1301 then

        queststatus = getPlayerStorageValue(cid,50301)

           if queststatus == -1 then

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a  Spellbook of Dark Mysteries.")

               doPlayerAddItem(cid,8918,1)

               setPlayerStorageValue(cid,50301,1)

           else

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")

           end

       elseif item.uid == 1302 then

        queststatus = getPlayerStorageValue(cid,50301)

           if queststatus == -1 then

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Fireborn Giant Armor.")

               doPlayerAddItem(cid,8881,1)

               setPlayerStorageValue(cid,50301,1)

           else

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")

        end

       elseif item.uid == 1303 then

        queststatus = getPlayerStorageValue(cid,50301)

           if queststatus == -1 then

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Master Archer's Armor.")

               doPlayerAddItem(cid,8888,1)

               setPlayerStorageValue(cid,50301,1)

           else

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")

           end

      elseif item.uid == 1304 then

        queststatus = getPlayerStorageValue(cid,50301)

           if queststatus == -1 then

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Royal Crossbow.")

               doPlayerAddItem(cid,8851,1)

               setPlayerStorageValue(cid,50301,1)

           else

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")

           end

    elseif item.uid == 1305 then

        queststatus = getPlayerStorageValue(cid,50301)

           if queststatus == -1 then

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Hellforged Axe.")

               doPlayerAddItem(cid,8924,1)

               setPlayerStorageValue(cid,50301,1)

           else

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")

           end

    elseif item.uid == 1306 then

        queststatus = getPlayerStorageValue(cid,50301)

           if queststatus == -1 then

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Obsidian Truncheon.")

               doPlayerAddItem(cid,8928,1)

               setPlayerStorageValue(cid,50301,1)

           else

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")

           end

    elseif item.uid == 1307 then

        queststatus = getPlayerStorageValue(cid,50301)

           if queststatus == -1 then

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Emerald Sword.")

               doPlayerAddItem(cid,8930,1)

               setPlayerStorageValue(cid,50301,1)

           else

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")

           end

    elseif item.uid == 1308 then

        queststatus = getPlayerStorageValue(cid,50301)

           if queststatus == -1 then

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Warsinger Bow.")

               doPlayerAddItem(cid,8854,1)

               setPlayerStorageValue(cid,50301,1)

           else

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")

           end

    elseif item.uid == 1309 then

        queststatus = getPlayerStorageValue(cid,50301)

           if queststatus == -1 then

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a spellbook of Lost Souls.")

               doPlayerAddItem(cid,8903,1)

               setPlayerStorageValue(cid,50301,1)

           else

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")

           end

    elseif item.uid == 13010 then

        queststatus = getPlayerStorageValue(cid,50301)

           if queststatus == -1 then

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Mystical Armor.")

               doPlayerAddItem(cid,2508,1)

               setPlayerStorageValue(cid,50301,1)

           else

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")

           end

    elseif item.uid == 13011 then

        queststatus = getPlayerStorageValue(cid,50301)

           if queststatus == -1 then

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Rainbow Shield.")

               doPlayerAddItem(cid,8905,1)

               setPlayerStorageValue(cid,50301,1)

           else

               doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")

           end

    end

       return TRUE]]></action>
</mod>

This script will stop players from enter the seals if they haven't done the specification seal..

Code:
function onStepIn(cid, item, pos)

    if item.uid == 5900 then
        if getPlayerStorageValue(cid,5900) == -1 then
		doTeleportThing(cid,{x=1065, y=1085, z=14})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MORTAREA)
            	doCreatureSay(cid, "You haven't passed Ushuriel's seal yet.", TALKTYPE_ORANGE_1)
        else
		doTeleportThing(cid,{x=1176, y=1140, z=12})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)
        end
    elseif item.uid == 5901 then
        if getPlayerStorageValue(cid,5901) == -1 then
		doTeleportThing(cid,{x=1065, y=1085, z=14})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MORTAREA)
            	doCreatureSay(cid, "You haven't passed Zugurosh's seal yet.", TALKTYPE_ORANGE_1)
        else
		doTeleportThing(cid,{x=1128, y=1151, z=12})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)
        end
    elseif item.uid == 5902 then
        if getPlayerStorageValue(cid,5902) == -1 then
		doTeleportThing(cid,{x=1065, y=1085, z=14})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MORTAREA)
            	doCreatureSay(cid, "You haven't passed Madareth's seal yet.", TALKTYPE_ORANGE_1)
        else
		doTeleportThing(cid,{x=1045, y=1205, z=13})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)
        end
    elseif item.uid == 5903 then
        if getPlayerStorageValue(cid,5903) == -1 then
		doTeleportThing(cid,{x=1065, y=1085, z=14})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MORTAREA)
            	doCreatureSay(cid, "You haven't passed the Brother's seal yet.", TALKTYPE_ORANGE_1)
        else
		doTeleportThing(cid,{x=1152, y=1195, z=13})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)
        end
    elseif item.uid == 5904 then
        if getPlayerStorageValue(cid,5904) == -1 then
		doTeleportThing(cid,{x=1065, y=1085, z=14})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MORTAREA)
            	doCreatureSay(cid, "You haven't passed Annihilon's seal yet.", TALKTYPE_ORANGE_1)
        else
		doTeleportThing(cid,{x=1245, y=1297, z=12})
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)
        end
    end
    return 1
end


And this script will registrate if the player have done a seal..

Code:
function onStepIn(cid, item, pos)

    if item.uid == 5905 then
        setPlayerStorageValue(cid,5900,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14}) -- Coordinates of main room.
	doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)

    elseif item.uid == 5906 then
        setPlayerStorageValue(cid,5901,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})
	doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)

    elseif item.uid == 5907 then
        setPlayerStorageValue(cid,5902,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14})
	doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)

    elseif item.uid == 5908 then
        setPlayerStorageValue(cid,5903,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14}) 
	doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)

    elseif item.uid == 5909 then
        setPlayerStorageValue(cid,5904,1)
	doTeleportThing(cid,{x=1064, y=1085, z=14}) 
	doSendMagicEffect(getPlayerPosition(cid),CONST_ME_TELEPORT)   
end
    return 1
end



Hope someone can help me with this..

/ Tofflarn
 
Ok I've fixed the INQ quest. Open up your server folder, goto the Mods file and open up inquisition.xml with your notepad. Find the strings shown under, and replace all the coordinates with the ones in the quote, or just remove the whole "text" and replace it if you want to do it the fast way. The coordinates are now working. Remember, the teleport to Hellgorak doesnt work and has to be edited in your mapeditor.
The teleport position is [X: 1282] [Y: 1211] [Z: 9], change it to [X: 1192] [Y: 1253] [Z: 12].
PHP:
["Ushuriel"] = { { x=1173, y=1141, z=12}, { x=1097, y=1214, z=12, stackpos=1 } },

["Annihilon"] = { { x=1244, y=1297, z=12 }, { x=1187, y=1198, z=12, stackpos=1 } },

["Hellgorak"] = { { x=1067, y=1307, z=13 }, { x=1192, y=1240, z=12, stackpos=1 } },

["Madareth"] = { { x=1045, y=1130, z=13}, { x=1111, y=1240, z=12, stackpos=1 } },

["Zugurosh"] = { { x=1126, y=1151, z=12 }, { x=1149, y=1213, z=12, stackpos=1 } },

["Latrivan"] = { { x=1153, y=1196, z=13}, { x=1147, y=1244, z=12, stackpos=1 } }

I hope this helped! if so please rep++ me :thumbup: Goodluck!
 
Already done that... But that is not what i needed.. I need that when a tp is created after killing a boss it should give away a StorageValue to the player that enter the tp... Thx anyway! Someone else?
 
Code:
local action = 12345
tp = doCreateTeleport(1387, pos[1], pos[2])
doSetItemActionId(tp, action)
 
Back
Top