• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

TFS 1.X+ onAdditem tfs 1.5 7.72

bpm91

Well-Known Member
Joined
May 23, 2019
Messages
616
Solutions
7
Reaction score
64
Location
Brazil
hello, I have a small problem, when playing the item in the position in movements the item should be teleported when falling on top of that position but it doesn't happen, because my script is version 0.4 can someone help me convert to 1.5?


<movevent event="AddItem" pos="32701,31637,6" script="pisodemona.lua"/>

Lua:
local positionTo = {x=32817, y=31600, z=9} -- Position para onde o item vai ser mandado

    function onAddItem(item, tile, pos)

        if not isInArray(item_exceptions, item.itemid) then

            doTeleportThing(item.uid, positionTo)
            doSendMagicEffect(pos, 10)
        end

        return true

    end
 

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,806
Solutions
18
Reaction score
534
Location
Poland
Just read & change it analogically to your needs :
XML:
<movevent event="AddItem" tileitem="1" itemid="1387" script="others/itemteleports.lua" />
<!-- aid methods -->
<movevent event="AddItem" tileitem="1" fromaid="50240" toaid="50241" script="others/itemteleports.lua" />
Lua:
ItemTeleports = {
    [5630] = {destination = Position(33145, 32863, 7), effect = CONST_ME_MAGIC_GREEN},
    [5631] = {destination = Position(33147, 32864, 7), effect = CONST_ME_MAGIC_GREEN},

    -- Rookgaard level bridge
    [50240] = {destination = Position(32092, 32177, 6), effect = CONST_ME_MAGIC_BLUE},
    -- Rookgaard premium bridge
    [50241] = {destination = Position(32066, 32192, 7), effect = CONST_ME_MAGIC_BLUE}
}

function onAddItem(moveitem, tileitem, position)
    local setting = ItemTeleports[tileitem.actionid]
    if not setting then
        return true
    end

    moveitem:moveTo(setting.destination)
    setting.destination:sendMagicEffect(setting.effect)
    return true
end
 
OP
OP
bpm91

bpm91

Well-Known Member
Joined
May 23, 2019
Messages
616
Solutions
7
Reaction score
64
Location
Brazil
I tried to adapt but I still can't understand how to move movements

<movevent event="AddItem" tileitem="1" actionid="5566" script="pisodemona.lua"/>

any item thrown on top of item 2610 must be teleported, and would not be a tile


Lua:
ItemTeleports = {
    [2610] = {destination = Position(32699, 31637, 6), effect = CONST_ME_MAGIC_GREEN},
    
    }

function onAddItem(moveitem, tileitem, position)
    local setting = ItemTeleports[tileitem.actionid]
    if not setting then
        return true
    end

    moveitem:moveTo(setting.destination)
    setting.destination:sendMagicEffect(setting.effect)
    return true
end








1650456511963.png
 

mano368

Intermediate OT User
Joined
Sep 2, 2011
Messages
349
Solutions
35
Reaction score
141
Location
Brazil
I tried to adapt but I still can't understand how to move movements

<movevent event="AddItem" tileitem="1" actionid="5566" script="pisodemona.lua"/>

any item thrown on top of item 2610 must be teleported, and would not be a tile


Lua:
ItemTeleports = {
    [2610] = {destination = Position(32699, 31637, 6), effect = CONST_ME_MAGIC_GREEN},
   
    }

function onAddItem(moveitem, tileitem, position)
    local setting = ItemTeleports[tileitem.actionid]
    if not setting then
        return true
    end

    moveitem:moveTo(setting.destination)
    setting.destination:sendMagicEffect(setting.effect)
    return true
end








View attachment 67175
Eu não sei se você ja resolveu isso, mas me parece que na tag do xml você poem um action e dentro do script voce coloca outro.

de qualquer forma, acredito que na tag xml você deva colocar como itemid=2610 e no script, trocar o 2610 pelo actionid que seria 5566.

XML:
<movevent event="AddItem" tileitem="1" itemid="2610" script="pisodemona.lua"/>

Lua:
ItemTeleports = {
    [5566] = {destination = Position(32699, 31637, 6), effect = CONST_ME_MAGIC_GREEN},
    
    }

function onAddItem(moveitem, tileitem, position)
    local setting = ItemTeleports[tileitem.actionid]
    if not setting then
        return true
    end

    moveitem:moveTo(setting.destination)
    setting.destination:sendMagicEffect(setting.effect)
    return true
end

se vai funcionar, realmente não sei, mas acredito que era isto que estava errado!
 

Datero

New Member
Joined
Apr 16, 2013
Messages
6
Reaction score
1
I hope, this will help, a little bit, this is from tfs 1,2.


Lua:
<movevent event="AddItem" tileitem="1" itemid="2610" script="pisodemona.lua" />
    <movevent event="AddItem" moveitem="1" itemid="2363" script="pisodemona.lua" />

Code:
local sacrificial_stone = 2610
local blood_orb = 2363 -- moved item to sacrificial stone
local positionq = {x = 32097, y = 32215, z = 7} -- position of sacrificial stone
local relocate = {
   [1] = {x = 32097, y = 32215, z = 7},
   [2] = {x = 32100, y = 32212, z = 7}
}

function onAddItem(moveitem, tileitem, position)      
        if tileitem.itemid == 2610 and moveitem.itemid == 2363 then
                --moveitem:remove() -- delete item after insert on sacrificial stone
                doSendMagicEffect(positionq, CONST_ME_MAGIC_GREEN)
                doRelocate(relocate[1], relocate[2]) -- move from [1], to [2]
        end
    return true
end
 
Last edited:
Top