diff options
author | Jesusaves <cpntb1@ymail.com> | 2018-07-02 01:16:50 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2018-07-02 01:16:50 -0300 |
commit | 288b6ab89ce310701f43360f2090aa207969d2d8 (patch) | |
tree | 2b48bd8bb8dbb03ca07efab179b6116d8cfc4ecf /npc/003-1 | |
parent | 25b3a46418067cf011af4461460aeba219e18afa (diff) | |
download | serverdata-288b6ab89ce310701f43360f2090aa207969d2d8.tar.gz serverdata-288b6ab89ce310701f43360f2090aa207969d2d8.tar.bz2 serverdata-288b6ab89ce310701f43360f2090aa207969d2d8.tar.xz serverdata-288b6ab89ce310701f43360f2090aa207969d2d8.zip |
Saulc asked for a quest I didn't wanted to add, but he is my friend, so add it.
Well, it was reasonable and doable. Reward is entirely upon @Saulc .
Claiming rewards during summer is NOT allowed, even if code could be changed.
It is not impossible to do, but I'll save it for 2019.
Diffstat (limited to 'npc/003-1')
-rw-r--r-- | npc/003-1/ched.txt | 101 |
1 files changed, 100 insertions, 1 deletions
diff --git a/npc/003-1/ched.txt b/npc/003-1/ched.txt index 3ef4b1c56..9ef2a8d5c 100644 --- a/npc/003-1/ched.txt +++ b/npc/003-1/ched.txt @@ -1,14 +1,113 @@ // TMW2 scripts. // Author: // Saulc +// Jesusalva // Description: // Ched is from a quest. - +// But as he is now unused, he'll become someone else on summer. 003-1,62,48,0 script Ched NPC_PLAYER,{ + function ValidSSC { + return countitem(CactusCoktail)+countitem(CherryCoktail)+countitem(AppleCoktail); + } + function ScoreSSC { + .@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 ORDER BY i.count2 DESC LIMIT 10", .@name$, .@value); + + mes "##B"+l("Top 10 - Summer Ched's 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("6."+.@name$[5]+" ("+.@value[5]+")"); + mes("7."+.@name$[6]+" ("+.@value[6]+")"); + mes("8."+.@name$[7]+" ("+.@value[7]+")"); + mes("9."+.@name$[8]+" ("+.@value[8]+")"); + mes("10."+.@name$[9]+" ("+.@value[9]+")"); + next; + } + function InfoSSC { + mesc l("@@ - @@ point(s)", getitemlink(CactusCocktail), "1"); + mesc l("@@ - @@ point(s)", getitemlink(CherryCocktail), "3"); + mesc l("@@ - @@ point(s)", getitemlink(AppleCocktail), "5"); + next; + } + function DepositSSC { + .@pts=.@pts+countitem(CactusCoktail)*1; + .@pts=.@pts+countitem(CherryCoktail)*3; + .@pts=.@pts+countitem(AppleCoktail)*5; + + delitem CactusCocktail, countitem(CactusCoktail); + delitem CherryCocktail, countitem(CherryCoktail); + delitem AppleCocktail, countitem(AppleCoktail); + + getexp rand(.@pts-1, .@pts*11/10), rand(0,.@pts/25); + + setq2 SQuest_Ched, @ched+.@pts; + @ched=getq2(SQuest_Ched); + mesc l("Gained @@ points.", .@pts), 3; + next; + mesc l("Your Score: @@", @ched), 1; + mes ""; + ScoreSSC; + close; + } + + // Begin: Ched + .@year=getq(SQuest_Ched); + if (.@year != (gettime(GETTIME_YEAR)-2000)) + setq SQuest_Ched, (gettime(GETTIME_YEAR)-2000), 0, 0; + @ched=getq2(SQuest_Ched); + .@claimed=getq3(SQuest_Ched); // Required to prevent rewriting scoreboards + + if (season() == SUMMER && @ched <= 0) goto L_Summer; + if ((season() == AUTUMN && !.@claimed) || is_gm()) goto L_Autumn; hello; + end; + +// Summer Event +L_Summer: + if (BaseLevel < 25) { + mesn; + mesq l("Get Rekt Noob."); + close; + } + + // Main Core + do + { + mesn; + mesc l("Current score: @@", @ched), 1; + mesc l("Thus far you have collected @@ @@, @@ @@ and @@ @@.", countitem(CactusCoktail), getitemlink(CactusCocktail), countitem(AppleCocktail), getitemlink(AppleCocktail), countitem(CherryCocktail), getitemlink(CherryCocktail)), 2; + mesc l("You can convert these items in event points and claim rewards at autumn."), 2; + next; + select + l("Scoreboards"), + l("Information"), + rif(ValidSSC(), l("Deposit all")), + l("Abort"); + mes ""; + if (@menu == 1) + ScoreSSC; + if (@menu == 2) + InfoSSC; + if (@menu == 3) + DepositSSC; + + } while (@menu < 3); + close; +// Summer Quest Claim Rewards Time +L_Autumn: + mesc l("Your Score: @@", @ched), 1; + mes ""; + ScoreSSC; + next; + // TODO: Do whatever reward whatever way you want whatever whatevers. + Zeny=Zeny+@ched; + setq3 SQuest_Ched, 1; + close; OnInit: .@npcId = getnpcid(0, .name$); |