SHARE
TWEET

Untitled

a guest Jun 19th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --The name of this quest.
  2. _name = "Champion of the Arena"
  3.  
  4. --A description of this quest and its completion criteria
  5. _description = "Compete for the prize of Champion of the Arena"
  6.  
  7.  
  8.  
  9. --Ran when the player attempts to begin a quest
  10. --Return true when the player can successfully begin
  11. --Return false when they cannot (E.G. Not high enough level)
  12. function BeginQuest()
  13.     return true
  14. end
  15.  
  16. --Ran when the player abandons a quest
  17. function AbandonQuest()
  18.  
  19. end
  20.  
  21. --Ran every second to test whether a player has completed a quest
  22. --Return true if the quest is complete
  23. --Return false if the quest is incomplete
  24. function IsQuestComplete()
  25.     --Check the player is in the middle of the arena
  26.     if (_x >= 49 and _x <=73 and _y >=50 and _y <=74 and _map == 14) then
  27.         --Find how long the player has been in the arena (in seconds)
  28.         player_time = GetTracker("time")
  29.        
  30.         if (player_time == 0) then
  31.             _local_system_message = _name .. " has joined the battle for Champion of the Arena."
  32.         end
  33.        
  34.         if (player_time == 24) then
  35.             _local_system_message = _name .. " will become Champion of the Arena in 1 minute!"
  36.         end
  37.        
  38.         if (player_time == 27) then
  39.             _local_system_message = _name .. " will become Champion of the Arena in 30 seconds!"
  40.         end
  41.        
  42.         if (player_time == 29) then
  43.             _local_system_message = _name .. " will become Champion of the Arena in 10 seconds!"
  44.         end
  45.        
  46.         if (player_time == 30) then
  47.             return true
  48.         end
  49.        
  50.         --Add another second to the players arena time
  51.         SetTracker("time", player_time + 1)
  52.     end
  53.    
  54.     return false
  55. end
  56.  
  57. --Ran when a player attempts to complete a quest
  58. --Return true if the quest completion code was succesful
  59. --Return false if it was not (E.G. bag was full)
  60. function CompleteQuest()
  61.     _local_system_message = _name .. " is Champion of the Arena!"
  62.    
  63.     --Give them a cup of champion (item 205) if they don't already have one
  64.     if (BagCount(205) == 0) then
  65.         AddItemToBag(205)
  66.     end
  67.    
  68.     --Move player to karend temple if they win
  69.     _x = 46
  70.     _y = 43
  71.     _map = 18
  72.    
  73.     _fail_message = "You are the Champion of the Arena!"
  74.    
  75.     --Start a new game
  76.     ResetTracker() 
  77. end
RAW Paste Data
Top