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

Solved Remove item which has been created in 10 minutes

Ray Rewind

Doctor
Joined
Jun 6, 2009
Messages
1,348
Reaction score
75
Location
Germany
Heya :)

I got this Action script

Code:
function onUse(cid, item, frompos, item2, topos)
local portal_quest01_pos = {x = 1152, y = 845, z = 2, stackpos = 2}
if item.uid == 32145 then
 if item.itemid == 1946 then

 player1pos = {x=1153, y=845, z=2, stackpos=253}
 player1 = getThingfromPos(player1pos)

 player2pos = {x=1154, y=845, z=2, stackpos=253}
 player2 = getThingfromPos(player2pos)


  if player1.itemid > 0 and player2.itemid > 0 then

  player1level = getPlayerLevel(player1.uid)
  player2level = getPlayerLevel(player2.uid)


  questlevel = 120

  if player1level >= questlevel then

     queststatus1 = getPlayerStorageValue(player1.uid,6300)
     queststatus2 = getPlayerStorageValue(player2.uid,6300)
     

     if queststatus1 == -1 and queststatus2 == -1 then

    if 1==1 then
    demon1pos = {x=1141, y=863, z=3}
        demon2pos = {x=1141, y=865, z=3}
   

   doSummonCreature("Baron Brute", demon1pos)
   doSummonCreature("The Axeorcist", demon2pos)

    nplayer1pos = {x=1129, y=865, z=3}
    nplayer2pos = {x=1129, y=866, z=3}
   

   doSendMagicEffect(player1pos,2)
   doSendMagicEffect(player2pos,2)
   doPlayerSendTextMessage(cid,22,"FIGHT!")
   

   doTeleportThing(player1.uid,nplayer1pos)
   doTeleportThing(player2.uid,nplayer2pos)
   doCreateItem(9772,1,portal_quest01_pos)
 
   

    doSendMagicEffect(nplayer1pos,10)
    doSendMagicEffect(nplayer2pos,10)


    doTransformItem(item.uid,1945)

    else
    doPlayerSendCancel(cid,"Sorry, not possible.")
    end
   else
    doPlayerSendCancel(cid,"Sorry, not possible.")
   end
  else
  doPlayerSendCancel(cid,"Sorry, not possible.")
  end
  end
 if item.uid == 32145 then
 if item.itemid == 1945 then
doTransformItem(item.uid,1946) 




end
end
 return 1
end
end
end

is it possible to remove the item


doCreateItem(9772,1,portal_quest01_pos)


after 10 minutes??
 
Code:
addEvent(function () local k = getTileItemById(portal_quest01_pos, 9772) if k.uid > 0 then doRemoveItem(k.uid, 1) end end, 10 * 60 * 1000)
 
@Ninja

like this ?

Code:
function onUse(cid, item, frompos, item2, topos)
local portal_quest01_pos = {x = 1152, y = 845, z = 2, stackpos = 2}
if item.uid == 32145 then
if item.itemid == 1946 then

player1pos = {x=1153, y=845, z=2, stackpos=253}
player1 = getThingfromPos(player1pos)

