Originally Posted by White Ros3
what about GUI counter for Snow flakes ?
i think it's better to remove event from NPC so you can add your own script get more control over rates and rewards
Code:
function KISAENG_100315_Conversation(EventID_Sub, CharName)
CONVERSATION_START = 0
CONVERSATION_RESPONSE = 2
EventID = 10168
EventID_Message = EventID_Sub
NpcHandlerNum = LuaNpcHandlerNum()
if CONVERSATION_START == EventID_Sub and CharName == "NPC_CH_EVENT_KISAENG1" then
CurPage = 5
SelectionList_CommonIndex = 0
Button = 2
LuaShowMenu(CurPage, EventID, SelectionList_CommonIndex, Button, NpcHandlerNum)
end
if CONVERSATION_RESPONSE == EventID_Sub then
if CurPage <= 3 and CurPage >= 1 then
LuaTerminateMenu()
return
end
MenuOffset = LuaGetEventMenuResponse()
MenuOffset = MenuOffset - TALK_RESPONSE_LIST_BASE
if MenuOffset == 0 then
if ItemCheck() == 0 then
if 0 < LuaGetCountEmptyInventory(0, -1) then
CurPage = 3
SelectionList_CommonIndex = 1
Button = 1
LuaSetCurPage(CurPage)
LuaShowMenu(CurPage, EventID, SelectionList_CommonIndex, Button, NpcHandlerNum)
GiveEventRewardItem()
return
else
CurPage = 2
SelectionList_CommonIndex = 1
Button = 1
LuaSetCurPage(CurPage)
LuaShowMenu(CurPage, EventID, SelectionList_CommonIndex, Button, NpcHandlerNum)
return
end
else
CurPage = 1
SelectionList_CommonIndex = 1
Button = 1
LuaSetCurPage(CurPage)
LuaShowMenu(CurPage, EventID, SelectionList_CommonIndex, Button, NpcHandlerNum)
return
end
end
if MenuOffset == 1 then
LuaTerminateMenu()
end
elseif CONVERSATION_RESPONSE == EventID_Sub and LuaGetCurPage() == 1 then
LuaTerminateMenu()
end
end
function QEV_WINTER_EVENT()
EventID = 10168
SetEventOne(EventID, "SN_QEV_WINTER_EVENT", 1, 1, 4)
SetEventTwo(2, "SN_TALK_QEV_WINTER_EVENT_1", "SN_TALK_COMMON_EXIT")
NPC_COUNT = 1
LuaInsertNpc(NPC_COUNT, "NPC_CH_EVENT_KISAENG1")
InsertPayItemCodeName(10, "ITEM_MALL_GLOBAL_CHATTING", "ITEM_MALL_REVERSE_RETURN_SCROLL", "ITEM_ETC_E051123_EVATION_SCROLL", "ITEM_ETC_E051123_HIT_SCROL", "ITEM_ETC_E051123_AGILITY_SCROLL", "ITEM_ETC_E090930_EVATION_SUPER_SCROLL", "ITEM_ETC_E090930_HIT_SUPER_SCROLL", "ITEM_MALL_DAMAGE_INC_ABS_10P_SCROLL", "ITEM_EVENT_HP_INC_1300_POTION", "ITEM_EVENT_MP_INC_1300_POTION")
InsertPayItemRatio(10, 10, 7, 10, 10, 10, 9, 9, 4, 6, 6)
InsertMenuStringList("NPC_CH_EVENT_KISAENG1", 5, "EVENT_MENUSTRING_GREETING", "SN_NPC_CH_EVENT_KISAENG1_QS", "EVENT_MENUSTRING_REQUEST_ACCEPT_QUEST", "SN_TALK_QEV_WINTER_EVENT_2", "EVENT_MENUSTRING_NOT_ACHIEVED", "SN_TALK_QEV_WINTER_EVENT_3", "EVENT_MENUSTRING_INVENTORY_FULL", "SN_TALK_QEV_WINTER_EVENT_4", "EVENT_MENUSTRING_ACHIEVED", "SN_TALK_QEV_WINTER_EVENT_5")
CONVERSATION_SINGLE = 0
LuaInsertFunctionStringList(1, "CONVERSATION_SINGLE", "KISAENG_100315_Conversation")
end
function ItemCheck()
if 9 < LuaEventInQuireSameItem(0, "ITEM_ETC_E091216_SNOWFLAKE", INQUIRE_SAMEITEM_OP_COUNT_FIRST_ITEM, -1) then
return 0
else
return 1
end
end
function ItemDel()
if 9 < LuaEventInQuireSameItem(0, "ITEM_ETC_E091216_SNOWFLAKE", INQUIRE_SAMEITEM_OP_COUNT_ALL_SAMEITEM, 0) then
slot = LuaEventInQuireSameItem(0, "ITEM_ETC_E091216_SNOWFLAKE", INQUIRE_SAMEITEM_OP_FIND_FIRST_SLOT, 0)
LuaDelItem_EXT(0, slot, 10, SYSOP_REASON_Event, 0)
end
end
function GiveEventRewardItem()
bGiveItemNum = 0
btErrorCode = 0
SYSOP_REASON_Event = 0
EventID = 10168
RewardItemMax = 10
RewardItemCount = {
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
}
RewardItemRatio = {
0,
1000,
2000,
3000,
4000,
5000,
6000,
7000,
8000,
9000,
10000
}
if 1 > LuaGetCountEmptyInventory(0, -1) then
return
else
nGive = LuaRanged_rand_f(1, 10000)
for i = 1, RewardItemMax do
if nGive > RewardItemRatio[i] and nGive <= RewardItemRatio[i + 1] then
LuaAddItem_EXT(EventID, 0, RewardItemCount[i], SYSOP_REASON_Event, FALSE, FALSE, i)
ItemDel()
break
end
end
end
end
textevent.txt
Code:
1 SN_QEV_WINTER_EVENT Winter ??? 0 0 0 0 0 Winter Event Winter Event 0 0 0 0 0 0
1 SN_TALK_QEV_WINTER_EVENT_1 Winter ??? 0 0 0 0 0 Receive present for 10 snowflakes. Receive present for 10 snowflakes. 0 0 0 0 0 0
1 SN_TALK_QEV_WINTER_EVENT_2 Winter ??? 0 0 0 0 0 You can get one of this rewards [Global chatting scroll - Reverse return scroll - Dodging scroll - Hit scroll - Trigger scroll - Super scroll (Evasion 100%) - Super scroll (Accuracy 100%) - 10% damage increase/absorption scroll - HP+ potion - MP+ potion] You can get one of this rewards [Global chatting scroll - Reverse return scroll - Dodging scroll - Hit scroll - Trigger scroll - Super scroll (Evasion 100%) - Super scroll (Accuracy 100%) - 10% damage increase/absorption scroll - HP+ potion - MP+ potion] 0 0 0 0 0 0
1 SN_TALK_QEV_WINTER_EVENT_3 Winter ??? 0 0 0 0 0 Sorry, You don't have enough snow flakes you need 50, Go and hunt more snow slave man. Sorry, You don't have enough snow flakes you need 50, Go and hunt more snow slave man. 0 0 0 0 0 0
1 SN_TALK_QEV_WINTER_EVENT_4 Winter ??? 0 0 0 0 0 Sorry, Your inventory is full please free some spaces. Sorry, Your inventory is full please free some spaces. 0 0 0 0 0 0
1 SN_TALK_QEV_WINTER_EVENT_5 Winter ??? 0 0 0 0 0 More Rewards for more snowflakes go and get more. More Rewards for more snowflakes go and get more. 0 0 0 0 0 0
|