diff options
-rw-r--r-- | npc/019-4-1/chief.txt | 34 |
1 files changed, 34 insertions, 0 deletions
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; |