Advertisement
Bambus3k

Untitled

Jul 6th, 2023
793
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.27 KB | None | 0 0
  1. when 30121.chat."시발" with pc.get_map_index() != 208 and npc.lock() begin
  2.            
  3.             local starttime = game.get_event_flag("dragon_lair_time")
  4.             local current_time = get_global_time()
  5.             local settings = dragon_lair_access.get_settings()
  6.             local time_remaining = dragon_lair_access.get_time_remaining()
  7.  
  8.             if pc.count_item(settings.access_item) >= settings.access_item_amount then
  9.                 if starttime + settings.group_time >= current_time then
  10.                     local password_input;
  11.                     repeat
  12.                         say ("시발")
  13.                         password_input = tonumber(input())
  14.                         if password_input != game.get_event_flag("dragon_lair_password") then
  15.                         say ("시발")
  16.                             local again = select("응", "아니")
  17.                             if again == 2 then
  18.                                 return
  19.                             end
  20.                         end
  21.                     until password_input == game.get_event_flag("dragon_lair_password")
  22.                     if not dragon_lair_access.give_item_to_ghost() then
  23.                         return
  24.                     end
  25.                    
  26.                     -- right password
  27.                     pc.setqf("time", starttime)
  28.                     dragon_lair_access.warp_to_lair()
  29.                     set_state(kill_dragon)
  30.                 elseif time_remaining < 0 and npc.lock() then -- it is the first player talking with the ghost
  31.                         say ("시발")
  32.                     local abort = select("응","아니")
  33.  
  34.                     if abort == 2 then
  35.                         npc.unlock()
  36.                         return
  37.                     end
  38.                     local password_number;
  39.                     repeat
  40.                         say ("시발")
  41.                         password_number = tonumber(input())
  42.                         local again;
  43.                         if type(password_number) != 'number' then
  44.                         say ("시발")
  45.                             again = select("응", "아니")
  46.                             if again == 2 then
  47.                                 npc.unlock()
  48.                                 return
  49.                             end
  50.                         end
  51.                     until type(password_number) == 'number'
  52.  
  53.                     if not dragon_lair_access.give_item_to_ghost() then
  54.                         npc.unlock()
  55.                         return
  56.                     end
  57.                    
  58.                     if dragon_lair_access.get_time_remaining() > 0 then
  59.                         pc.give_item2(settings.access_item, settings.access_item_amount)
  60.                         npc.unlock()
  61.                         say ("시발")
  62.                         return
  63.                     end
  64.                    
  65.                     pc.setqf("password", password_number)
  66.                     timer("dragon_lair_warptimer", pc.get_channel_id()*2)
  67.                    
  68.                     npc.unlock()
  69.                 else
  70.                         say ("시발")
  71.                     return
  72.                 end
  73.  
  74.             else
  75.                         say ("시발")
  76.                 say(settings.access_item_amount.."x: ")
  77.                 say_item_vnum(settings.access_item)
  78.                 return
  79.             end
  80.             npc.unlock()
  81.         end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement