Sorunum Event Lua'sında Event İtemlerini %100 Olarak 6 Tane İtemide 1 Seferde Kırdırdıgımda Vermesini İstiyorum Ne Yaptıysam Olmuyor Bunu Konuda Bilgisi Olanlar Yardımcı Olabilirmi

function QEV_CH_EVENT_KISAENG_110302()	EventID = 10189
	SetEventOne(EventID, "SN_QEV_CH_EVENT_KISAENG_110302", 1, 1, 1)
	SetEventTwo(2, "SN_TALK_QEV_CH_EVENT_KISAENG_090714_B", "SN_TALK_COMMON_EXIT")
	NPC_COUNT = 1
	LuaInsertNpc(NPC_COUNT, "NPC_CH_EVENT_KISAENG1") --npc which is related with event
	InsertPayItemCodeName(6,
		"ITEM_HASAN_PREMIUM",
		"ITEM_MALL_GLOBAL_CHATTING",
		"ITEM_MALL_REVERSE_RETURN_SCROLL",
		"ITEM_COS_P_CAT_SCROLL",
		"ITEM_MALL_AVATAR_M_NASRUN_UNIQUE",
		"ITEM_MALL_AVATAR_W_NASRUN_UNIQUE",
		"ITEM_ETC_BALLOON_MANGNYANG",
		"ITEM_ETC_BALLOON_MOVOI",
		"ITEM_ETC_E051123_HP500_SCROLL",
		"ITEM_ETC_E051123_MP500_SCROLL",
		"ITEM_ETC_E041225_CANDY_RED",
		"ITEM_ETC_E041225_CANDY_BLUE",
		"ITEM_EVENT_AVATAR_M_NASRUN",
		"ITEM_EVENT_AVATAR_W_NASRUN"
		) --reward item list
	InsertPayItemRatio(6, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0) --will item give as a reward or not??
	LuaInsertDropItem(0, "ITEM_ETC_STARTER", 0) --drop item for event (1/rate*500= shows monster count for per drop) (here drop rate set as 1.5)
	InsertMenuStringList("NPC_CH_EVENT_KISAENG1", 5,
		"EVENT_MENUSTRING_GREETING", "SN_NPC_CH_EVENT_KISAENG1_QS",
		"EVENT_MENUSTRING_REQUEST_ACCEPT_QUEST", "SN_TALK_QEV_CH_EVENT_KISAENG_090714_A",
		"EVENT_MENUSTRING_NOT_ACHIEVED", "SN_TALK_QEV_CH_EVENT_KISAENG_090714_E",
		"EVENT_MENUSTRING_INVENTORY_FULL", "SN_TALK_QEV_CH_EVENT_KISAENG_090714_D",
		"EVENT_MENUSTRING_ACHIEVED", "SN_TALK_QEV_CH_EVENT_KISAENG_090714_C"
		)
	CONVERSATION_SINGLE = 0
	LuaInsertFunctionStringList(1, "CONVERSATION_SINGLE", "KISAENG_110302_Conversation")
end




function KISAENG_110302_ItemCheck() --function of checking related event item
	if 0 < LuaEventInQuireSameItem(0, "ITEM_ETC_STARTER", INQUIRE_SAMEITEM_OP_COUNT_FIRST_ITEM, -1) then
		return 0
	else
		return 1
	end
end




function KISAENG_110302_ItemDel() --function of deleting related event item
	if 0 < LuaEventInQuireSameItem(0, "ITEM_ETC_STARTER", INQUIRE_SAMEITEM_OP_COUNT_ALL_SAMEITEM, 0) then
		slot = LuaEventInQuireSameItem(0, "ITEM_ETC_STARTER", INQUIRE_SAMEITEM_OP_FIND_FIRST_SLOT, 0)
		LuaDelItem_EXT(0, slot, 1, SYSOP_REASON_Event, 0)
	end
end




