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

Action Might be good to someone: Desert Quest, easy to configure

Ezzam

New Member
Joined
Jan 16, 2008
Messages
213
Reaction score
2
Code:
function onUse(cid, item, frompos, item2, topos)
  local config = {
  --Lever IDs (Ignore unless you change lever)--
  switchUniqueID = 16000,
  switchID = 1945,
  switch2ID = 1946,

  --ItemID of all the items--
  swordID = 2376,
  crossbowID = 2455,
  appleID = 2674,
  spellbookID	= 2175,

  --Where the player should put the item--
  piece1pos = {x=32673, y=32083, z=8, stackpos=1}, --SwordID (Knight)--
  piece2pos = {x=32673, y=32094, z=8, stackpos=1}, --CrossbowID (Paladin)--
  piece3pos = {x=32667, y=32089, z=8, stackpos=1}, --AppleID (Druid)--
  piece4pos = {x=32679, y=32089, z=8, stackpos=1}, --SpellbookID (Sorcerer)--

  --Where you stand before the teleport--
  player1pos = {x=32673, y=32085, z=8, stackpos=253}, -- Knight (North)
  player2pos = {x=32673, y=32093, z=8, stackpos=253}, -- Paladin (South)
  player3pos = {x=32669, y=32089, z=8, stackpos=253}, -- Druid (West)
  player4pos = {x=32677, y=32089, z=8, stackpos=253}, -- Sorcerer (East)

  -- Where you get after the teleport --
  nplayer1pos = {x=32671, y=32069, z=8}, --Knight--
  nplayer2pos = {x=32672, y=32069, z=8}, --Paladin--
  nplayer3pos = {x=32671, y=32070, z=8}, --Druid--
  nplayer4pos = {x=32672, y=32070, z=8}  --Sorcerer--
}
  ----------------------------------------------
  ------------------Don't Edit------------------
  ----------------------------------------------
  --Checks IDs on the items--
  getpiece1 = getThingfromPos(config.piece1pos)
  getpiece2 = getThingfromPos(config.piece2pos)
  getpiece3 = getThingfromPos(config.piece3pos)
  getpiece4 = getThingfromPos(config.piece4pos)
  --Get player.uid from pos--
  player1 = getThingfromPos(config.player1pos)
  player2 = getThingfromPos(config.player2pos)
  player3 = getThingfromPos(config.player3pos)
  player4 = getThingfromPos(config.player4pos)
  --Checks vocation on players--
  knightvoc = getPlayerVocation(player1.uid)
  paladinvoc = getPlayerVocation(player2.uid)
  druidvoc = getPlayerVocation(player3.uid)
  sorcerervoc = getPlayerVocation(player4.uid)
  --Checks level on players--
  player1level = getPlayerLevel(player1.uid)
  player2level = getPlayerLevel(player2.uid)
  player3level = getPlayerLevel(player3.uid)
  player4level = getPlayerLevel(player4.uid)
 
  if knightvoc == 4 or knightvoc == 8 and paladinvoc == 3 or paladinvoc == 7 and druidvoc == 2 or druidvoc == 6 and sorcerervoc == 1 or sorcerervoc == 5 then
    if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then
      if player1level >= questlevel and player2level >= questlevel and player3level >= questlevel and	player4level >= questlevel then
        if item.uid == config.switchUniqueID and item.itemid == config.switchID and getpiece1.itemid == config.swordID and getpiece2.itemid == config.crossbowID and getpiece3.itemid == config.appleID and getpiece4.itemid == config.spellbookID then
          doSendMagicEffect(config.player1pos,2)
          doTeleportThing(player1.uid,config.nplayer1pos)
          doSendMagicEffect(config.nplayer1pos,10)
          doRemoveItem(getpiece1.uid,1)
          doSendMagicEffect(config.player2pos,2)
          doTeleportThing(player2.uid,config.nplayer2pos)
          doSendMagicEffect(config.nplayer2pos,10)
          doRemoveItem(getpiece2.uid,1)
          doSendMagicEffect(config.player3pos,2)
          doTeleportThing(player3.uid,config.nplayer3pos)
          doSendMagicEffect(config.nplayer3pos,10)
          doRemoveItem(getpiece3.uid,1)
          doSendMagicEffect(config.player4pos,2)
          doTeleportThing(player4.uid,config.nplayer4pos)	
          doSendMagicEffect(config.nplayer4pos,10)
          doRemoveItem(getpiece4.uid,1)
          doTransformItem(item.uid,item.itemid+1)
        elseif item.uid == switchUniqueID and item.itemid == switch2ID then
          doTransformItem(item.uid,item.itemid-1)
        else
          doPlayerSendCancel(cid,"Sorry, you need to put the correct stuffs at the correct basins.")
        end
      else
        doPlayerSendCancel(cid,"Sorry, all players in your team must to be level " .. questlevel .. ".")
      end
    else
      return FALSE
    end
  else
    doPlayerSendCancel(cid,"Sorry, all 4 players must be on right positions.")
  end
  return TRUE
end
 
For Mystic Spirit or Crying Damson, or both?
And what is it tested on?
 
It's made for Crying Damson, and i can't test it atm. My computer cant start any ot at all.

I get back my real computer tomorrow, then i check for bugs.
 
Hm, should work. But un-tested.

I'll see if i manage to get it to work. I'll get back here
 
Well good.

But seems quite messy, some loops and arrays would clean it up.
 
Actually, this is not easy to edit at all.
To me it seems like a bunch of uneccessary code thrown together.

