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

Need Help in this Quest

willks123

New Member
Joined
Dec 31, 2012
Messages
64
Reaction score
2
I need help setting up a quest on my server.


I'll explain how the quest will work so they can help me.


The player will go through the door and will see the 5 Basin, the Lever and the Skeleton. OBS * TELEPORT WILL APPEAR WHEN KILLING THE BOSS.


In the basin next to the lever the Player will have to put a SKULL ID 2229.


In the four Basin below he will have to put 1 BONE ID 2230 on top of each.

x4fy1e.jpg


When he pulls the lever:
-Disappear the Eskeleto that is on the throne.
-Os 5 basin se transformam em outro basin com a chama acesa ID 1483.
-The 5 basins turn into another basin with the flame lit ID 1483.
-The Boss appears in place of the skeleton.
-The player will have 5 minutes to kill the BOSS and go through the portal (If there is a way to show a message to the person who pulled the lever when 30 seconds is missing)

If he dies he will only be able to enter the room again after 20 minutes.

If he kills the boss, the teleportation will appear and the time continues to count until he goes through the teleport.

When he goes through the teleport, he cleans the room, and releases the access for other players to kill the boss.

If time runs out, reset the room, and the player is teleported to the outside of the door.
 
Moved to requests.
Have you tried to code this yourself?
Any issues?
 
You should look into action scripts for click interactions, and movement scripts for tile interactions.
You can create special code logic for particular things in the game (like doors, buttons, levers) by linking action/unique ids from your map to a script.
open map.otbm file in RME -> Add unique ID to door (that is not used anywere else) -> save map file
Create Lua script file in /data/actions/scripts/
Edit data/actions/actions.xml, add the unique ID from map editor and configure it to load the Lua script file you previously created.

Code the desired functionality in the Lua file, save, restart the server.
Repeat until code is stable and works.
 
You should look into action scripts for click interactions, and movement scripts for tile interactions.
You can create special code logic for particular things in the game (like doors, buttons, levers) by linking action/unique ids from your map to a script.
open map.otbm file in RME -> Add unique ID to door (that is not used anywere else) -> save map file
Create Lua script file in /data/actions/scripts/
Edit data/actions/actions.xml, add the unique ID from map editor and configure it to load the Lua script file you previously created.

Code the desired functionality in the Lua file, save, restart the server.
Repeat until code is stable and works.
I don't now create this script =x
 
I don't now create this script =x
Make 1 small part at a time.

Start with,
When click lever, transform lever to 1946.
When click lever again, transform lever to 1945.

Then try,
When click lever, check if itemID 2230 is on _this_ position.

Then try,
When click lever, if lever's itemid is equal to 1945, remove item 2230 from _this_ position.

-- et cetera.

just keep adding each part of the script, step by step, and test each part of the script as you go along. :)

We're here to help though, so feel free to post back when you are having troubles
 
Make 1 small part at a time.

Start with,
When click lever, transform lever to 1946.
When click lever again, transform lever to 1945.

Then try,
When click lever, check if itemID 2230 is on _this_ position.

Then try,
When click lever, if lever's itemid is equal to 1945, remove item 2230 from _this_ position.

-- et cetera.

just keep adding each part of the script, step by step, and test each part of the script as you go along. :)

We're here to help though, so feel free to post back when you are having troubles

The logic to do I know, but I do not know how to write the script. I do not understand script. That's why I'm asking for help.
 
Programming in Lua : 1

+ tfs functions:
functions - Pastebin.com
credits to @Static_

I will help you a little to start:

Code:
local config = {
    leverPosition = Position(x, y, z),
    leverId = ?,
 
    skeletonPosition = Position(x, y, z),
    corpseId = ?

}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local lever = Tile(config.leverPosition):getItemById(config.leverId) -- you need to define tile -> Tile(Position(1, 2, 7), getItemById(id) is function to get item from tile with id
    if lever then -- checks if lever exist
        lever:transform(config.leverId + 1) -- transforms the lever to "used"
        local skeleton = Tile(config.skeletonPosition):getItemById(config.corpseId)
        if skeleton then
            skeleton:remove() -- remove the skeleton corpse, you can also use skeleton:remove(1) it will remove one item not all from the tile
        end
    end
 
    return true
end
 
Last edited:
Programming in Lua : 1

+ tfs functions:
functions - Pastebin.com
credits to @Static_

I will help you a little to start:

Code:
local config = {
    leverPosition = Position(x, y, z),
    leverId = ?,
 
    skeletonPosition = Position(x, y, z),
    corpseId = ?

}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local lever = Tile(config.leverPosition):getItemById(config.leverId) -- you need to define tile -> Tile(Position(1, 2, 7), getItemById(id) is function to get item from tile with id
    if lever then -- checks if lever exist
        lever:transform(config.leverId + 1) -- transforms the lever to "used"
        local skeleton = Tile(config.skeletonPosition):getItemById(config.corpseId)
        if skeleton then
            skeleton:remove() -- remove the skeleton corpse, you can also use skeleton:remove(1) it will remove one item not all from the tile
        end
    end
 
    return true
end
return lever:transform(lever:getId() == config.leverId and config.leverId + 1 or config.leverId)
 
Programming in Lua : 1

+ tfs functions:
functions - Pastebin.com
credits to @Static_

I will help you a little to start:

Code:
local config = {
    leverPosition = Position(x, y, z),
    leverId = ?,
 
    skeletonPosition = Position(x, y, z),
    corpseId = ?

}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local lever = Tile(config.leverPosition):getItemById(config.leverId) -- you need to define tile -> Tile(Position(1, 2, 7), getItemById(id) is function to get item from tile with id
    if lever then -- checks if lever exist
        lever:transform(config.leverId + 1) -- transforms the lever to "used"
        local skeleton = Tile(config.skeletonPosition):getItemById(config.corpseId)
        if skeleton then
            skeleton:remove() -- remove the skeleton corpse, you can also use skeleton:remove(1) it will remove one item not all from the tile
        end
    end
 
    return true
end
I will try. Thank you. I just do not have time to study now. But as soon as possible I see what I do or I'm going to find someone who does it for me hehe.
 
Back
Top