Jump to content
Sign in to follow this  
FapFap

Anti Dupe Saeed / Stay Online

Recommended Posts

I tried to use Free Lunch System by Sultan but i found out that it Bugs the Anti-Dupe System, if i use the Free Lunch System i can make Clone, if i remove Free Lunch System the Anti-Dupe works fine!

Free Lunch System is "Stay Online to Win" - Random Items from the list you make..
I need help to fix this bug..

This is the Free Lunch Functions:
 

print( "	>> Loading FREE Lunch Ctrl" )

-- --------------------------
-- FREE Lunch Functions
-- --------------------------
function FREELunch:SetHours(number)
	if FREELunch.Enable == true then
	print("=============================================================================")
	print("FREE Lunch: You can't edit hours right now because FREE Lunch Event is enabled. If you wish to edit hours, please disable the event first!")
	print("=============================================================================")
	return 0
	end
	if number > 24 then
	print("=============================================================================")
	print("FREE Lunch: Maximum hours range is 24 hour(s). You can't make it higher!")
	print("=============================================================================")
	return 0
	end
	FREELunch.Hours = number
	BickerNotice(role,"FREE Lunch: Time is not set up!")
	SystemNotice(role,"FREE Lunch: Please set up your FREE Lunch Hour before starting this extension.")
	print("FREE Lunch: Your set your hours to "..number.." for FREE Lunch Event, If you wish to proceed please start the event, if not, you can change the value again.")
end

function FuncFREELunch(ignore, role, freq, time)
for i,v in pairs({GetChaDefaultName(role)}) do
	if(FREELunch.Hours ~= nil and FREELunch.Enable == true and IsPlayer(role) == 1 and FREELunch.Players[v] == nil)then
		FREELunch.Announce = true
		FREELunch.Players[v] = { Name = v, Time = FREELunch.Hours*3600, Role = role }
		BickerNotice(FREELunch.Players[v].Role,"FREE Lunch Event has started!")
		SystemNotice(FREELunch.Players[v].Role,"FREE Lunch: FREE Lunch Event has started! If you wish to receive rewards, you have to be online for "..FREELunch.Hours.." hour(s)!")
	elseif(FREELunch.Hours ~= nil and FREELunch.Enable == false and IsPlayer(role) == 1 and FREELunch.Announce == true)then
		BickerNotice(FREELunch.Players[v].Role,"FREE Lunch Event has ended!")
		Notice("FREE Lunch: The FREE Lunch Event has already ended! Congratulations to all who have won, and for who haven't won, we wish you a better luck next FREE Lunch. Thank you for joining the Event!")
		FREELunch:Init()
		FREELunch.Players[CharacterName] = nil
	elseif(FREELunch.Hours == nil and FREELunch.Enable == true and IsPlayer(role) == 1 and FREELunch.SetUp == true)then
		FREELunch:Init()
		BickerNotice(role,"FREE Lunch: Time is not set up!")
		SystemNotice(role,"FREE Lunch: Please set up your FREE Lunch Hour before starting this extension.")
		print("FREE Lunch: Please set up your FREE Lunch Hour before starting this extension.")
	else
		FREELunch.SetUp = true
	end
