MOD perfect Svargrond Arena System!

Discussion in 'Mods & Lua Functions' started by TomCrusher, Jan 20, 2010.

  1. jonasu

    jonasu New Member

    Joined:
    Nov 3, 2009
    Messages:
    73
    Likes Received:
    4
    Best Answers:
    0
    Been trying to figure this one out.. I removed all the old scripts and changed locations etc. However the doors worked at first but they stopped working after i removed the old script. I changed the ids of the doors in config but the teleportal is still not working. It says you have been kicked. The portals have action id 42300. I'm using the real map released by frankFarmer. Help would be strongly appreciated!
     
  2. Dankoo

    Dankoo Well-Known Member

    Joined:
    Sep 4, 2010
    Messages:
    1,006
    Likes Received:
    28
    Best Answers:
    0
    Great script, thank you!!

    PS: NPC could be as good as the mod, ehn? :]
     
  3. BeniS

    BeniS Well-Known Member

    Joined:
    Aug 8, 2009
    Messages:
    1,849
    Likes Received:
    176
    Best Answers:
    0
    Cheers man :)
     
  4. Sweddy

    Sweddy Well-Known Member

    Joined:
    Feb 14, 2009
    Messages:
    2,907
    Likes Received:
    100
    Best Answers:
    0
    Please Rehost Map...
     
  5. Sweddy

    Sweddy Well-Known Member

    Joined:
    Feb 14, 2009
    Messages:
    2,907
    Likes Received:
    100
    Best Answers:
    0
    Please? :p
     
  6. Gryffian

    Gryffian ununderstandable

    Joined:
    Aug 10, 2010
    Messages:
    203
    Likes Received:
    2
    Best Answers:
    0
    Damn. So needed script. Thanks!
     
  7. orejon

    orejon New Member

    Joined:
    Jun 24, 2008
    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    The download is not erased it already :S
     
  8. Sir MoX

    Sir MoX New Member

    Joined:
    Jan 14, 2009
    Messages:
    285
    Likes Received:
    1
    Best Answers:
    0
    the link of the map its wrong =/
     
  9. Kudzu

    Kudzu Active Member

    Joined:
    Apr 9, 2008
    Messages:
    512
    Likes Received:
    37
    Best Answers:
    0
    Work great on DEV 0.4 Thanks! :*
     
  10. Knight God

    Knight God Active Member

    Joined:
    Oct 19, 2008
    Messages:
    1,180
    Likes Received:
    20
    Best Answers:
    0
    tfs 0.4

     
  11. Knight God

    Knight God Active Member

    Joined:
    Oct 19, 2008
    Messages:
    1,180
    Likes Received:
    20
    Best Answers:
    0
  12. Cykotitan

    Cykotitan Experienced G'

    Joined:
    Nov 4, 2008
    Messages:
    16,897
    Likes Received:
    807
    Best Answers:
    1
  13. venom1012

    venom1012 New Member

    Joined:
    Apr 24, 2008
    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    hello, I got the following error, I pay the npc it says it already can do just that when the arena will open the door the following message appears It is locked. and the doors have the following script ID 42357, thanks.
     
  14. szeos

    szeos Member

    Joined:
    Sep 16, 2010
    Messages:
    190
    Likes Received:
    7
    Best Answers:
    0
    to everyone who have this same problem like this.

    Edit NPC Arener not Halvar or make new npc in map Editor
     
  15. cinuslca

    cinuslca New Member

    Joined:
    Jan 29, 2010
    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    When i killing monster Frostfur , my server its crashed don't know with what i have problem.



    [​IMG]

    PHP:
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <mod name="Arena Svargrond"
    3.  
    4. version="1.0" author="Tommy" contact="[email protected]" enabled="yes">
    5.  
    6. <config name="arenaFunctions"><![CDATA[
    7. KickPosition = {x=32310, y=31149, z=7} --if the player leave the arena or time is over, where he go.
    8. RewardsRoom = {x=32312, y=31134, z=6} --rewards room position.
    9. arenaRoomMaxTime = 240 --max time for each room 240 = 4 min.
    10. OpenDoorsID = 5127 --if you change doors item ids, change me =D
    11.  
    12.  
    13. TimeStor = 42350 --here will be saved the time.
    14. myArenaLevel = 45450 --here will be saved the arena level.
    15. talkNPC = 45451 --Storage to check if the player have paid to the npc and can enter to the arena.
    16. RewardsStor = {42361, 42371, 42381} --Storage for greenshore, scrapper, warlord.
    17. isIN = 42352 --to check if the player is in the arena.
    18. myRoom = 46000 --here will be saved the current room.
    19. MonStor = 47000 --here will be saved the monster uid.
    20.  
    21.  
    22. DoorsActID = 42357 --Doors near the npc.
    23. LeavePortals = 42321 --The action id of the portal to leave the rooms (south portals).
    24. GobletTiles = {42360, 42370, 42380} --Action ids of the tiles for Bronze, Silver and Gold Goblets.
    25.  
    26. Cancel = {
    27.     --message when use door and have not paid to the npc.
    28.     [1] = "You have not paid NPC yet.",
    29.     --message when leave arena.
    30.     [2] = "You have been kicked.!",
    31.     --message when the player can't get the reward.
    32.     [3] = "You can\'t get this item",
    33.     --message when already got any reward.
    34.     [4] = "It is empty.",
    35.     --when try to open a reward door and haven't completed the level.
    36.     [5] = "You have not finished this arena level.",
    37.     --NPC answer if the player completed all arena levels.
    38.     [6] = "You already did all the arena levels.",
    39.     --message when time is over
    40.     [7] = "The time is over.",
    41.     --message when you can go to the next room, LoL >_> this is not a cancel btw.
    42.     [8] = "You can go to the next room.",
    43.     --when try to go to the next room and not killed the monster yet.
    44.     [9] = "Kill the monster first",
    45.     --when try to go to the next room but there is a player yet...this text will be PLAYERNAME + this text
    46.     [10] = "is in the room yet."
    47.     }
    48.  
    49. Completed = {
    50.     [1] = "Congatulations! you have completed the arena in",
    51.     --HERE WILL BE THE ARENA NAME.
    52.     [2] = "difficulty!, now go and take your reward."}
    53.     --then the message will be "Congatulations! you have completed the arena in greenshore/scrapper/warlord difficulty!, now go and take your reward."
    54.    
    55.  
    56. Arena = {
    57.     --greenshore
    58.     [0] = {
    59.         Cost = 10000,
    60.         LevelName = 'greenshore',
    61.         LevelNeeded = 30,
    62.         Goblet = 5807
    63.         },
    64.     --scrapper
    65.     [1] = {
    66.         Cost = 50000,
    67.         LevelName = 'scrapper',
    68.         LevelNeeded = 50,
    69.         Goblet = 5806
    70.         },
    71.     --warlord
    72.     [2] = {
    73.         Cost = 100000,
    74.         LevelName = 'warlord',    
    75.         LevelNeeded = 80,
    76.         Goblet = 5805
    77.         }
    78.     }
    79.  
    80.  
    81. Rewards = {
    82.     --greenshore
    83.     --present with items.
    84.     [42361] = {
    85.         Stor = RewardsStor[1],
    86.         Cont = 1990,
    87.         items = {7372, 6569, 6574, 2114},
    88.         count = {1, 10, 1, 1}
    89.         },
    90.     --blacksteel sword.
    91.     [42362] = {
    92.         Stor = RewardsStor[1],
    93.         Cont = nil,
    94.         item = 7406
    95.         },
    96.     --headchopper.
    97.     [42363] = {
    98.         Stor = RewardsStor[1],
    99.         Cont = nil,
    100.         item = 7380
    101.         },
    102.     --orcish maul.
    103.     [42364] = {
    104.         Stor = RewardsStor[1],
    105.         Cont = nil,
    106.         item = 7392
    107.         },
    108.     --backpack with items.
    109.     [42365] = {
    110.         Stor = RewardsStor[1],
    111.         Cont = 7342,
    112.         items = {7365, 7364},
    113.         count = {100, 100}
    114.         },
    115.     --scrapper
    116.     --present with items.
    117.     [42371] = {
    118.         Stor = RewardsStor[2],
    119.         Cont = 1990,
    120.         items = {7372, 6569, 6574, 7183},
    121.         count = {1, 10, 1, 1}
    122.         },
    123.     --mystic blade.
    124.     [42372] = {
    125.         Stor = RewardsStor[2],
    126.         Cont = nil,
    127.         item = 7384
    128.         },
    129.     --heroic axe.
    130.     [42373] = {
    131.         Stor = RewardsStor[2],
    132.         Cont = nil,
    133.         item = 7389
    134.         },
    135.     --cranial basher
    136.     [42374] = {
    137.         Stor = RewardsStor[2],
    138.         Cont = nil,
    139.         item = 7415
    140.         },
    141.     --backpack with items.
    142.     [42375] = {
    143.         Stor = RewardsStor[2],
    144.         Cont = 7342,
    145.         items = {7365, 2547, 2547, 2311, 2304},
    146.         count = {100, 100, 100, 50, 50}
    147.         },
    148.     --warlord
    149.     --present with items.
    150.     [42381] = {
    151.         Stor = RewardsStor[3],
    152.         Cont = 1990,
    153.         items = {7372, 6569, 6574, 6568},
    154.         count = {1, 10, 1, 1}
    155.         },
    156.     --justice seeker
    157.     [42382] = {
    158.         Stor = RewardsStor[3],
    159.         Cont = nil,
    160.         item = 7390
    161.         },
    162.     --royal axe.
    163.     [42383] = {
    164.         Stor = RewardsStor[3],
    165.         Cont = nil,
    166.         item = 7434
    167.         },
    168.     --blessed sceptre.
    169.     [42384] = {
    170.         Stor = RewardsStor[3],
    171.         Cont = nil,
    172.         item = 7429
    173.         },
    174.     --backpack with items.
    175.     [42385] = {
    176.         Stor = RewardsStor[3],
    177.         Cont = 7342,
    178.         items = {2273, 2268, 7443, 7440, 7529},
    179.         count = {50, 50, 1, 1, 100}
    180.         }
    181.     }
    182.  
    183. arena_monsters = {
    184.     --greenshore                            -scrapper                            --warlord
    185.     [45300] = "Frostfur",                [45310] = "Avalanche",            [45320] = "Webster",
    186.     [45301] = "Bloodpaw",                [45311] = "Kreebosh the Exile",    [45321] = "Darakan the Executioner",
    187.     [45302] = "Bovinus",                [45312] = "The Dark Dancer",    [45322] = "Norgle Glacierbeard",
    188.     [45303] = "Achad",                    [45313] = "The Hag",            [45323] = "The Pit Lord",
    189.     [45304] = "Colerian The Barbarian",    [45314] = "Slim",                [45324] = "Svoren the Mad",
    190.     [45305] = "The Hairy One",            [45315] = "Grimgor Guteater",    [45325] = "The Masked Marauder",
    191.     [45306] = "Axeitus Headbanger",        [45316] = "Drasilla",            [45326] = "Gnorre Chyllson",
    192.     [45307] = "Rocky",                    [45317] = "Spirit of Earth",    [45327] = "Fallen Mooh'tah Master Ghar",
    193.     [45308] = "Cursed Gladiator",        [45318] = "Spirit of Water",    [45328] = "Deathbringer",
    194.     [45309] = "Orcus the Cruel",        [45319] = "Spirit of Fire",        [45329] = "The Obliverator"}
    195.  
    196. Checking = false
    197.  
    198. RoomsACT = {42301, 42302, 42303, 42304, 42305, 42306, 42307, 42308, 42309}
    199.  
    200. Goblets = {
    201.     [42360] = {Id=Arena[0].Goblet, txt="It is given to the courageous victor of the barbarian arena "..Arena[0].LevelName.." difficulty."},
    202.     [42370] = {Id=Arena[1].Goblet, txt="It is given to the courageous victor of the barbarian arena "..Arena[1].LevelName.." difficulty."},
    203.     [42380] = {Id=Arena[2].Goblet, txt="It is given to the courageous victor of the barbarian arena "..Arena[2].LevelName.." difficulty."}}
    204.  
    205. RewardsDoors = {[42366] = 1, [42376] = 2, [42386] = 3}
    206.  
    207. ArenaAdding = {[0] = 3000, [1] = 3010, [2] = 3020}
    208.  
    209. function myArenaLevelIs(cid)
    210.     Stor = getPlayerStorageValue(cid, myArenaLevel)
    211.     if Stor == -1 then
    212.         setPlayerStorageValue(cid, myArenaLevel, 0)
    213.         Stor = 0
    214.     elseif Stor == 3 then Stor = 2
    215.     end
    216.     return {
    217.         RC = Arena[Stor].Cost,
    218.         LN = Arena[Stor].LevelName,
    219.         RLV = Arena[Stor].LevelNeeded,
    220.         LV = getPlayerStorageValue(cid, myArenaLevel)
    221.     }
    222. end
    223.  
    224. function getDirectionMove(cid, itempos)
    225.     --function by Nahruto
    226.     p = getCreaturePosition(cid)
    227.     i = itempos
    228.     if p.x > i.x then
    229.         if p.y > i.y then
    230.             ret = NORTHWEST
    231.         elseif p.y < i.y then
    232.             ret = SOUTHWEST
    233.         else
    234.             ret = WEST
    235.         end
    236.     elseif p.x < i.x then
    237.         if p.y > i.y then
    238.             ret = NORTHEAST
    239.         elseif p.y < i.y then
    240.             ret = SOUTHEAST
    241.         else
    242.             ret = EAST
    243.         end
    244.     else
    245.         if p.y > i.y then
    246.             ret = NORTH
    247.         elseif p.y < i.y then
    248.             ret = SOUTH
    249.         else
    250.             ret = nil
    251.         end
    252.     end
    253.     return ret
    254. end
    255.  
    256. function LeaveArena(cid)
    257.     for i = 45300, 45329 do
    258.         setPlayerStorageValue(cid, i, 0)
    259.     end
    260.     if isCreature(getPlayerStorageValue(cid, MonStor)) == TRUE then
    261.         doRemoveCreature(getPlayerStorageValue(cid, MonStor))
    262.     end
    263.     setGlobalStorageValue(getPlayerStorageValue(cid, myRoom), 0)
    264.     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, Cancel[2])
    265.     doTeleportThing(cid, KickPosition, FALSE)
    266.     setPlayerStorageValue(cid, TimeStor, 0)
    267.     setPlayerStorageValue(cid, isIN, 0)
    268. end
    269.  
    270. function CheckRooms()
    271.     addEvent(CheckRooms, 1000)
    272.     for i = 42300, 42309 do
    273.         local Player = getGlobalStorageValue(i)
    274.         if isPlayer(Player) == TRUE then
    275.             local PlayerTime = getPlayerStorageValue(Player, TimeStor)
    276.             if PlayerTime <= os.time() then
    277.                 doTeleportThing(Player, KickPosition, FALSE)
    278.                 setPlayerStorageValue(Player, TimeStor, 0)
    279.                 setGlobalStorageValue(i, 0)
    280.                 doPlayerSendTextMessage(Player,MESSAGE_STATUS_CONSOLE_ORANGE, Cancel[7])
    281.                 if isCreature(getPlayerStorageValue(Player, MonStor)) == TRUE then
    282.                     doRemoveCreature(getPlayerStorageValue(Player, MonStor))
    283.                 end
    284.             elseif PlayerTime - 10 <= os.time() then
    285.                 doPlayerSendTextMessage(Player, MESSAGE_EVENT_DEFAULT, "you have "..PlayerTime - os.time().." seconds left.!")
    286.             end
    287.         else
    288.             setGlobalStorageValue(i, 0)
    289.         end
    290.     end
    291. end
    292.  
    293. function getArenaMonsterIdByName(name)
    294.     for i = 45300, 45329 do
    295.         if tostring(arena_monsters[i]) == string.lower(tostring(name)) then
    296.             return i
    297.         end
    298.     end
    299.     return false
    300. end]]></config>
    301.         <event type="login" name="arenaRegister" event="script"><![CDATA[
    302.         domodlib('arenaFunctions')
    303.         function onLogin(cid)
    304.     registerCreatureEvent(cid, "PlayerArena")
    305.     registerCreatureEvent(cid, "ArenaKill")
    306.         return true
    307. end]]></event>
    308.  
    309. <event type="death" name="PlayerArena" event="script"><![CDATA[
    310.     domodlib('arenaFunctions')
    311.     function onDeath(cid, corpse, deathList)
    312.         if getPlayerStorageValue(cid, isIN) == 1 then
    313.             I = 0        
    314.             for i = 45300, 45329 do
    315.                 if getPlayerStorageValue(cid, i) == 1 then
    316.                     I = i
    317.                 end
    318.             end
    319.             GlobalStor = I - ArenaAdding[myArenaLevelIs(cid).LV]
    320.             setGlobalStorageValue(GlobalStor, 0)
    321.             setPlayerStorageValue(cid, isIN, 0)
    322.             if isCreature(getPlayerStorageValue(cid, MonStor)) then
    323.                 doRemoveCreature(getPlayerStorageValue(cid, MonStor))
    324.             end
    325.         end
    326.         return true
    327.     end
    328. ]]></event>
    329.  
    330.         <event type="kill" name="ArenaKill" event="script"><![CDATA[
    331.         domodlib('arenaFunctions')
    332. function onKill(cid, target, lastHit)
    333.     if getPlayerStorageValue(cid, isIN) == 1 then
    334.         local Room = getArenaMonsterIdByName(getCreatureName(target))
    335.         if Room ~= 0 then
    336.             setPlayerStorageValue(cid, Room, 1)
    337.             doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, Cancel[8])
    338.         end
    339.        end
    340.         return true
    341. end]]></event>
    342.  
    343.         <action fromaid="42357" toaid="42386" event="script"><![CDATA[
    344.         domodlib('arenaFunctions')
    345. function onUse(cid, item, fromPosition, itemEx, toPosition)
    346.     local myMove = getDirectionMove(cid, fromPosition)
    347.  
    348.     if myMove == nil then
    349.  
    350.         return FALSE
    351.  
    352.     end
    353.  
    354.     local Reward = Rewards[item.actionid]
    355.  
    356.     if Reward then
    357.  
    358.         if getPlayerStorageValue(cid, Reward.Stor) ~= 1 then
    359.  
    360.             local reward = nil
    361.  
    362.             if Reward.Cont ~= nil then
    363.  
    364.                 reward = doCreateItemEx(Reward.Cont, 1)
    365.  
    366.                 for i = 1, #Reward.items do
    367.  
    368.                     doAddContainerItem(reward, Reward.items[i], Reward.count[i])
    369.  
    370.                 end
    371.  
    372.             else
    373.  
    374.                 reward = doCreateItemEx(Reward.item, 1)
    375.  
    376.             end
    377.  
    378.             if reward ~= nil then
    379.  
    380.                 if doPlayerAddItemEx(cid, reward, FALSE) == RETURNVALUE_NOERROR then
    381.  
    382.                     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,'You have found a '..getItemNameById(getThing(reward).itemid)..'.')
    383.  
    384.                     setPlayerStorageValue(cid, Reward.Stor, 1)
    385.  
    386.                                 addPlayerRep(cid, 5, TEXTCOLOR_LIGHTBLUE)
    387.  
    388.                 else
    389.  
    390.                     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, Cancel[3])
    391.  
    392.                 end
    393.  
    394.             end
    395.  
    396.         else
    397.  
    398.             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, Cancel[4])
    399.  
    400.         end
    401.  
    402.     elseif RewardsDoors[item.actionid] then
    403.  
    404.         if myArenaLevelIs(cid).LV >= RewardsDoors[item.actionid] then
    405.  
    406.             doTransformItem(item.uid, OpenDoorsID)
    407.  
    408.             doMoveCreature(cid, myMove)
    409.  
    410.         else
    411.  
    412.             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, Cancel[5])
    413.  
    414.         end
    415.  
    416.     elseif item.actionid == DoorsActID and getPlayerStorageValue(cid, talkNPC) == 1 then
    417.  
    418.         doTransformItem(item.uid, OpenDoorsID)
    419.  
    420.         doMoveCreature(cid, myMove)
    421.  
    422.     else
    423.  
    424.         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, Cancel[1])
    425. end
    426.  
    427.     return TRUE
    428.  
    429. end]]></action>
    430.  
    431.     <movevent type="StepIn" fromaid="42300" toaid="42380" event="script"><![CDATA[
    432.         domodlib('arenaFunctions')
    433. function onStepIn(cid, item, position, fromPosition)
    434.     local ArenaRoom = item.actionid
    435.  
    436.     if item.actionid == LeavePortals then
    437.  
    438.         LeaveArena(cid)
    439.  
    440.     elseif isInArray(GobletTiles, item.actionid) == TRUE then
    441.  
    442.         local gobletPos = getThingPos(item.uid)
    443.  
    444.         if getPlayerStorageValue(cid, item.actionid) ~= 1 then
    445.  
    446.             setPlayerStorageValue(cid, item.actionid, 1)
    447.  
    448.             local Goblet = doCreateItemEx(Goblets[item.actionid].Id, 1)
    449.  
    450.             doItemSetAttribute(Goblet, "description", ""..Goblets[item.actionid].txt.."\nAwarded to "..getCreatureName(cid)..".")
    451.  
    452.             gobletPos.y = gobletPos.y - 1
    453.  
    454.             doTileAddItemEx(gobletPos, Goblet)
    455.  
    456.         end
    457.  
    458.         doTransformItem(item.uid, item.itemid - 1)
    459.  
    460.     elseif isInArray(RoomsACT, ArenaRoom) == TRUE or ArenaRoom == 42300 then
    461.  
    462.         if Checking == FALSE then Checking = TRUE CheckRooms() end
    463.  
    464.         local myLevelArena = myArenaLevelIs(cid).LV
    465.  
    466.         if ArenaAdding[myLevelArena] then
    467.  
    468.             Mons = ArenaRoom + ArenaAdding[myLevelArena]
    469.  
    470.         end
    471.  
    472.         if getGlobalStorageValue(ArenaRoom) == 0 then
    473.  
    474.             if isCreature(getPlayerStorageValue(cid, MonStor)) == FALSE then
    475.  
    476.                 if ArenaRoom == 42300 and getPlayerStorageValue(cid, talkNPC) == 1 then
    477.  
    478.                     setPlayerStorageValue(cid, talkNPC, 0)
    479.  
    480.                     setPlayerStorageValue(cid, isIN, 1)
    481.  
    482.                     P = 1
    483.  
    484.                 elseif ArenaRoom ~= 42300 and getPlayerStorageValue(cid, isIN) == 1 then
    485.  
    486.                     P = 1
    487.  
    488.                 else
    489.  
    490.                     P = nil
    491.  
    492.                 end        
    493.  
    494.                 if P ~= nil then
    495.  
    496.                     local SpawnPos = getThingPos(ArenaRoom)
    497.  
    498.                     doTeleportThing(cid, SpawnPos, FALSE)
    499.  
    500.                     SpawnPos.x = SpawnPos.x - 1
    501.  
    502.                     SpawnPos.y = SpawnPos.y - 1
    503.  
    504.                     local Monster = doSummonCreature(arena_monsters[Mons], SpawnPos)
    505.  
    506.                     setGlobalStorageValue(ArenaRoom, cid)
    507.  
    508.                     setGlobalStorageValue(ArenaRoom - 1, 0)
    509.  
    510.                     setPlayerStorageValue(cid, TimeStor, os.time()+arenaRoomMaxTime)
    511.  
    512.                     setPlayerStorageValue(cid, MonStor, Monster)
    513.  
    514.                     setPlayerStorageValue(cid, myRoom, ArenaRoom)
    515.  
    516.                 else
    517.  
    518.                     LeaveArena(cid)
    519.  
    520.                 end
    521.  
    522.             else
    523.  
    524.                 doTeleportThing(cid, fromPosition, TRUE)
    525.  
    526.                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, Cancel[9])
    527.  
    528.             end
    529.  
    530.         else
    531.  
    532.             doTeleportThing(cid, fromPosition, TRUE)
    533.  
    534.             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, ""..getCreatureName(getGlobalStorageValue(cid, ArenaRoom)).." "..Cancel[10].."")
    535.  
    536.         end
    537.  
    538.     elseif ArenaRoom == 42310 then
    539.  
    540.         if isCreature(getPlayerStorageValue(cid, MonStor)) == FALSE then
    541.  
    542.             doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,""..Completed[1].." "..myArenaLevelIs(cid).LN.." "..Completed[2].."")
    543.  
    544.             setPlayerStorageValue(cid, myArenaLevel, getPlayerStorageValue(cid, myArenaLevel) + 1)
    545.  
    546.             setGlobalStorageValue(ArenaRoom - 1, 0)
    547.  
    548.             setPlayerStorageValue(cid, TimeStor, 0)
    549.  
    550.             setPlayerStorageValue(cid, isIN, 0)
    551.  
    552.             doTeleportThing(cid, RewardsRoom, TRUE)
    553.  
    554.         else
    555.  
    556.             doTeleportThing(cid, fromPosition, TRUE)
    557.  
    558.             doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'Najpierw zabij potwora!')
    559.  
    560.         end
    561.  
    562.     end
    563.  
    564.     return TRUE
    565.  
    566. end]]></movevent>
    567.  
    568.     <movevent type="StepOut" fromaid="42357" toaid="42387" event="script"><![CDATA[
    569.         domodlib('arenaFunctions')
    570. function onStepOut(cid, item, position, fromPosition)
    571.  
    572.     if item.actionid == DoorsActID or RewardsDoors[item.actionid] then
    573.  
    574.         doTransformItem(item.uid, item.itemid - 2)
    575.  
    576.     elseif isInArray(GobletTiles, item.actionid) == TRUE then
    577.  
    578.         doTransformItem(item.uid, item.itemid + 1)
    579.         end
    580.  
    581.     return TRUE
    582.  
    583. end]]></movevent>
    584.  
    585. </mod>
     
  16. TomCrusher

    TomCrusher Jeg er ingenting

    Joined:
    Dec 31, 2008
    Messages:
    655
    Likes Received:
    16
    Best Answers:
    0
    which version TFS what show you on console after killed monster?
     
  17. cinuslca

    cinuslca New Member

    Joined:
    Jan 29, 2010
    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Tfs 0.4 svn , dont have anyone msg on console
     
  18. cinuslca

    cinuslca New Member

    Joined:
    Jan 29, 2010
    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Code (Text):
    1. [20:22:08.078] [Error - Action Interface]
    2. [20:22:08.078] domodlib('arenaFunctions')
    3. [20:22:08.078] function onUse(cid, item, fromPosition, itemEx, toPosition)
    4. [20:22:08.078]     local myMove = getDirectionMove(cid, fromPosition)
    5.  
    6. [20:22:08.078]     if myMove == nil then
    7.  
    8. [20:22:08.078]         return FALSE
    9.  
    10. [20:22:08.078]     end
    11.  
    12. [20:22:08.078]     local Reward = Rewards[item.actionid]
    13.  
    14. [20:22:08.078]     if Reward then
    15.  
    16. [20:22:08.078]         if getPlayerStorageValue(cid, Reward.Stor) ~= 1 then
    17.  
    18. [20:22:08.078]             local reward = nil
    19.  
    20. [20:22:08.078]             if Reward.Cont ~= nil then
    21.  
    22. [20:22:08.078]                 reward = doCreateItemEx(Reward.Cont, 1)
    23.  
    24. [20:22:08.078]                 for i = 1, #Reward.items do
    25.  
    26. [20:22:08.078]                     doAddContainerItem(reward, Reward.items[i], R
    27. eward.count[i])
    28.  
    29. [20:22:08.078]                 end
    30.  
    31. [20:22:08.078]             else
    32.  
    33. [20:22:08.078]                 reward = doCreateItemEx(Reward.item, 1)
    34.  
    35. [20:22:08.078]             end
    36.  
    37. [20:22:08.093]             if reward ~= nil then
    38.  
    39. [20:22:08.093]                 if doPlayerAddItemEx(cid, reward, FALSE) == RETUR
    40. NVALUE_NOERROR then
    41.  
    42. [20:22:08.093]                     doPlayerSendTextMessage(cid, MESSAGE_INFO_DES
    43. CR,'You have found a '..getItemNameById(getThing(reward).itemid)..'.')
    44.  
    45. [20:22:08.093]                     setPlayerStorageValue(cid, Reward.Stor, 1)
    46.  
    47. [20:22:08.093]                                 addPlayerRep(cid, 5, TEXTCOLOR_LI
    48. GHTBLUE)
    49.  
    50. [20:22:08.093]                 else
    51.  
    52. [20:22:08.093]                     doPlayerSendTextMessage(cid, MESSAGE_INFO_DES
    53. CR, Cancel[3])
    54.  
    55. [20:22:08.093]                 end
    56.  
    57. [20:22:08.093]             end
    58.  
    59. [20:22:08.093]         else
    60.  
    61. [20:22:08.093]             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, Canc
    62. el[4])
    63.  
    64. [20:22:08.093]         end
    65.  
    66. [20:22:08.093]     elseif RewardsDoors[item.actionid] then
    67.  
    68. [20:22:08.093]         if myArenaLevelIs(cid).LV >= RewardsDoors[item.actionid]
    69. then
    70.  
    71. [20:22:08.093]             doTransformItem(item.uid, OpenDoorsID)
    72.  
    73. [20:22:08.093]             doMoveCreature(cid, myMove)
    74.  
    75. [20:22:08.093]         else
    76.  
    77. [20:22:08.093]             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, Canc
    78. el[5])
    79.  
    80. [20:22:08.093]         end
    81.  
    82. [20:22:08.093]     elseif item.actionid == DoorsActID and getPlayerStorageValue(
    83. cid, talkNPC) == 1 then
    84.  
    85. [20:22:08.093]         doTransformItem(item.uid, OpenDoorsID)
    86.  
    87. [20:22:08.093]         doMoveCreature(cid, myMove)
    88.  
    89. [20:22:08.093]     else
    90.  
    91. [20:22:08.093]         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, Cancel[1
    92. ])
    93. [20:22:08.093] end
    94.  
    95. [20:22:08.093]     return TRUE
    96.  
    97. [20:22:08.093] end:onUse
    98. [20:22:08.093] Description:
    99. [20:22:08.093] [string "LuaInterface::loadBuffer"]:43: attempt to call global 'a
    100. ddPlayerRep' (a nil value)
    101. [20:22:08.093] stack traceback:
    102. [20:22:08.093]  [string "LuaInterface::loadBuffer"]:43: in function <[string "Lu
    103. aInterface::loadBuffer"]:2>
    and

    Code (Text):
    1. [20:34:53.468] [Error - Action Interface]
    2. [20:34:53.468] data/actions/scripts/other/doors.lua:onUse
    3. [20:34:53.468] Description:
    4. [20:34:53.468] (luaDoTransformItem) Item not found
    5.  
    6. [20:34:58.109] [Error - Action Interface]
    7. [20:34:58.109] data/actions/scripts/other/doors.lua:onUse
    8. [20:34:58.109] Description:
    9. [20:34:58.109] (luaDoTransformItem) Item not found
     
  19. Dankoo

    Dankoo Well-Known Member

    Joined:
    Sep 4, 2010
    Messages:
    1,006
    Likes Received:
    28
    Best Answers:
    0
    Yeah, this is ridiculous, I just fuc*** can't make an arena quest log work <_<

    Here's my quests.xml arena part:

    Code (Lua):
    1.             <quest name="The Arena" startstorageid="45450" startstoragevalue="0" endvalue="1">
    2.         <mission name="Arena Combatant" storageid="45450" startvalue="-1" endvalue="10">
    3.             <missionstate id="0" description="You've entered the arena as combatant."/>
    4.         </mission>
    5.                <mission name="Greenshore difficulty" storageid="51345" startvalue="0" endvalue="1">
    6.             <missionstate id="0" description="You've completed the arena in the Greenshore difficulty"/>
    7.         </mission>
    8.             <mission name="Scrapper difficulty" storageid="51346" startvalue="0" endvalue="1">
    9.             <missionstate id="0" description="You've completed the arena in the Scrapper difficulty"/>
    10.         </mission>
    11.             <mission name="Warlord difficulty" storageid="51347" startvalue="0" endvalue="1">
    12.             <missionstate id="0" description="You've completed the arena in the Warlord difficulty"/>
    13.         </mission>
    14.         <mission name="Arena Master" storageid="51348" startvalue="0" endvalue="1">
    15.             <missionstate id="0" description="You've mastered all difficulty levels in the arena, congratulations!"/>
    16.         </mission>
    17.             </quest>
    And my little bit modified arena mod:

    Code (Lua):
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <mod name="Arena Svargrond"
    3.  
    4. version="1.0" author="Tommy" contact="[email protected]" enabled="yes">
    5.  
    6. <config name="arenaFunctions"><![CDATA[
    7. KickPosition = {x=32222, y=31080, z=6} --if the player leave the arena or time is over, where he go.
    8. RewardsRoom = {x=32222, y=31080, z=6} --rewards room position.
    9. arenaRoomMaxTime = 240 --max time for each room 240 = 4 min.
    10. OpenDoorsID = 5133 --if you change doors item ids, change me =D
    11.  
    12.  
    13. TimeStor = 42350 --here will be saved the time.
    14. myArenaLevel = 45450 --here will be saved the arena level.
    15. talkNPC = 45451 --Storage to check if the player have paid to the npc and can enter to the arena.
    16. RewardsStor = {42361, 42371, 42381} --Storage for greenshore, scrapper, warlord.
    17. isIN = 42352 --to check if the player is in the arena.
    18. myRoom = 46000 --here will be saved the current room.
    19. MonStor = 47000 --here will be saved the monster uid.
    20.  
    21.  
    22. DoorsActID = 42357 --Doors near the npc.
    23. LeavePortals = 42321 --The action id of the portal to leave the rooms (south portals).
    24. GobletTiles = {42360, 42370, 42380} --Action ids of the tiles for Bronze, Silver and Gold Goblets.
    25.  
    26. Cancel = {
    27.     --message when use door and have not paid to the npc.
    28.     [1] = "You have not paid NPC yet.",
    29.     --message when leave arena.
    30.     [2] = "You have been kicked.!",
    31.     --message when the player can't get the reward.
    32.     [3] = "You can\'t get this item",
    33.     --message when already got any reward.
    34.     [4] = "It is empty.",
    35.     --when try to open a reward door and haven't completed the level.
    36.     [5] = "You have not finished this arena level.",
    37.     --NPC answer if the player completed all arena levels.
    38.     [6] = "You already did all the arena levels.",
    39.     --message when time is over
    40.     [7] = "The time is over.",
    41.     --message when you can go to the next room, LoL >_> this is not a cancel btw.
    42.     [8] = "You can go to the next room.",
    43.     --when try to go to the next room and not killed the monster yet.
    44.     [9] = "Kill the monster first",
    45.     --when try to go to the next room but there is a player yet...this text will be PLAYERNAME + this text
    46.     [10] = "is in the room yet."
    47.     }
    48.  
    49. Completed = {
    50.     [1] = "Congatulations! you have completed the arena in",
    51.     --HERE WILL BE THE ARENA NAME.
    52.     [2] = "difficulty!, now go and take your reward."}
    53.     --then the message will be "Congatulations! you have completed the arena in greenshore/scrapper/warlord difficulty!, now go and take your reward."
    54.    
    55.  
    56. Arena = {
    57.     --greenshore
    58.     [0] = {
    59.         Cost = 1000,
    60.         LevelName = 'greenshore',
    61.         LevelNeeded = 30,
    62.         Goblet = 5807
    63.         },
    64.     --scrapper
    65.     [1] = {
    66.         Cost = 5000,
    67.         LevelName = 'scrapper',
    68.         LevelNeeded = 50,
    69.         Goblet = 5806
    70.         },
    71.     --warlord
    72.     [2] = {
    73.         Cost = 10000,
    74.         LevelName = 'warlord',    
    75.         LevelNeeded = 80,
    76.         Goblet = 5805
    77.         }
    78.     }
    79.    
    80. greenshore_storage = 51345
    81. scrapper_storage = 51346
    82. warlord_storage = 51347
    83. final_storage = 51348
    84.  
    85.  
    86. Rewards = {
    87.     --greenshore
    88.     --present with items.
    89.     [42361] = {
    90.         Stor = RewardsStor[1],
    91.         Cont = 1990,
    92.         items = {7372, 6569, 6574, 2114},
    93.         count = {1, 10, 1, 1}
    94.         },
    95.     --blacksteel sword.
    96.     [42362] = {
    97.         Stor = RewardsStor[1],
    98.         Cont = nil,
    99.         item = 7406
    100.         },
    101.     --headchopper.
    102.     [42363] = {
    103.         Stor = RewardsStor[1],
    104.         Cont = nil,
    105.         item = 7380
    106.         },
    107.     --orcish maul.
    108.     [42364] = {
    109.         Stor = RewardsStor[1],
    110.         Cont = nil,
    111.         item = 7392
    112.         },
    113.     --backpack with items.
    114.     [42365] = {
    115.         Stor = RewardsStor[1],
    116.         Cont = 7342,
    117.         items = {7365, 7364},
    118.         count = {100, 100}
    119.         },
    120.     --scrapper
    121.     --present with items.
    122.     [42371] = {
    123.         Stor = RewardsStor[2],
    124.         Cont = 1990,
    125.         items = {7372, 6569, 6574, 7183},
    126.         count = {1, 10, 1, 1}
    127.         },
    128.     --mystic blade.
    129.     [42372] = {
    130.         Stor = RewardsStor[2],
    131.         Cont = nil,
    132.         item = 7384
    133.         },
    134.     --heroic axe.
    135.     [42373] = {
    136.         Stor = RewardsStor[2],
    137.         Cont = nil,
    138.         item = 7389
    139.         },
    140.     --cranial basher
    141.     [42374] = {
    142.         Stor = RewardsStor[2],
    143.         Cont = nil,
    144.         item = 7415
    145.         },
    146.     --backpack with items.
    147.     [42375] = {
    148.         Stor = RewardsStor[2],
    149.         Cont = 7342,
    150.         items = {7365, 2547, 2547, 2311, 2304},
    151.         count = {100, 100, 100, 50, 50}
    152.         },
    153.     --warlord
    154.     --present with items.
    155.     [42381] = {
    156.         Stor = RewardsStor[3],
    157.         Cont = 1990,
    158.         items = {7372, 6569, 6574, 6568},
    159.         count = {1, 10, 1, 1}
    160.         },
    161.     --justice seeker
    162.     [42382] = {
    163.         Stor = RewardsStor[3],
    164.         Cont = nil,
    165.         item = 7390
    166.         },
    167.     --royal axe.
    168.     [42383] = {
    169.         Stor = RewardsStor[3],
    170.         Cont = nil,
    171.         item = 7434
    172.         },
    173.     --blessed sceptre.
    174.     [42384] = {
    175.         Stor = RewardsStor[3],
    176.         Cont = nil,
    177.         item = 7429
    178.         },
    179.     --backpack with items.
    180.     [42385] = {
    181.         Stor = RewardsStor[3],
    182.         Cont = 7342,
    183.         items = {2273, 2268, 7443, 7440, 7529},
    184.         count = {50, 50, 1, 1, 100}
    185.         }
    186.     }
    187.  
    188. arena_monsters = {
    189.     --greenshore                            -scrapper                            --warlord
    190.     [45300] = "Frostfur",                [45310] = "Avalanche",            [45320] = "Webster",
    191.     [45301] = "Bloodpaw",                [45311] = "Kreebosh the Exile",    [45321] = "Darakan the Executioner",
    192.     [45302] = "Bovinus",                [45312] = "The Dark Dancer",    [45322] = "Norgle Glacierbeard",
    193.     [45303] = "Achad",                    [45313] = "The Hag",            [45323] = "The Pit Lord",
    194.     [45304] = "Colerian The Barbarian",    [45314] = "Slim",                [45324] = "Svoren the Mad",
    195.     [45305] = "The Hairy One",            [45315] = "Grimgor Guteater",    [45325] = "The Masked Marauder",
    196.     [45306] = "Axeitus Headbanger",        [45316] = "Drasilla",            [45326] = "Gnorre Chyllson",
    197.     [45307] = "Rocky",                    [45317] = "Spirit of Earth",    [45327] = "Fallen Mooh'tah Master Ghar",
    198.     [45308] = "Cursed Gladiator",        [45318] = "Spirit of Water",    [45328] = "Deathbringer",
    199.     [45309] = "Orcus the Cruel",        [45319] = "Spirit of Fire",        [45329] = "The Obliverator"}
    200.  
    201. Checking = false
    202.  
    203. RoomsACT = {42301, 42302, 42303, 42304, 42305, 42306, 42307, 42308, 42309}
    204.  
    205. Goblets = {
    206.     [42360] = {Id=Arena[0].Goblet, txt="It is given to the courageous victor of the barbarian arena "..Arena[0].LevelName.." difficulty."},
    207.     [42370] = {Id=Arena[1].Goblet, txt="It is given to the courageous victor of the barbarian arena "..Arena[1].LevelName.." difficulty."},
    208.     [42380] = {Id=Arena[2].Goblet, txt="It is given to the courageous victor of the barbarian arena "..Arena[2].LevelName.." difficulty."}}
    209.  
    210. RewardsDoors = {[42366] = 1, [42376] = 2, [42386] = 3}
    211.  
    212. ArenaAdding = {[0] = 3000, [1] = 3010, [2] = 3020}
    213.  
    214. function myArenaLevelIs(cid)
    215.     Stor = getPlayerStorageValue(cid, myArenaLevel)
    216.     if Stor == -1 then
    217.         setPlayerStorageValue(cid, myArenaLevel, 0)
    218.         Stor = 0
    219.     elseif Stor == 3 then Stor = 2
    220.     end
    221.     return {
    222.         RC = Arena[Stor].Cost,
    223.         LN = Arena[Stor].LevelName,
    224.         RLV = Arena[Stor].LevelNeeded,
    225.         LV = getPlayerStorageValue(cid, myArenaLevel)
    226.     }
    227. end
    228.  
    229. function getDirectionMove(cid, itempos)
    230.     --function by Nahruto
    231.     p = getCreaturePosition(cid)
    232.     i = itempos
    233.     if p.x > i.x then
    234.         if p.y > i.y then
    235.             ret = NORTHWEST
    236.         elseif p.y < i.y then
    237.             ret = SOUTHWEST
    238.         else
    239.             ret = WEST
    240.         end
    241.     elseif p.x < i.x then
    242.         if p.y > i.y then
    243.             ret = NORTHEAST
    244.         elseif p.y < i.y then
    245.             ret = SOUTHEAST
    246.         else
    247.             ret = EAST
    248.         end
    249.     else
    250.         if p.y > i.y then
    251.             ret = NORTH
    252.         elseif p.y < i.y then
    253.             ret = SOUTH
    254.         else
    255.             ret = nil
    256.         end
    257.     end
    258.     return ret
    259. end
    260.  
    261. function LeaveArena(cid)
    262.     for i = 45300, 45329 do
    263.         setPlayerStorageValue(cid, i, 0)
    264.     end
    265.     if isCreature(getPlayerStorageValue(cid, MonStor)) == TRUE then
    266.         doRemoveCreature(getPlayerStorageValue(cid, MonStor))
    267.     end
    268.     setGlobalStorageValue(getPlayerStorageValue(cid, myRoom), 0)
    269.     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, Cancel[2])
    270.     doTeleportThing(cid, KickPosition, FALSE)
    271.     setPlayerStorageValue(cid, TimeStor, 0)
    272.     setPlayerStorageValue(cid, isIN, 0)
    273. end
    274.  
    275. function CheckRooms()
    276.     addEvent(CheckRooms, 1000)
    277.     for i = 42300, 42309 do
    278.         local Player = getGlobalStorageValue(i)
    279.         if isPlayer(Player) == TRUE then
    280.             local PlayerTime = getPlayerStorageValue(Player, TimeStor)
    281.             if PlayerTime <= os.time() then
    282.                 doTeleportThing(Player, KickPosition, FALSE)
    283.                 setPlayerStorageValue(Player, TimeStor, 0)
    284.                 setGlobalStorageValue(i, 0)
    285.                 doPlayerSendTextMessage(Player,MESSAGE_STATUS_CONSOLE_ORANGE, Cancel[7])
    286.                 if isCreature(getPlayerStorageValue(Player, MonStor)) == TRUE then
    287.                     doRemoveCreature(getPlayerStorageValue(Player, MonStor))
    288.                 end
    289.             elseif PlayerTime - 10 <= os.time() then
    290.                 doPlayerSendTextMessage(Player, MESSAGE_EVENT_DEFAULT, "you have "..PlayerTime - os.time().." seconds left.!")
    291.             end
    292.         else
    293.             setGlobalStorageValue(i, 0)
    294.         end
    295.     end
    296. end
    297.  
    298. function getArenaMonsterIdByName(name)
    299.     for i = 45300, 45329 do
    300.         if tostring(arena_monsters[i]) == string.lower(tostring(name)) then
    301.             return i
    302.         end
    303.     end
    304.     return false
    305. end]]></config>
    306.         <event type="login" name="arenaRegister" event="script"><![CDATA[
    307.         domodlib('arenaFunctions')
    308.         function onLogin(cid)
    309.     registerCreatureEvent(cid, "PlayerArena")
    310.     registerCreatureEvent(cid, "ArenaKill")
    311.         return true
    312. end]]></event>
    313.  
    314. <event type="death" name="PlayerArena" event="script"><![CDATA[
    315.     domodlib('arenaFunctions')
    316.     function onDeath(cid, corpse, deathList)
    317.         if getPlayerStorageValue(cid, isIN) == 1 then
    318.             I = 0        
    319.             for i = 45300, 45329 do
    320.                 if getPlayerStorageValue(cid, i) == 1 then
    321.                     I = i
    322.                 end
    323.             end
    324.             GlobalStor = I - ArenaAdding[myArenaLevelIs(cid).LV]
    325.             setGlobalStorageValue(GlobalStor, 0)
    326.             setPlayerStorageValue(cid, isIN, 0)
    327.             if isCreature(getPlayerStorageValue(cid, MonStor)) then
    328.                 doRemoveCreature(getPlayerStorageValue(cid, MonStor))
    329.             end
    330.         end
    331.         return true
    332.     end
    333. ]]></event>
    334.  
    335.         <event type="kill" name="ArenaKill" event="script"><![CDATA[
    336.         domodlib('arenaFunctions')
    337. function onKill(cid, target, lastHit)
    338.     if getPlayerStorageValue(cid, isIN) == 1 then
    339.         local Room = getArenaMonsterIdByName(getCreatureName(target))
    340.         if Room ~= 0 then
    341.             setPlayerStorageValue(cid, Room, 1)
    342.             doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, Cancel[8])
    343.         end
    344.        end
    345.         return true
    346. end]]></event>
    347.  
    348.         <action fromaid="42357" toaid="42386" event="script"><![CDATA[
    349.         domodlib('arenaFunctions')
    350. function onUse(cid, item, fromPosition, itemEx, toPosition)
    351.     local myMove = getDirectionMove(cid, fromPosition)
    352.  
    353.     if myMove == nil then
    354.  
    355.         return FALSE
    356.  
    357.     end
    358.  
    359.     local Reward = Rewards[item.actionid]
    360.  
    361.     if Reward then
    362.  
    363.         if getPlayerStorageValue(cid, Reward.Stor) ~= 1 then
    364.  
    365.             local reward = nil
    366.  
    367.             if Reward.Cont ~= nil then
    368.  
    369.                 reward = doCreateItemEx(Reward.Cont, 1)
    370.  
    371.                 for i = 1, #Reward.items do
    372.  
    373.                     doAddContainerItem(reward, Reward.items[i], Reward.count[i])
    374.  
    375.                 end
    376.  
    377.             else
    378.  
    379.                 reward = doCreateItemEx(Reward.item, 1)
    380.  
    381.             end
    382.  
    383.             if reward ~= nil then
    384.  
    385.                 if doPlayerAddItemEx(cid, reward, FALSE) == RETURNVALUE_NOERROR then
    386.  
    387.                     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,'You have found a '..getItemNameById(getThing(reward).itemid)..'.')
    388.  
    389.                     setPlayerStorageValue(cid, Reward.Stor, 1)
    390.  
    391.                 else
    392.  
    393.                     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, Cancel[3])
    394.  
    395.                 end
    396.  
    397.             end
    398.  
    399.         else
    400.  
    401.             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, Cancel[4])
    402.  
    403.         end
    404.  
    405.     elseif RewardsDoors[item.actionid] then
    406.  
    407.         if myArenaLevelIs(cid).LV >= RewardsDoors[item.actionid] then
    408.  
    409.             doTransformItem(item.uid, OpenDoorsID)
    410.  
    411.             doMoveCreature(cid, myMove)
    412.  
    413.         else
    414.  
    415.             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, Cancel[5])
    416.  
    417.         end
    418.  
    419.     elseif item.actionid == DoorsActID and getPlayerStorageValue(cid, talkNPC) == 1 then
    420.  
    421.         doTransformItem(item.uid, OpenDoorsID)
    422.  
    423.         doMoveCreature(cid, myMove)
    424.  
    425.     else
    426.  
    427.         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, Cancel[1])
    428. end
    429.  
    430.     return TRUE
    431.  
    432. end]]></action>
    433.  
    434.     <movevent type="StepIn" fromaid="42300" toaid="42380" event="script"><![CDATA[
    435.         domodlib('arenaFunctions')
    436. function onStepIn(cid, item, position, fromPosition)
    437.     local ArenaRoom = item.actionid
    438.  
    439.     if item.actionid == LeavePortals then
    440.  
    441.         LeaveArena(cid)
    442.  
    443.     elseif isInArray(GobletTiles, item.actionid) == TRUE then
    444.  
    445.         local gobletPos = getThingPos(item.uid)
    446.  
    447.         if getPlayerStorageValue(cid, item.actionid) ~= 1 then
    448.  
    449.             setPlayerStorageValue(cid, item.actionid, 1)
    450.  
    451.             local Goblet = doCreateItemEx(Goblets[item.actionid].Id, 1)
    452.  
    453.             doItemSetAttribute(Goblet, "description", ""..Goblets[item.actionid].txt.."\nAwarded to "..getCreatureName(cid)..".")
    454.  
    455.             gobletPos.y = gobletPos.y - 1
    456.  
    457.             doTileAddItemEx(gobletPos, Goblet)
    458.  
    459.         end
    460.  
    461.         doTransformItem(item.uid, item.itemid - 1)
    462.  
    463.     elseif isInArray(RoomsACT, ArenaRoom) == TRUE or ArenaRoom == 42300 then
    464.  
    465.         if Checking == FALSE then Checking = TRUE CheckRooms() end
    466.  
    467.         local myLevelArena = myArenaLevelIs(cid).LV
    468.  
    469.         if ArenaAdding[myLevelArena] then
    470.  
    471.             Mons = ArenaRoom + ArenaAdding[myLevelArena]
    472.  
    473.         end
    474.  
    475.         if getGlobalStorageValue(ArenaRoom) == 0 then
    476.  
    477.             if isCreature(getPlayerStorageValue(cid, MonStor)) == FALSE then
    478.  
    479.                 if ArenaRoom == 42300 and getPlayerStorageValue(cid, talkNPC) == 1 then
    480.  
    481.                     setPlayerStorageValue(cid, talkNPC, 0)
    482.  
    483.                     setPlayerStorageValue(cid, isIN, 1)
    484.  
    485.                     P = 1
    486.  
    487.                 elseif ArenaRoom ~= 42300 and getPlayerStorageValue(cid, isIN) == 1 then
    488.  
    489.                     P = 1
    490.  
    491.                 else
    492.  
    493.                     P = nil
    494.  
    495.                 end        
    496.  
    497.                 if P ~= nil then
    498.  
    499.                     local SpawnPos = getThingPos(ArenaRoom)
    500.  
    501.                     doTeleportThing(cid, SpawnPos, FALSE)
    502.  
    503.                     SpawnPos.x = SpawnPos.x - 1
    504.  
    505.                     SpawnPos.y = SpawnPos.y - 1
    506.  
    507.                     local Monster = doSummonCreature(arena_monsters[Mons], SpawnPos)
    508.  
    509.                     setGlobalStorageValue(ArenaRoom, cid)
    510.  
    511.                     setGlobalStorageValue(ArenaRoom - 1, 0)
    512.  
    513.                     setPlayerStorageValue(cid, TimeStor, os.time()+arenaRoomMaxTime)
    514.  
    515.                     setPlayerStorageValue(cid, MonStor, Monster)
    516.  
    517.                     setPlayerStorageValue(cid, myRoom, ArenaRoom)
    518.  
    519.                 else
    520.  
    521.                     LeaveArena(cid)
    522.  
    523.                 end
    524.  
    525.             else
    526.  
    527.                 doTeleportThing(cid, fromPosition, TRUE)
    528.  
    529.                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, Cancel[9])
    530.  
    531.             end
    532.  
    533.         else
    534.  
    535.             doTeleportThing(cid, fromPosition, TRUE)
    536.  
    537.             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, ""..getCreatureName(getGlobalStorageValue(cid, ArenaRoom)).." "..Cancel[10].."")
    538.  
    539.         end
    540.  
    541.     elseif ArenaRoom == 42310 then
    542.  
    543.         if isCreature(getPlayerStorageValue(cid, MonStor)) == FALSE then
    544.  
    545.             doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,""..Completed[1].." "..myArenaLevelIs(cid).LN.." "..Completed[2].."")
    546.  
    547.             setPlayerStorageValue(cid, myArenaLevel, getPlayerStorageValue(cid, myArenaLevel) + 1)
    548.            
    549.             if getPlayerStorageValue(cid, myArenaLevel == 0) then
    550.             setPlayerStorageValue(cid, greenshore_storage,1)
    551.             end
    552.             if getPlayerStorageValue(cid, myArenaLevel == 1) then
    553.             setPlayerStorageValue(cid, scrapper_storage,1)
    554.             end
    555.             if getPlayerStorageValue(cid, myArenaLevel == 2) then
    556.             setPlayerStorageValue(cid, warlord_storage,1)
    557.             end
    558.             if getPlayerStorageValue(cid, myArenaLevel == 3) then
    559.             setPlayerStorageValue(cid, final_storage,1)
    560.             end
    561.  
    562.             setGlobalStorageValue(ArenaRoom - 1, 0)
    563.  
    564.             setPlayerStorageValue(cid, TimeStor, 0)
    565.  
    566.             setPlayerStorageValue(cid, isIN, 0)
    567.  
    568.             doTeleportThing(cid, RewardsRoom, TRUE)
    569.  
    570.         else
    571.  
    572.             doTeleportThing(cid, fromPosition, TRUE)
    573.  
    574.             doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'Najpierw zabij potwora!')
    575.  
    576.         end
    577.  
    578.     end
    579.  
    580.     return TRUE
    581.  
    582. end]]></movevent>
    583.  
    584.     <movevent type="StepOut" fromaid="42357" toaid="42387" event="script"><![CDATA[
    585.         domodlib('arenaFunctions')
    586. function onStepOut(cid, item, position, fromPosition)
    587.  
    588.     if item.actionid == DoorsActID or RewardsDoors[item.actionid] then
    589.  
    590.         doTransformItem(item.uid, item.itemid - 1)
    591.  
    592.     elseif isInArray(GobletTiles, item.actionid) == TRUE then
    593.  
    594.         doTransformItem(item.uid, item.itemid + 1)
    595.         end
    596.  
    597.     return TRUE
    598.  
    599. end]]></movevent>
    600.  
    601. </mod>
    I've added this to try to make the quest log:

    Code (Lua):
    1.  
    2. greenshore_storage = 51345
    3. scrapper_storage = 51346
    4. warlord_storage = 51347
    5. final_storage = 51348
    6.  
    7.             if getPlayerStorageValue(cid, myArenaLevel == 0) then
    8.             setPlayerStorageValue(cid, greenshore_storage,1)
    9.             end
    10.             if getPlayerStorageValue(cid, myArenaLevel == 1) then
    11.             setPlayerStorageValue(cid, scrapper_storage,1)
    12.             end
    13.             if getPlayerStorageValue(cid, myArenaLevel == 2) then
    14.             setPlayerStorageValue(cid, warlord_storage,1)
    15.             end
    16.             if getPlayerStorageValue(cid, myArenaLevel == 3) then
    17.             setPlayerStorageValue(cid, final_storage,1)
    18.             end
    And here's an part of the NPC script that might be useful:

    Code (Lua):
    1. if getPlayerStorageValue(cid, myArenaLevel) < 3 and getPlayerLevel(cid) >= enterArena.RLV and getPlayerMoney(cid) >= enterArena.RC then
    getPlayerStorageValue(cid, myArenaLevel) < 3

    :3

    Greenshore level works like a charm, but when I complete Scrapper it completes all storages! Like this:

    [​IMG]

    Any ideas to modify the quests.xml, or arena.lua mod?
     
  20. Dragonas1

    Dragonas1 Member

    Joined:
    Jul 1, 2009
    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Has anyone of you have a map? All links have expired.
     

Share This Page

Loading...