diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-12-19 03:53:36 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-12-19 03:53:36 -0300 |
commit | ac10f5f2753fec48d6c742d33acb052a100d15e1 (patch) | |
tree | ab7e7633049a5473994e26afd00a953bfbbe3436 /npc/019-4-1 | |
parent | c28556b29597dd95ccae9adf487df28c828ff670 (diff) | |
download | serverdata-ac10f5f2753fec48d6c742d33acb052a100d15e1.tar.gz serverdata-ac10f5f2753fec48d6c742d33acb052a100d15e1.tar.bz2 serverdata-ac10f5f2753fec48d6c742d33acb052a100d15e1.tar.xz serverdata-ac10f5f2753fec48d6c742d33acb052a100d15e1.zip |
Refactor Christmas scoreboards
Diffstat (limited to 'npc/019-4-1')
-rw-r--r-- | npc/019-4-1/chief.txt | 32 |
1 files changed, 15 insertions, 17 deletions
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]) |