player2pos = {x=1154, y=845, z=2, stackpos=253}
player2 = getThingfromPos(player2pos)


  if player1.itemid > 0 and player2.itemid > 0 then

  player1level = getPlayerLevel(player1.uid)
  player2level = getPlayerLevel(player2.uid)


  questlevel = 120

  if player1level >= questlevel then

      queststatus1 = getPlayerStorageValue(player1.uid,6300)
      queststatus2 = getPlayerStorageValue(player2.uid,6300)
     

      if queststatus1 == -1 and queststatus2 == -1 then

    if 1==1 then
    demon1pos = {x=1141, y=863, z=3}
        demon2pos = {x=1141, y=865, z=3}
   
  doSummonCreature("Baron Brute", demon1pos)
  doSummonCreature("The Axeorcist", demon2pos)
 

    nplayer1pos = {x=1129, y=865, z=3}
    nplayer2pos = {x=1129, y=866, z=3}
   

  doSendMagicEffect(player1pos,2)
  doPlayerSendTextMessage(cid,22,"FIGHT!")
  doSendMagicEffect(player2pos,2)
  doPlayerSendTextMessage(cid,22,"FIGHT!")
 

  doTeleportThing(player1.uid,nplayer1pos)
  doTeleportThing(player2.uid,nplayer2pos)
 
  addEvent(function () local k = getTileItemById(portal_quest01_pos, 9772) if k.uid > 0 then doRemoveItem(k.uid, 1) end end, 10 * 60 * 1000)
 

    doSendMagicEffect(nplayer1pos,10)
    doSendMagicEffect(nplayer2pos,10)


    doTransformItem(item.uid,1945)

    else
    doPlayerSendCancel(cid,"Sorry, not possible.")
    end
  else
    doPlayerSendCancel(cid,"Sorry, not possible.")
  end
  else
  doPlayerSendCancel(cid,"Sorry, not possible.")
  end
  end
if item.uid == 32145 then
if item.itemid == 1945 then
doTransformItem(item.uid,1946)




end
end
return 1
end
end
end
 
Not tested, wrote in normal notepad:

Code:
function onUse(cid, item, frompos, topos)
 
    local c = {
        playerPos = {
            [1] = {x=1153, y=845, z=2, stackpos=1},
            [2] = {x=1153, y=845, z=2, stackpos=1},
        },
        newPlayerPos = {
            [1] = {x=1129, y=865, z=3},
            [2] = {x=1129, y=866, z=3},
        },
        demonPos = {
            [1] = {x=1141, y=863, z=3},
            [2] = {x=1141, y=865, z=3},
        },
        portal = {x=1152, y=845, z=2, stackpos=2},
        level = 120,
    }
 
    if item.itemid == 1946 then
        for i = 1, 2 do
            if getThingfromPos(c.playerPos[i]).itemid > 0 then
                if getPlayerLevel(getThingfromPos(c.playerPos[i]).uid) >= level then
                    if getPlayerStorageValue(getThingfromPos(c.playerPos[i]).uid, 6300) < 1 then
                        doSummonCreature("Baron Brute", c.demonPos[1])
                        doSummonCreature("The Axeorcist", c.demonPos[2])
                        doTeleportThing(getThingfromPos(c.playerPos[i]).uid, c.newPlayerPos[i])
                        doSendMagicEffect(c.playerPos[i], 2)
                        doSendMagicEffect(c.newPlayerPos[i], 10)
                        doPlayerSendTextMessage(getThingfromPos(c.PlayerPos[i]).uid, 22, "FIGHT!")
                    else
                        doPlayerSendCancel(cid, "You have already done this.")
                    end
                else
                    doPlayerSendCancel(cid, "One of you don't have the required level.")
                end
            else
                doPlayerSendCancel(cid, "You need to be 2 players.")
            end
        end
        local f = function()
            if getThingfromPos(c.portal).uid > 0 then
                doRemoveItem(getThingfromPos(c.portal).uid, 1)
            end
        end
        addEvent(f, 10 * 60 * 1000)
        doTransformItem(item.uid,1945)
    elseif item.itemid == 1945 then
        doTransformItem(item.uid, 1946)
    end
    return TRUE
end
 
Last edited:
Your script does not work only 1 player gets teleported lol


[13/03/2014 14:34:04] [Error - Action Interface]
[13/03/2014 14:34:04] data/actions/scripts/quests/zao/zao arena.lua:eek:nUse
[13/03/2014 14:34:04] Description:
[13/03/2014 14:34:04] data/actions/scripts/quests/zao/zao arena.lua:30: attempt to index field 'PlayerPos' (a nil value)
[13/03/2014 14:34:04] stack traceback:
[13/03/2014 14:34:04] data/actions/scripts/quests/zao/zao arena.lua:30: in function <data/actions/scripts/quests/zao/zao arena.lua:1>
 
