• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

TFS 0.X TFS 0.3.7 Special Effect on Quest Box

OTcreator

Well-Known Member
Joined
Feb 14, 2022
Messages
509
Solutions
1
Reaction score
59
Hello!
In map i have BOX with etc: Action ID: XXXX ,UID: XXXX (QUEST).
I need script , maybe globalevents?
ETC: When Action ID > 1999 on postition (QUEST BOX or on position AID) --- magic efect or other efects.

I need show in map all quests for new player. Maybe possible to make light in box?
 
Indeed, we need a globalevent and since you are setting UIDs we can use them as position
LUA:
local positions = {
    {17500 -- Box UID, CONST_ME_MAGIC_BLUE};
    {17501 -- Box UID, CONST_ME_MAGIC_RED};
}
 
function onThink(interval, lastExecution)
    for i = 1, #positions do
        local tile = getThingPos(positions[i][1])
        if tile then
            doSendMagicEffect(tile, positions[i][2])
        end
    end
    return true
end

You could also add some marks on minimap, using same UIDs and trigger it onLogin
LUA:
local positions = {
    {17500, "Plate Armor Quest"};
    {17501, "Dragon Shield Quest"};
}
for i = 1, #positions do
    local tile = getThingPos(positions[i][1])
    if tile then
        doPlayerAddMapMark(cid, tile, 0x03, positions[i][2])
    end
end
Not sure if thats what you requested tho
 
Indeed, we need a globalevent and since you are setting UIDs we can use them as position
LUA:
local positions = {
    {17500 -- Box UID, CONST_ME_MAGIC_BLUE};
    {17501 -- Box UID, CONST_ME_MAGIC_RED};
}
 
function onThink(interval, lastExecution)
    for i = 1, #positions do
        local tile = getThingPos(positions[i][1])
        if tile then
            doSendMagicEffect(tile, positions[i][2])
        end
    end
    return true
end

You could also add some marks on minimap, using same UIDs and trigger it onLogin
LUA:
local positions = {
    {17500, "Plate Armor Quest"};
    {17501, "Dragon Shield Quest"};
}
for i = 1, #positions do
    local tile = getThingPos(positions[i][1])
    if tile then
        doPlayerAddMapMark(cid, tile, 0x03, positions[i][2])
    end
end
Not sure if thats what you requested tho

All work perfect, but how i can change effect to stackpos = 0?
Now all effects view on the quest chest not on the ground.
I use effect (ground tutorial).
 
Last edited:
Yes, just put inside the tile condition
LUA:
tile.stackpos = 0


I think thats how effects works

LUA:
function onThink(interval, lastExecution)
    for i = 1, #positions do
        local tile = getThingPos(positions[i][1])
        if tile then
            doSendMagicEffect(tile.stackpos = 0, positions[i][2])
        end
    end
    return true
end

I change that, and not working... Maybe becouse function [getThingPos] read position and stackpos chest?
 
Last edited:
LUA:
function onThink(interval, lastExecution)
    for i = 1, #positions do
        local tile = getThingPos(positions[i][1])
        if tile then
            doSendMagicEffect(tile.stackpos = 0, positions[i][2])
        end
    end
    return true
end

I change that, and not working... Maybe becouse function [getThingPos] read position and stackpos chest?
LUA:
tile.stackpos = 0
doSendMagicEffect(tile, positions[i][2])
 
Can you add full code? Please :(

LUA:
function onThink(interval, lastExecution)
    for i = 1, #positions do
        local tile = getThingPos(positions[i][1])
        if tile then
            tile.stackpos = 0
            doSendMagicEffect(tile, positions[i][2])
        end
    end
    return true
end
 
LUA:
function onThink(interval, lastExecution)
    for i = 1, #positions do
        local tile = getThingPos(positions[i][1])
        if tile then
            tile.stackpos = 0
            doSendMagicEffect(tile, positions[i][2])
        end
    end
    return true
end

Not work... Can you see efect number (light)?
 
Back
Top