Pagina 1 din 1

🟣 QUEST: Daily „Alege 1 din 3 recompense” la NPC (o dată pe zi)

Scris: Dum Feb 01, 2026 10:32 am
de ProFight3D

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