Change
Code:
doPlayerSendTextMessage(getThingfromPos(c.PlayerPos).uid, 22, "FIGHT!")
to
Code:
doPlayerSendTextMessage(getThingfromPos(c.newPlayerPos[i]).uid, 22, "FIGHT!")
you teleport the Player away, so you wont get an UID from the old pos, you have to get the Player from the new pos
 
Last edited:
Your script does not work only 1 player gets teleported lol


[13/03/2014 14:34:04] [Error - Action Interface]
[13/03/2014 14:34:04] data/actions/scripts/quests/zao/zao arena.lua:eek:nUse
[13/03/2014 14:34:04] Description:
[13/03/2014 14:34:04] data/actions/scripts/quests/zao/zao arena.lua:30: attempt to index field 'PlayerPos' (a nil value)
[13/03/2014 14:34:04] stack traceback:
[13/03/2014 14:34:04] data/actions/scripts/quests/zao/zao arena.lua:30: in function <data/actions/scripts/quests/zao/zao arena.lua:1>

I wrote it in a normal notepad while i was at work, didn't test and almost didn't check anything
+ the positions in playerPos[1] and [2] was the same, fixed now

Change
Code:
doPlayerSendTextMessage(getThingfromPos(c.PlayerPos).uid, 22, "FIGHT!")
to
Code:
doPlayerSendTextMessage(getThingfromPos(c.newPlayerPos[i]).uid, 22, "FIGHT!")
you teleport the Player away, so you wont get an UID from the old pos, you have to get the Player from the new pos

Just move that line over the doTeleport and it will be called before they get teleported

on topic:

fixed the error and moved some lines, check if it works better now:

Code:
function onUse(cid, item, frompos, topos)
    local c = {
        playerPos = {
            [1] = {x=1153, y=845, z=2, stackpos=1},
            [2] = {x=1154, y=845, z=2, stackpos=1},
        },
        newPlayerPos = {
            [1] = {x=1129, y=865, z=3},
            [2] = {x=1129, y=866, z=3},
        },
        demonPos = {
            [1] = {x=1141, y=863, z=3},
            [2] = {x=1141, y=865, z=3},
        },
        portal = {x=1152, y=845, z=2, stackpos=2},
        level = 120,
    }
    if item.itemid == 1946 then
        for i = 1, 2 do
            if getThingfromPos(c.playerPos[i]).itemid > 0 then
                if getPlayerLevel(getThingfromPos(c.playerPos[i]).uid) >= level then
                    if getPlayerStorageValue(getThingfromPos(c.playerPos[i]).uid, 6300) < 1 then
                        doCreateItem(9772, 1, c.portal)
                        doSummonCreature("Baron Brute", c.demonPos[1])
                        doSummonCreature("The Axeorcist", c.demonPos[2])
                        doPlayerSendTextMessage(getThingfromPos(c.playerPos[i]).uid, 22, "FIGHT!")
                        doTeleportThing(getThingfromPos(c.playerPos[i]).uid, c.newPlayerPos[i])
                        doSendMagicEffect(c.playerPos[i], 2)
                        doSendMagicEffect(c.newPlayerPos[i], 10)
                    else
                        doPlayerSendCancel(cid, "You have already done this.")
                    end
                else
                    doPlayerSendCancel(cid, "One of you don't have the required level.")
                end
            else
                doPlayerSendCancel(cid, "You need to be 2 players.")
            end
        end
        local f = function()
            if getThingfromPos(c.portal).uid > 0 then
                doRemoveItem(getThingfromPos(c.portal).uid, 1)
            end
        end
        addEvent(f, 10 * 60 * 1000)
        doTransformItem(item.uid,1945)
    elseif item.itemid == 1945 then
        doTransformItem(item.uid, 1946)
    end
    return TRUE
