diff options
author | wushin <pasekei@gmail.com> | 2013-12-26 07:57:21 -0800 |
---|---|---|
committer | wushin <pasekei@gmail.com> | 2013-12-26 07:57:21 -0800 |
commit | 06c8dd894939d096bc75f3b1c298cf310be7e5fe (patch) | |
tree | 1122db272deff33e017afd9011e6c92ffd3eea59 /world/map/npc/annuals/xmas/list.txt | |
parent | 91498af8d7e3f347ef5bcc3a9b1dc7d91d52fd61 (diff) | |
parent | cd71949def7c2c9b86991b92f4462136671757a3 (diff) | |
download | serverdata-06c8dd894939d096bc75f3b1c298cf310be7e5fe.tar.gz serverdata-06c8dd894939d096bc75f3b1c298cf310be7e5fe.tar.bz2 serverdata-06c8dd894939d096bc75f3b1c298cf310be7e5fe.tar.xz serverdata-06c8dd894939d096bc75f3b1c298cf310be7e5fe.zip |
Merge pull request #62 from wushin/Xmas-Annual
Annual Xmas Event
Diffstat (limited to 'world/map/npc/annuals/xmas/list.txt')
-rw-r--r-- | world/map/npc/annuals/xmas/list.txt | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/world/map/npc/annuals/xmas/list.txt b/world/map/npc/annuals/xmas/list.txt new file mode 100644 index 00000000..a03db395 --- /dev/null +++ b/world/map/npc/annuals/xmas/list.txt @@ -0,0 +1,102 @@ +// This file is part of Christmas Event +// author: Jenalya, Chayenne, cinderweb, wushin +// please see #XmasConfig + +function|script|XmasCheckList|, +{ + set @xmas_list_count, 0; + set @xmas_list_loop, 0; + + if((@xmas_list_deliver) || !(@xmas_list_gather)) + goto L_Return; + +L_Loop: + if(XMASTIME & $@xmas_child_list[@xmas_list_loop]) + goto L_AddOne; + goto L_LoopAgain; + +L_AddOne: + set @xmas_list_count, (@xmas_list_count + 1); + goto L_LoopAgain; + +L_LoopAgain: + if((@xmas_list_loop + 1) == getarraysize($@xmas_child_list)) + goto L_ListTally; + set @xmas_list_loop, (@xmas_list_loop + 1); + goto L_Loop; + +L_ListTally: + if(@xmas_list_count == $@xmas_perfect_list_count) + goto L_PerfectList; + if(@xmas_list_count > $@xmas_required_list_count) + goto L_SetListState; + goto L_Return; + +L_PerfectList: + set XMASTIME, XMASTIME | $@xmas_all_lists_bit; + goto L_SetListState; + +L_SetListState: + set @xmas_state, $@xmas_list_complete_state; + callfunc "XmasSetState"; + goto L_Return; + +L_Return: + set @xmas_list_loop, 0; + return; +} + +function|script|XmasList|, +{ + callfunc "XmasStates"; + + if(($@xmas_time) && (@xmas_list_gather) && !(@xmas_list_complete)) + goto L_QuestTime; + goto L_Return; + +L_QuestTime: + if(XMASTIME & $@xmas_child_list[$@child_number]) + goto L_Return; + goto L_GetList; + +L_GetList: + menu + "Hey, I have come to collect your wish list for Santa", L_List, + "Oh sorry, what were you going to say?", L_Return; + +L_List: + mes "[" + $@xmas_child_list_name$[$@child_number] + "]"; + mes "Here is my list. Make sure it gets delivered, please!"; + next; + mes "You store " + $@xmas_child_list_name$[$@child_number] + "'s wish list carefully in a hidden pocket of your backpack."; + set XMASTIME, XMASTIME | $@xmas_child_list[$@child_number]; + callfunc "XmasXpReward"; + menu + "I really should be going.", L_Return; + +L_Return: + return; +} + +function|script|XmasListList|, +{ + set @xmas_list_loop, 0; + set @xmas_child_loop, 0; + +L_Loop: + set @xmas_child_loop, ($@xmas_child_list[@xmas_list_loop]); + if ((XMASTIME & @xmas_child_loop) != 0) goto L_LoopAgain; + mes "\"" + $@xmas_child_list_name$[@xmas_list_loop] + "\""; + next; + goto L_LoopAgain; + +L_LoopAgain: + if((@xmas_list_loop + 1) == getarraysize($@xmas_child_list_name$)) + goto L_Return; + set @xmas_list_loop, (@xmas_list_loop + 1); + goto L_Loop; + +L_Return: + set @xmas_list_loop, 0; + return; +} |