function KISAENG_110302_GiveEventRewardItem() --function of giving item of related event
	bGiveItemNum = 0
	btErrorCode = 0
	SYSOP_REASON_Event = 0
	EventID = 10189
	Gender = 0 --char gender selection (0 means male, 1 means female)
	if LuaGetPlayerGender() == 0 then --loop for char gender
		Gender = 1
	end
	RewardItemMax = 6 --total reward item count
	RewardItemCount = {1,11,11,1,1,1,1,1,1,1,1,1,1} --total reward item count one by one
	RewardItemRatio = {9500,10300,11100,11900,12700,13500} --reward item rate (last 2 item is not included due to gender)
	nEmptySlotCount = LuaGetCountEmptyInventory(0,-1) --selection of player empty inventory count
	if 1 > nEmptySlotCount then --if player inventory full, then stop!!!
		return
	else --if player inventory is not full, continue the process
		for j=1, nEmptySlotCount do --start loop !!WARNING!! process will continue until players inventory will be full
			if KISAENG_110302_ItemCheck() == 0 then --check player has a related event item or not??
				nGive = LuaRanged_rand_n(1, 10000) --select a random number which is between 1 and 10000
				if 9990 < nGive then --if selected number higher than 9990 than give a player devil considering player gender male or female??
					LuaAddItem_EXT(EventID, 0, RewardItemCount[i], SYSOP_REASON_Event, FALSE, FALSE, 12 + Gender)
				else --if selected number equal or lower than 9990
					for i = 1, RewardItemMax-2 do --start loop !!WARNING!! selection related reward [except devil spirit]
						if nGive > RewardItemRatio[i] and nGive <= RewardItemRatio[i + 1] then
							LuaAddItem_EXT(EventID, 0, RewardItemCount[i], SYSOP_REASON_Event, FALSE, FALSE, i)
							KISAENG_110302_ItemDel()
						end
					end
				end
			else --if player doesnt have related event item break the process!!
				break
			end
		end
	end
end




function KISAENG_110302_Conversation(EventID_Sub, CharName) --funtion of event dialog window
	CONVERSATION_START = 0
	CONVERSATION_RESPONSE = 2
	EventID = 10189
	EventID_Message = EventID_Sub
	NpcHandlerNum = LuaNpcHandlerNum()
	if CONVERSATION_START == EventID_Sub and CharName == "NPC_CH_EVENT_KISAENG1" then
		CurPage = 1
		LuaSetCurPage(CurPage)
		CurString = 5
		SelectionList_CommonIndex = 0
		Button = 2
		LuaShowMenu(CurString, EventID, SelectionList_CommonIndex, Button, NpcHandlerNum)
		return
	end
	if CONVERSATION_RESPONSE == EventID_Sub then
		if LuaGetCurPage() == 1 then
			MenuOffset = LuaGetEventMenuResponse()
			MenuOffset = MenuOffset - TALK_RESPONSE_LIST_BASE
			if MenuOffset == 0 then
				if KISAENG_110302_ItemCheck() == 0 then
					if 0 < LuaGetCountEmptyInventory(0, -1) then
						CurPage = 2
						SelectionList_CommonIndex = 1
						Button = 1
						LuaSetCurPage(CurPage)
						CurString = 3
						LuaShowMenu(CurString, EventID, SelectionList_CommonIndex, Button, NpcHandlerNum)
						KISAENG_110302_GiveEventRewardItem()
						return
					else
						CurPage = 2
						SelectionList_CommonIndex = 1
						Button = 1
						LuaSetCurPage(CurPage)
						CurString = 2
						LuaShowMenu(CurString, EventID, SelectionList_CommonIndex, Button, NpcHandlerNum)
						return
					end
				else
					CurPage = 2
					SelectionList_CommonIndex = 1
					Button = 1
					LuaSetCurPage(CurPage)
					CurString = 1
					LuaShowMenu(CurString, EventID, SelectionList_CommonIndex, Button, NpcHandlerNum)
					return
				end
			elseif MenuOffset == 1 then
				LuaTerminateMenu()
				return
			end
		else
			LuaTerminateMenu()
			return
		end
	end
end
- - - Güncellendi - - -

Bir önerisi olan varmı fikri bu konuda