end
 
Last edited:
Under if item.itemid == 1946 then, add
Code:
local n = 0
for x = 1, 2 do
     if getThingfromPos(c.playerPos[x]).itemid > 0 then
         n = n + 1
     end
end

Then instead of if getThingfromPos(c.playerPos).itemid > 0 then (under for i = 1, 2 do)
Code:
if n == 2 then
 
Well Ty @Limos

now script works but it always summon

4 Creatures even it has to be 2

its the Zao Arena Quest. :(

I found this script for rev 0.3.7

but I got TFS 0.3.6

is it possible to convert it?


Code:
local t, player = {
pedestals = {
{x=1153, y=845, z=2},
{x=1154, y=845, z=2}
},
newPos = {
{x=1128, y=865, z=3},
{x=1128, y=866, z=3}
},
area = {
fromX = 1151, toX = 1155,
fromY = 845, toY = 847,
z = 2
},
storageDone = 4746,
level = 120
}, {0, 0}

function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
local creaturesList = {}
for x = -radiusx, radiusx do
for y = -radiusy, radiusy do
if not (x == 0 and y == 0) then
creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = 253})
if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
table.insert(creaturesList, creature.uid)
end
end
end
end

local creature = getTopCreature(position)
if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
if not(table.find(creaturesList, creature.uid)) then
table.insert(creaturesList, creature.uid)
end
end
return creaturesList
end

function Wave1()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Baron Brute', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('The Axeorcist', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave2, 30 * 1000)
end

function Wave2()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Menace', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Fatality', {x= 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave3, 35 * 1000)
end

function Wave3()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Incineron', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Coldheart', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave4, 40 * 1000)
end

function Wave4()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Dreadwing', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Doomhowl', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave5, 40 * 1000)
end

function Wave5()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Haunter', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('The Dreadorian', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave6, 40 * 1000)
end

function Wave6()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Rocko', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Tremorak', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave7, 40 * 1000)
end

function Wave7()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Tirecz', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
local failed = false
for i = 1, #t.pedestals do
player = getTopCreature(t.pedestals).uid
if(not(player > 0 and isPlayer(player) == TRUE and getPlayerStorageValue(player, t.storageDone) < 1 and getPlayerLevel(player) >= t.level)) then
failed = true
break
end
end
if not failed then
if #getCreaturesInRange({x=1137, y=864,z=3}, 10, 9, FALSE, TRUE) > 0 then
doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT, "Another Team is fighting in the Arena.")
return true
end
for i = 1, #player do
doTeleportThing(player, t.newPos)
end
Wave1()
doTransformItem(item.uid, 1946)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
end
return true
end
 
Last edited:
This looks like it will work fine for 0.3.6, just try it and post errors if not. should be easy enough to fix.

Well Ty @Limos

now script works but it always summon

4 Creatures even it has to be 2

its the Zao Arena Quest. :(

I found this script for rev 0.3.7

but I got TFS 0.3.6

is it possible to convert it?

Code:
local t, player = {
pedestals = {
{x=1153, y=845, z=2},
{x=1154, y=845, z=2}
},
newPos = {
{x=1128, y=865, z=3},
{x=1128, y=866, z=3}
},
area = {
fromX = 1151, toX = 1155,
fromY = 845, toY = 847,
z = 2
},
storageDone = 4746,
level = 120
}, {0, 0}

function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
local creaturesList = {}
for x = -radiusx, radiusx do
for y = -radiusy, radiusy do
if not (x == 0 and y == 0) then
creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = 253})
if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
table.insert(creaturesList, creature.uid)
end
end
end
end

local creature = getTopCreature(position)
if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
if not(table.find(creaturesList, creature.uid)) then
table.insert(creaturesList, creature.uid)
end
end
return creaturesList
end

function Wave1()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Baron Brute', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('The Axeorcist', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave2, 30 * 1000)
end

