From ac10f5f2753fec48d6c742d33acb052a100d15e1 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 19 Dec 2019 03:53:36 -0300 Subject: Refactor Christmas scoreboards --- npc/019-4-1/chief.txt | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'npc/019-4-1') diff --git a/npc/019-4-1/chief.txt b/npc/019-4-1/chief.txt index 006813641..e00fa58a8 100644 --- a/npc/019-4-1/chief.txt +++ b/npc/019-4-1/chief.txt @@ -21,24 +21,21 @@ 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]+")"); + mes("1."+$@xmas_box_name$[0]+" ("+$@xmas_box_value[0]+")"); + mes("2."+$@xmas_box_name$[1]+" ("+$@xmas_box_value[1]+")"); + mes("3."+$@xmas_box_name$[2]+" ("+$@xmas_box_value[2]+")"); + mes("4."+$@xmas_box_name$[3]+" ("+$@xmas_box_value[3]+")"); + mes("5."+$@xmas_box_name$[4]+" ("+$@xmas_box_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.count3 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)"); + mes("1."+$@xmas_gp_name$[0]+" ("+$@xmas_gp_value[0]+" GP)"); + mes("2."+$@xmas_gp_name$[1]+" ("+$@xmas_gp_value[1]+" GP)"); + mes("3."+$@xmas_gp_name$[2]+" ("+$@xmas_gp_value[2]+" GP)"); + mes("4."+$@xmas_gp_name$[3]+" ("+$@xmas_gp_value[3]+" GP)"); + mes("5."+$@xmas_gp_name$[4]+" ("+$@xmas_gp_value[4]+" GP)"); next; } @@ -74,12 +71,13 @@ L_Reward: .@gifts=min(15, log2($XMAS_GIFTS/100))+1; if (.@q1 >= .@gifts) getitem XmasGift, .@gifts; - .@nb = query_sql("SELECT c.name 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$); - if (strcharinfo(0) == .@name$[0]) + + // Top 5 rewards + if (strcharinfo(0) == $@xmas_box_name$[0]) makepet CattyCat; - else if (strcharinfo(0) == .@name$[1] || strcharinfo(0) == .@name$[2]) + else if (strcharinfo(0) == $@xmas_box_name$[1] || strcharinfo(0) == $@xmas_box_name$[2]) getitem RedStocking, 1; - else if (strcharinfo(0) == .@name$[3] || strcharinfo(0) == .@name$[4]) + else if (strcharinfo(0) == $@xmas_box_name$[3] || strcharinfo(0) == $@xmas_box_name$[4]) getitem XmasGift, 1; if (strcharinfo(0) == .@name$[0]) -- cgit v1.2.3-70-g09d2