From af0b861a5e0924258f61c162b17bad741e46f5f6 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 15 Dec 2018 19:06:25 -0200 Subject: Christmas main quest finished (rewards pending. Storage pending.) --- npc/019-4-1/chief.txt | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'npc/019-4-1') diff --git a/npc/019-4-1/chief.txt b/npc/019-4-1/chief.txt index 10c2849a1..41cb40767 100644 --- a/npc/019-4-1/chief.txt +++ b/npc/019-4-1/chief.txt @@ -20,6 +20,28 @@ // World-wide collected gifts count. 019-4-1,56,33,0 script Christmas Chief NPC_GNOME_A,{ + function ScoreXMAS { + .@nb = query_sql("SELECT c.name, i.count2 FROM `quest` AS i, `char` AS c WHERE i.quest_id="+SQuest_Christmas+" AND i.char_id=c.char_id ORDER BY i.count2 DESC LIMIT 5", .@name$, .@value); + + mes "##B"+l("Top 5 - Christmas Box Donation Event")+"##b"; + mes("1."+.@name$[0]+" ("+.@value[0]+")"); + mes("2."+.@name$[1]+" ("+.@value[1]+")"); + mes("3."+.@name$[2]+" ("+.@value[2]+")"); + mes("4."+.@name$[3]+" ("+.@value[3]+")"); + mes("5."+.@name$[4]+" ("+.@value[4]+")"); + next; + + .@nb = query_sql("SELECT c.name, i.count3 FROM `quest` AS i, `char` AS c WHERE i.quest_id="+SQuest_Christmas+" AND i.char_id=c.char_id ORDER BY i.count2 DESC LIMIT 5", .@name$, .@value); + + mes "##B"+l("Top 5 - Golbarez Seasonal Quest")+"##b"; + mes("1."+.@name$[0]+" ("+.@value[0]+" GP)"); + mes("2."+.@name$[1]+" ("+.@value[1]+" GP)"); + mes("3."+.@name$[2]+" ("+.@value[2]+" GP)"); + mes("4."+.@name$[3]+" ("+.@value[3]+" GP)"); + mes("5."+.@name$[4]+" ("+.@value[4]+" GP)"); + next; + } + // Last year if (getq3(SQuest_Christmas) == gettime(GETTIME_YEAR)-1) goto L_Reward; @@ -134,6 +156,9 @@ L_Main: } next; } + goto L_Loop; + +L_Loop: mesn; mesq l("Well, if you want to donate @@, you'll be ranked. There's gift for everyone, and rewards for top 5 donors.", getitemlink(ClosedChristmasBox)); mes ""; @@ -142,6 +167,15 @@ L_Main: l("Scoreboards"), l("Leave"); mes ""; + switch (@menu) { + case 1: + .@am=countitem(ClosedChristmasBox); + delitem ClosedChristmasBox, .@am; + .@q=getq2(SQuest_Christmas); + setq2 SQuest_Christmas, .@q+.@am; + break; + case 2: ScoreXMAS(); goto L_Loop; break; + } close; -- cgit v1.2.3-60-g2f50