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 | |
parent | c28556b29597dd95ccae9adf487df28c828ff670 (diff) | |
download | serverdata-ac10f5f2753fec48d6c742d33acb052a100d15e1.tar.gz serverdata-ac10f5f2753fec48d6c742d33acb052a100d15e1.tar.bz2 serverdata-ac10f5f2753fec48d6c742d33acb052a100d15e1.tar.xz serverdata-ac10f5f2753fec48d6c742d33acb052a100d15e1.zip |
Refactor Christmas scoreboards
-rw-r--r-- | npc/019-4-1/chief.txt | 32 | ||||
-rw-r--r-- | npc/functions/scoreboards.txt | 4 |
2 files changed, 19 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]) diff --git a/npc/functions/scoreboards.txt b/npc/functions/scoreboards.txt index bc7f0a72d..dd216e24f 100644 --- a/npc/functions/scoreboards.txt +++ b/npc/functions/scoreboards.txt @@ -43,6 +43,10 @@ OnInit: if (season() == SUMMER || season() == AUTUMN) { .@nb = query_sql("SELECT c.name, i.count2 FROM `quest` AS i, `char` AS c WHERE i.quest_id=305 AND i.char_id=c.char_id AND i.count1="+(gettime(GETTIME_YEAR)-2000)+" ORDER BY i.count2 DESC LIMIT 10", $@ched_name$, $@ched_value); } + if (season() == WINTER || season() == SPRING) { + .@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", $@xmas_box_name$, $@xmas_box_value); + .@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", $@xmas_gp_name$, $@xmas_gp_value); + } debugmes "Scoreboards reloaded"; end; } |