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

Change effect on Custom Portal [Help]

Maltexor

Active Member
Joined
Mar 9, 2014
Messages
214
Reaction score
40
Location
Germany
So yea i made an Custom Portal u can see it on my Image i just changed it to Portable in items.xml RME and TFS 1.0 so its now like a normal Blue Portal wich i can edit on RME (for Pos).

But i want a Custom effect (effect is Nr:47) if i walk on my Purple Portal i get a Purple Energy Field Effect.
But if i walk on normal Blue Portal i want the normal BLue effect but if thats not pssoible i dont care^^

Portal Item ID: 11798

lA72c.jpg



I guess i need to edit and recompile tfs?
 
Last edited:
Got it already!


movements.xml
Code:
    <movevent event="StepIn" itemid="11798"  script="customtp.lua"/>


customtp.lua

Code:
local teleports = {
-- uid = {position={}, level=x, effect=x}
[5548] = { -- Depot to Shops
position = {x= 1279, y=1026, z=7}, --- th eplace where the item with this unique id will send players to
level = 1, -- make it 1 if you want like all lvs to eneter
effect = 47, -- remove this line to ignore effect
group = 1 -- set to 1 if you want all kinds of player use the tp ( check groups numbers in group.xml)
},
[5549] = { --Shops to Depot
position = {x= 1033, y=1025, z=7},
level = 1,
effect = 47,
group = 1
},
}
function onStepIn(cid, item, position, fromPosition)
-- get table with attributes from 'teleports' table by unique id
local options = teleports[item.uid]
if(not options) then -- check if positions exists (this is not really required - just in case you declare something wrong in movements.xml)
return TRUE -- just exit script, it won't continue executing
end
if getPlayerLookDir(cid) == 0 then
newdir = 2
elseif getPlayerLookDir(cid) == 1 then
newdir = 3
elseif getPlayerLookDir(cid) == 2 then
newdir = 0
else
newdir = 1
end

if(getPlayerLevel(cid) < options.level) then -- check if player have level
doPlayerSendCancel(cid, "Sorry, your level is to low for this teleport.")
doMoveCreature(cid, newdir)
return TRUE
end

if(getPlayerGroupId(cid) < options.group) then -- check if player have level
doPlayerSendCancel(cid, "Sorry, your group is to low for this teleport.")
doMoveCreature(cid, newdir)
return TRUE
end
doTeleportThing(cid, options.position) -- teleport player to dest
if(options.effect) then -- check if effect is specified
doSendMagicEffect(getCreaturePosition(cid), options.effect)
end
return TRUE
end


How it shows up:

Xohwf.jpg
 
Last edited:
Back
Top