end
	local CharacterName = GetChaDefaultName(role)
	local Roler = FREELunch.Players[CharacterName].Role
	local Random = math.random(1,FREELunch.RewardsCount)
	if(FREELunch.Enable == true)then
		if(IsPlayer(role) == 1 and FREELunch.Players[CharacterName] ~= nil)then
			FREELunch.Players[CharacterName].Time = FREELunch.Players[CharacterName].Time - 1
		end
	end
	if(FREELunch.Players[CharacterName].Time == 86399)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 24 hour")
	elseif(FREELunch.Players[CharacterName].Time == 82800)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 23 hour")
	elseif(FREELunch.Players[CharacterName].Time == 79200)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 22 hour")
	elseif(FREELunch.Players[CharacterName].Time == 75600)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 21 hour")
	elseif(FREELunch.Players[CharacterName].Time == 72000)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 20 hour")
	elseif(FREELunch.Players[CharacterName].Time == 68400)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 19 hour")
	elseif(FREELunch.Players[CharacterName].Time == 64800)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 18 hour")
	elseif(FREELunch.Players[CharacterName].Time == 61200)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 17 hour")
	elseif(FREELunch.Players[CharacterName].Time == 57600)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 16 hour")
	elseif(FREELunch.Players[CharacterName].Time == 54000)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 15 hour")
	elseif(FREELunch.Players[CharacterName].Time == 50400)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 14 hour")
	elseif(FREELunch.Players[CharacterName].Time == 46800)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 13 hour")
	elseif(FREELunch.Players[CharacterName].Time == 43200)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 12 hour")
	elseif(FREELunch.Players[CharacterName].Time == 39600)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 11 hour")
	elseif(FREELunch.Players[CharacterName].Time == 36000)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 10 hour")
	elseif(FREELunch.Players[CharacterName].Time == 32400)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 9 hour")
	elseif(FREELunch.Players[CharacterName].Time == 28800)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 8 hour")
	elseif(FREELunch.Players[CharacterName].Time == 25200)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 7 hour")
	elseif(FREELunch.Players[CharacterName].Time == 21600)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 6 hour")
	elseif(FREELunch.Players[CharacterName].Time == 18000)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 5 hour")
	elseif(FREELunch.Players[CharacterName].Time == 14400)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 4 hour")
	elseif(FREELunch.Players[CharacterName].Time == 10800)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 3 hour")
	elseif(FREELunch.Players[CharacterName].Time == 7200)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 2 hour")
	elseif(FREELunch.Players[CharacterName].Time == 3600)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 1 hour")
	elseif(FREELunch.Players[CharacterName].Time == 1800)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 30 minute(s)")
	elseif(FREELunch.Players[CharacterName].Time == 900)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 15 minute(s)")
	elseif(FREELunch.Players[CharacterName].Time == 600)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 10 minute(s)")
	elseif(FREELunch.Players[CharacterName].Time == 300)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 5 minute(s)")
	elseif(FREELunch.Players[CharacterName].Time == 60)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 1 minute(s)")
	elseif(FREELunch.Players[CharacterName].Time == 30)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 30 second(s)")
	elseif(FREELunch.Players[CharacterName].Time == 15)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 15 second(s)")
	elseif(FREELunch.Players[CharacterName].Time == 5)then
		SystemNotice(Roler,"FREE Lunch: "..FREELunch.Players[CharacterName].Name..", your remaining time to receive FREE Lunch reward is: 5 second(s)")
	end
	if(FREELunch.Players[CharacterName].Time <= 0)then
		if GetChaFreeBagGridNum(Roler) <= FREELunch.RewardsCount then
		GiveItemX (Roler,0, FREELunch.Rewards[Random].ID, FREELunch.Rewards[Random].QTY, 4 )
		else
		GiveItem (Roler,0, FREELunch.Rewards[Random].ID, FREELunch.Rewards[Random].QTY, 4 )
		end
		BickerNotice(Roler,"Congratulations! You win a "..FREELunch.Rewards[Random].QTY.."x of "..GetItemName(FREELunch.Rewards[Random].ID).."!")
		Notice("FREE Lunch: Congratulations to "..FREELunch.Players[CharacterName].Name.."! proudly have been online for "..FREELunch.Hours.." hour(s) and he/she received  "..FREELunch.Rewards[Random].QTY.."x of "..GetItemName(FREELunch.Rewards[Random].ID).."!")
		FREELunch.Players[CharacterName] = nil
	end
end
Hook:AddPostHook("cha_timer", FuncFREELunch,1)


This are the Variables:
 

print( "	>> Loading FREE Lunch Variables" )

-- --------------------------
-- FREE Lunch Variables
-- --------------------------
FREELunch = {}
FREELunch.Rewards = {}

-- --------------------------
-- FREE Lunch Init
-- --------------------------
function FREELunch:Init()
FREELunch.Players = {}
FREELunch.Enable = false
FREELunch.Hours = nil
FREELunch.Announce = false
FREELunch.SetUp = false
end
FREELunch:Init()

-- --------------------------
-- FREE Lunch Rewards {Random Pick}
-- --------------------------
FREELunch.Rewards[1] = { ID = 192, QTY = 1 } -- Chest of Kylin
FREELunch.Rewards[2] = { ID = 2843, QTY = 1 } -- Rightful Chest of Black Dragon
FREELunch.Rewards[3] = { ID = 333, QTY = 5 } -- Unique Gem Voucher
FREELunch.Rewards[4] = { ID = 885, QTY = 3 } -- Refining Gem
FREELunch.Rewards[5] = { ID = 3885, QTY = 5 } -- Refining Gem Voucher
FREELunch.Rewards[6] = { ID = 5845, QTY = 1 } -- Azrael's Glare
FREELunch.Rewards[7] = { ID = 5846, QTY = 1 } -- Undead Azrael
FREELunch.Rewards[8] = { ID = 5847, QTY = 1 } -- Azrael's Light
FREELunch.Rewards[9] = { ID = 5848, QTY = 1 } -- Azrael's Aggregation
FREELunch.Rewards[10] = { ID = 5849, QTY = 1 } -- Azrael's Dance
FREELunch.RewardsCount = 10 -- (Last item num/total item number)


What could cause this bug? any help?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...