Experimentat
Experimentat
Mesaje: 72
Membru din: Sâm Ian 31, 2026 4:11 pm
Server: metin2avange.mt2.xyz
Rasă: Ninja
Regat: Chunjo
  • Has thanked: 1 time
  • Cod: Selectaţi tot

    quest daily_choice_reward begin
    	state start begin
    		function cfg()
    			local c = {}
    			c.NPC_VNUM = 20084
    			c.TAG = "[DailyChoice]"
    
    			c.A = {80017, 1}  -- optiunea 1
    			c.B = {71084, 5}  -- optiunea 2
    			c.C = {25041, 1}  -- optiunea 3
    
    			return c
    		end
    
    		function today()
    			return math.floor(get_time() / 86400)
    		end
    
    		when login begin
    			local t = daily_choice_reward.today()
    			if pc.getqf("dcr_day") != t then
    				pc.setqf("dcr_day", t)
    				pc.setqf("dcr_done", 0)
    			end
    		end
    
    		when cfg().NPC_VNUM.chat."Daily Reward (Alege 1)" begin
    			local c = daily_choice_reward.cfg()
    
    			if pc.getqf("dcr_done") == 1 then
    				say("Ai luat deja recompensa azi.")
    				return
    			end
    
    			say("Alege recompensa de azi:")
    			local s = select("Optiunea 1", "Optiunea 2", "Optiunea 3", "Inchide")
    			if s == 4 then return end
    
    			if s == 1 then
    				pc.give_item2(c.A[1], c.A[2])
    			elseif s == 2 then
    				pc.give_item2(c.B[1], c.B[2])
    			elseif s == 3 then
    				pc.give_item2(c.C[1], c.C[2])
    			end
    
    			pc.setqf("dcr_done", 1)
    			syschat("|cff56ff00|H|h"..c.TAG.."|h|r : Recompensa zilnica a fost acordata.")
    		end
    	end
    end