function Wave2()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Menace', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Fatality', {x= 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave3, 35 * 1000)
end

function Wave3()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Incineron', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Coldheart', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave4, 40 * 1000)
end

function Wave4()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Dreadwing', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Doomhowl', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave5, 40 * 1000)
end

function Wave5()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Haunter', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('The Dreadorian', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave6, 40 * 1000)
end

function Wave6()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Rocko', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Tremorak', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave7, 40 * 1000)
end

function Wave7()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Tirecz', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
local failed = false
for i = 1, #t.pedestals do
player = getTopCreature(t.pedestals).uid
if(not(player > 0 and isPlayer(player) == TRUE and getPlayerStorageValue(player, t.storageDone) < 1 and getPlayerLevel(player) >= t.level)) then
failed = true
break
end
end
if not failed then
if #getCreaturesInRange({x=1137, y=864,z=3}, 10, 9, FALSE, TRUE) > 0 then
doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT, "Another Team is fighting in the Arena.")
return true
end
for i = 1, #player do
doTeleportThing(player, t.newPos)
end
Wave1()
doTransformItem(item.uid, 1946)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
end
return true
end
 
In relpy to Ray Rewind:

Move
doSummonCreature("Baron Brute", c.demonPos[1])
doSummonCreature("The Axeorcist", c.demonPos[2])
Above
local f = function()
 
@dchampag

I tried to use the script lever is not working :(

Code:
    <action uniqueid="32145" event="script" value="quests/zao/zaonew.lua"/>

Code:
local t, player = {
pedestals = {
{x=1153, y=845, z=2},
{x=1154, y=845, z=2}
},
newPos = {
{x=1128, y=865, z=3},
{x=1128, y=866, z=3}
},
area = {
fromX = 1151, toX = 1155,
fromY = 845, toY = 847,
z = 2
},
storageDone = 4746,
level = 120
}, {0, 0}

function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
local creaturesList = {}
for x = -radiusx, radiusx do
for y = -radiusy, radiusy do
if not (x == 0 and y == 0) then
creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = 253})
if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
table.insert(creaturesList, creature.uid)
end
end
end
end

local creature = getTopCreature(position)
if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
if not(table.find(creaturesList, creature.uid)) then
table.insert(creaturesList, creature.uid)
end
end
return creaturesList
end

function Wave1()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Baron Brute', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('The Axeorcist', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave2, 30 * 1000)
end

function Wave2()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Menace', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Fatality', {x= 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave3, 35 * 1000)
end

function Wave3()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Incineron', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Coldheart', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave4, 40 * 1000)
end

function Wave4()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Dreadwing', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Doomhowl', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave5, 40 * 1000)
end

function Wave5()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Haunter', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('The Dreadorian', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave6, 40 * 1000)
end

function Wave6()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Rocko', {x = 1139, y = 864, z = 3})), CONST_ME_TELEPORT)
doSendMagicEffect(getCreaturePosition(doCreateMonster('Tremorak', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
addEvent(Wave7, 40 * 1000)
end

function Wave7()
doSendMagicEffect(getCreaturePosition(doCreateMonster('Tirecz', {x = 1139, y = 866, z = 3})), CONST_ME_TELEPORT)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
local failed = false
for i = 1, #t.pedestals do
player = getTopCreature(t.pedestals).uid
if(not(player > 0 and isPlayer(player) == TRUE and getPlayerStorageValue(player, t.storageDone) < 1 and getPlayerLevel(player) >= t.level)) then
failed = true
break
end
end
if not failed then
if #getCreaturesInRange({x=1137, y=864,z=3}, 10, 9, FALSE, TRUE) > 0 then
doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT, "Another Team is fighting in the Arena.")
return true
end
for i = 1, #player do
doTeleportThing(player, t.newPos)
end
Wave1()
doTransformItem(item.uid, 1946)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
end
return true
end
 
Back
Top