I am assuming it atleast works? :huh:
 
Tested it now.. I got these errors


Code:
[02/12/2009 21:32:43] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:43] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:43] internalGetPlayerInfo(). Player not found

[02/12/2009 21:32:44] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:44] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:44] internalGetPlayerInfo(). Player not found

[02/12/2009 21:32:44] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:44] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:44] internalGetPlayerInfo(). Player not found

[02/12/2009 21:32:44] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:44] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:44] internalGetPlayerInfo(). Player not found

[02/12/2009 21:32:44] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:44] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:45] internalGetPlayerInfo(). Player not found

[02/12/2009 21:32:45] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:45] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:45] internalGetPlayerInfo(). Player not found

[02/12/2009 21:32:45] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:45] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:45] internalGetPlayerInfo(). Player not found

[02/12/2009 21:32:45] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:45] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:45] internalGetPlayerInfo(). Player not found

[02/12/2009 21:32:46] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:46] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:46] internalGetPlayerInfo(). Player not found

[02/12/2009 21:32:46] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:46] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:46] internalGetPlayerInfo(). Player not found

[02/12/2009 21:32:46] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:46] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:46] internalGetPlayerInfo(). Player not found

[02/12/2009 21:32:46] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:46] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:46] internalGetPlayerInfo(). Player not found

[02/12/2009 21:32:47] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:47] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:47] internalGetPlayerInfo(). Player not found

[02/12/2009 21:32:47] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:47] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:47] internalGetPlayerInfo(). Player not found

[02/12/2009 21:32:47] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:47] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:47] internalGetPlayerInfo(). Player not found

[02/12/2009 21:32:47] Lua Script Error: [Action Interface] 
[02/12/2009 21:32:48] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:32:48] internalGetPlayerInfo(). Player not found
 
When I try to use the script anyway I get this error (I did everything correct when testing and editing the config at the script :p)


Code:
[02/12/2009 21:36:42] Lua Script Error: [Action Interface] 
[02/12/2009 21:36:42] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:36:42] data/actions/scripts/banan.lua:58: attempt to compare nil with number
[02/12/2009 21:36:42] stack traceback:
[02/12/2009 21:36:42] 	data/actions/scripts/banan.lua:58: in function <data/actions/scripts/banan.lua:1>

[02/12/2009 21:36:48] Lua Script Error: [Action Interface] 
[02/12/2009 21:36:48] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:36:48] data/actions/scripts/banan.lua:58: attempt to compare nil with number
[02/12/2009 21:36:48] stack traceback:
[02/12/2009 21:36:48] 	data/actions/scripts/banan.lua:58: in function <data/actions/scripts/banan.lua:1>
[02/12/2009 21:36:48] Druidemolition has logged out.

[02/12/2009 21:36:49] Lua Script Error: [Action Interface] 
[02/12/2009 21:36:49] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:36:49] data/actions/scripts/banan.lua:58: attempt to compare nil with number
[02/12/2009 21:36:49] stack traceback:
[02/12/2009 21:36:49] 	data/actions/scripts/banan.lua:58: in function <data/actions/scripts/banan.lua:1>

[02/12/2009 21:36:50] Lua Script Error: [Action Interface] 
[02/12/2009 21:36:50] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:36:50] data/actions/scripts/banan.lua:58: attempt to compare nil with number
[02/12/2009 21:36:50] stack traceback:
[02/12/2009 21:36:50] 	data/actions/scripts/banan.lua:58: in function <data/actions/scripts/banan.lua:1>

[02/12/2009 21:36:50] Lua Script Error: [Action Interface] 
[02/12/2009 21:36:50] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:36:50] data/actions/scripts/banan.lua:58: attempt to compare nil with number
[02/12/2009 21:36:50] stack traceback:
[02/12/2009 21:36:50] 	data/actions/scripts/banan.lua:58: in function <data/actions/scripts/banan.lua:1>

[02/12/2009 21:36:50] Lua Script Error: [Action Interface] 
[02/12/2009 21:36:50] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:36:51] data/actions/scripts/banan.lua:58: attempt to compare nil with number
[02/12/2009 21:36:51] stack traceback:
[02/12/2009 21:36:51] 	data/actions/scripts/banan.lua:58: in function <data/actions/scripts/banan.lua:1>

[02/12/2009 21:36:51] Lua Script Error: [Action Interface] 
[02/12/2009 21:36:51] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:36:51] data/actions/scripts/banan.lua:58: attempt to compare nil with number
[02/12/2009 21:36:51] stack traceback:
[02/12/2009 21:36:51] 	data/actions/scripts/banan.lua:58: in function <data/actions/scripts/banan.lua:1>

[02/12/2009 21:36:51] Lua Script Error: [Action Interface] 
[02/12/2009 21:36:51] data/actions/scripts/banan.lua:onUse

[02/12/2009 21:36:51] data/actions/scripts/banan.lua:58: attempt to compare nil with number
[02/12/2009 21:36:51] stack traceback:
[02/12/2009 21:36:51] 	data/actions/scripts/banan.lua:58: in function <data/actions/scripts/banan.lua:1>
 
Actually, this is not easy to edit at all.
To me it seems like a bunch of uneccessary code thrown together.

I am assuming it atleast works? :huh:


Easy to configure i said, edit... That is another thing!
Saw it bugged, but then just use another script, there are alot out alredy (i think)
I just random write codes, dunt usually test them...
 
Back
Top