daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 47 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.     if (_x >= 49 and _x <=73 and _y >=50 and _y <=74 and _map == 14) then
  26.         --Find how long the player has been in the arena (in seconds)
  27.         player_time = GetTracker("time")
  28.        
  29.         if (player_time == 0) then
  30.             _local_system_message = _name .. " has joined the battle for Champion of the Arena."
  31.         end
  32.        
  33.         if (player_time == 24) then
  34.             _local_system_message = _name .. " will become Champion of the Arena in 1 minute!"
  35.         end
  36.        
  37.         if (player_time == 27) then
  38.             _local_system_message = _name .. " will become Champion of the Arena in 30 seconds!"
  39.         end
  40.        
  41.         if (player_time == 29) then
  42.             _local_system_message = _name .. " will become Champion of the Arena in 10 seconds!"
  43.         end
  44.        
  45.         if (player_time == 30) then
  46.             return true
  47.         end
  48.        
  49.         --Add another second to the players arena time
  50.         SetTracker("time", player_time + 1)
  51.     end
  52.    
  53.     return false
  54. end
  55.  
  56. --Ran when a player attempts to complete a quest
  57. --Return true if the quest completion code was succesful
  58. --Return false if it was not (E.G. bag was full)
  59. function CompleteQuest()
  60.     _local_system_message = _name .. " is Champion of the Arena!"
  61.    
  62.     --Give them a cup of champion (item 205) if they don't already have one
  63.     if (BagCount(205) == 0) then
  64.         AddItemToBag(205)
  65.     end
  66.    
  67.     --Move player to karend temple if they win
  68.     _x = 46
  69.     _y = 43
  70.     _map = 18
  71.    
  72.     _fail_message = "You are the Champion of the Arena!"
  73.    
  74.     --Start a new game
  75.     ResetTracker() 
  76. end
RAW Paste Data
Top