vsro Happy Event crash

02/11/2020 18:26 Noitpecbot#1
Hey Dudes and Dudeens,

i need your help. We tried to make the HAPPY Events work. Everything is fine so far, till you want to get Rewards from SO-OK Bitch. Then our 1. Gameserver crashed and a few seconds later our 2. Gameserver crashed. - Offline.


What we did so far?

1. Added following Line in Eventworld.txt (Media)

Code:
1    ITEM_ETC_E110125_HAPPY_H    H
2    ITEM_ETC_E110125_HAPPY_A    A
3    ITEM_ETC_E110125_HAPPY_P    P
4    ITEM_ETC_E110125_HAPPY_P_2    P
5    ITEM_ETC_E110125_HAPPY_Y    Y

2. Edited textevent.txt (Media)

Code:
1    SN_QEV_EVENT_HAPPY    0    0    0    0    0    0    0    Happy Event    Happy Event    0    0    0    0    0
1    SN_TALK_QEV_CH_EVENT_HAPPY_A    0    0    0    0    0    0    0    Hello. I am So-Ok~ I wish you a happy new year and have brought an event of luck as I welcome the year 2011~ If you catch monsters and get event letters(5), I will give you a gift. Well! Then, get going and bring them to me~ Please remember unused event letters(5) will be deleted when the event is over!    Hello. I am So-Ok~ I wish you a happy new year and have brought an event of luck as I welcome the year 2011~ If you catch monsters and get event letters(5), I will give you a gift. Well! Then, get going and bring them to me~ Please remember unused event letters(5) will be deleted when the event is over!    0    0    0    0    0
1    SN_TALK_QEV_CH_EVENT_HAPPY_B    0    0    0    0    0    0    0    Receive a gift with event letters(5).    Receive a gift with event letters(5).    0    0    0    0    0
1    SN_TALK_QEV_CH_EVENT_HAPPY_C    0    0    0    0    0    0    0    Oh, These are event letters(5). Thank you for getting them. Then, since you have gotten me the event letters(5), I will give you a gift. Check your inventory.    Oh, These are event letters(5). Thank you for getting them. Then, since you have gotten me the event letters(5), I will give you a gift. Check your inventory.    0    0    0    0    0
1    SN_TALK_QEV_CH_EVENT_HAPPY_D    0    0    0    0    0    0    0    I was about to get event letters(5) and give you a gift. But I cannot because your inventory is full. Empty your inventory and visit me again.    I was about to get event letters(5) and give you a gift. But I cannot because your inventory is full. Empty your inventory and visit me again.    0    0    0    0    0
1    SN_TALK_QEV_CH_EVENT_HAPPY_E    0    0    0    0    0    0    0    I can give you a gift only when you have event letters(5). If you catch a monster, the event letters(5) drop. If you keep those event letters in your inventory and visit me, I am exchanging them into gifts.    I can give you a gift only when you have event letters(5). If you catch a monster, the event letters(5) drop. If you keep those event letters in your inventory and visit me, I am exchanging them into gifts.    0    0    0    0    0
3. Create Eventlist.lua with this code:

Code:
LuaInsertEvent(TYPE_ID, "event.sct", "QEV_EVENT_HAPPY")
4. Edit this [@SN_QEV_110221.lua] File with following

Code:
function QEV_EVENT_HAPPY()
  EventID = 10168
  SetEventOne(EventID, "SN_QEV_EVENT_HAPPY", 1, 1, 5)
  SetEventTwo(2, "SN_TALK_QEV_CH_EVENT_HAPPY_B", "SN_TALK_COMMON_EXIT")
  NPC_COUNT = 1
  LuaInsertNpc(NPC_COUNT, "NPC_CH_EVENT_KISAENG1")
  InsertPayItemCodeName(20, "ITEM_EVENT_AVATAR_M_FAIRY", "ITEM_EVENT_AVATAR_W_FAIRY", "ITEM_EVENT_AVATAR_M_FAIRY_HAT", "ITEM_EVENT_AVATAR_W_FAIRY_HAT", "ITEM_EVENT_ARCHEMY_REINFORCE_RECIPE_SHIELD_B", "ITEM_ETC_ALL_POTION_05", "ITEM_ETC_ALL_SPOTION_01", "ITEM_EVENT_ARCHEMY_REINFORCE_RECIPE_ACCESSARY_B", "ITEM_EVENT_ARCHEMY_REINFORCE_RECIPE_WEAPON_B", "ITEM_ETC_E080723_SKILL_EXP_5", "ITEM_ETC_E080723_SKILL_EXP_10", "ITEM_ETC_E080723_SKILL_EXP_15", "ITEM_ETC_E080723_SKILL_EXP_20", "ITEM_EVENT_HP_INC_1900_POTION", "ITEM_EVENT_HP_INC_4100_POTION", "ITEM_ETC_ARCHEMY_MAGICSTONE_STR_10", "ITEM_ETC_ARCHEMY_MAGICSTONE_INT_10", "ITEM_ETC_E090930_HIT_SUPER_SCROLL", "ITEM_ETC_E090930_EVATION_SUPER_SCROLL", "ITEM_ETC_E060526_SUMMON_PARTY_SCROLL_A")
  InsertPayItemRatio(20, 10, 10, 15, 7, 5, 15, 15, 7, 3, 2, 1, 0.6, 0.5, 1.8, 1, 1, 1, 1, 1, 3)
  LuaInsertDropItem(5, "ITEM_ETC_E110125_HAPPY_H", 15, "ITEM_ETC_E110125_HAPPY_A", 15, "ITEM_ETC_E110125_HAPPY_P", 15, "ITEM_ETC_E110125_HAPPY_P_2", 15, "ITEM_ETC_E110125_HAPPY_Y", 15)
  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_HAPPY_A", "EVENT_MENUSTRING_NOT_ACHIEVED", "SN_TALK_QEV_CH_EVENT_HAPPY_E", "EVENT_MENUSTRING_INVENTORY_FULL", "SN_TALK_QEV_CH_EVENT_HAPPY_D", "EVENT_MENUSTRING_ACHIEVED", "SN_TALK_QEV_CH_EVENT_HAPPY_C")
  CONVERSATION_SINGLE = 0
  LuaInsertFunctionStringList(1, "CONVERSATION_SINGLE", "KISAENG_100315_Conversation")
end
5. And paste an DB-Entry in _RefEvent

Code:
1 4 EVENT_KISAENG_GLOBAL2011_2 SN_QEV_CH_EVENT_KISAENG_GLOBAL2011_2 xxx 0

Compiled everything and paste in the LiveServer - Restart Server - Everything is fine, until we want this Rewards.


- We checked already the Reward Items. Could be possible that some Items are crashing our Gameserver. But everything is fine here.
02/11/2020 19:03 gunneremil#2
[Only registered and activated users can see links. Click Here To Register...]Download [Only registered and activated users can see links. Click Here To Register...] rar archive and remplace scripts in vsro serverfilles folder... work for me
02/14/2020 18:23 guckguck#3
If you are using the "original" @SN_QEV_110221.lua file there will be some infinite loops while dropping the reward.

You can fix this by giving out items 1 by 1 (easy) or change all loops into "for to style" (harder). You can use some logic arround max item stacks, available free slots and dropped items to make it very efficient.