narko
vertrauenswürdig ~
Anty Trap Tile
./data/movements/Movement.xml
Code:
<movevent type="StepIn" actionid="15123" event="script" value="traptile.lua"/>
<movevent type="StepOut" actionid="15133" event="script" value="traptile.lua"/>
./data/movements/scrips/traptile.lua :
Code:
local session, events =
15 * 60, {}
function train(cid, time)
if isPlayer(cid) then
if os.time() - time >= session then
events[getPlayerGUID(cid)] = nil
doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -5105, -10250, CONST_ME_NONE)
doTeleportThing(cid, getPlayerMasterPos(cid))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your trap tile has been expire. Thanks for playing Neroxia.")
else
events[getPlayerGUID(cid)] = addEvent(train, 3000, cid, time)
local v = getThingPos(cid)
doSendAnimatedText(v, 'Trap Tile!', TEXTCOLOR_RED)
doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -105, -250, CONST_ME_NONE)
doSendMagicEffect(v, CONST_ME_MAGIC_GREEN)
end
end
end
function onStepIn(cid, item, pos, fromPos)
if isPlayer(cid) then
train(cid, os.time())
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Warning!You are in trap tile.")
end
end
function onStepOut(cid, item, pos, fromPos)
if isPlayer(cid) then
local v = getPlayerGUID(cid)
if v then
stopEvent(events[v])
events[v] = nil
end
end
end