From b5bef5ac0a351b6954282ad08dff0a2ac41bd731 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 18 May 2020 08:01:14 -0300 Subject: Hopefully, if I did not forgot a bug along the way: Aurora Ranked Events will be working! \o/ Remember to submit daily in order to get your points :3 --- npc/003-1/events.txt | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'npc/003-1') diff --git a/npc/003-1/events.txt b/npc/003-1/events.txt index 09cc3da43..6521667f1 100644 --- a/npc/003-1/events.txt +++ b/npc/003-1/events.txt @@ -311,12 +311,6 @@ function handleStPatrick { L_Aurora: // Define script variables .@WHAT$=l("event"); - // TODO: Three arrays: Min points, Reward ID, Reward Amount - // A default, and the script may also override - // (But, hmm, functions. Nasty; Better have them declared in aurora.txt) - // FIXME: Server restart and data loss - // TODO: Handle the collecting things in an extra menu / function; The core - // should be in aurora.txt // Fill them with specific details, if available if ($EVENT$ == "Expo") { @@ -416,6 +410,7 @@ function auroraRankings { return; } + function auroraCurrentRankings { if (FYEventUsesRanking()) { HallOfAurora(); @@ -426,11 +421,31 @@ function auroraCurrentRankings { return; } -// TODO + function auroraListRewards { + .@s=getq2(Q_AuroraEvent); + .@r=getq3(Q_AuroraEvent); + mesn; + freeloop(true); + for (.@i=0; .@i < getarraysize($FYREWARD_PT); .@i++) { + mes l("%d pts - %d %s", + $FYREWARD_PT[.@i], $FYREWARD_AM[.@i], getitemlink($FYREWARD_ID[.@i])); + // You're at this milestone? Hmm + if (.@r == .@i) { + // Your score is enough: rank you up + if (.@s >= $FYREWARD_PT[.@i]) { + inventoryplace $FYREWARD_ID[.@i], $FYREWARD_AM[.@i]; + getitem $FYREWARD_ID[.@i], $FYREWARD_AM[.@i]; + .@r+=1; + setq3 Q_AuroraEvent, .@r; + } + } + } + freeloop(false); return; } + function auroraSubmit { .@q2=getq2(Q_AuroraEvent); FYE_Submit(); -- cgit v1.2.3-70-g09d2