summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/003-1/events.txt16
-rw-r--r--npc/functions/aurora.txt56
2 files changed, 61 insertions, 11 deletions
diff --git a/npc/003-1/events.txt b/npc/003-1/events.txt
index efbc745ae..09cc3da43 100644
--- a/npc/003-1/events.txt
+++ b/npc/003-1/events.txt
@@ -22,7 +22,7 @@
// Aurora Event functions
function auroraRankings;
function auroraCurrentRankings;
- function auroraClaimRewards;
+ function auroraSubmit;
function auroraListRewards;
// Handle annuals
@@ -341,8 +341,8 @@ L_Aurora:
l("Event Details"),
l("Event Ranking Rewards"),
rif(FYEventUsesRanking(), l("Current Rankings")),
- rif(FYEventUsesRanking(), l("List rewards")),
- rif(FYEventUsesRanking(), l("Claim rewards")),
+ rif(FYEventUsesRanking(), l("List & Claim rewards")),
+ rif(FYEventUsesRanking(), l("Submit to ranking")),
l("That's all, thanks!");
mes "";
switch (@menu) {
@@ -371,7 +371,7 @@ L_Aurora:
break;
case 5:
- auroraClaimRewards();
+ auroraSubmit();
break;
default:
@@ -427,11 +427,14 @@ function auroraCurrentRankings {
}
// TODO
-function auroraClaimRewards {
+function auroraListRewards {
return;
}
-function auroraListRewards {
+function auroraSubmit {
+ .@q2=getq2(Q_AuroraEvent);
+ FYE_Submit();
+ mesc l("Event score: %d -> %d", .@q2, getq2(Q_AuroraEvent));
return;
}
@@ -456,6 +459,7 @@ function auroraListRewards {
+
// DO NOT REMOVE
}
diff --git a/npc/functions/aurora.txt b/npc/functions/aurora.txt
index c5041c04a..275bbc8dd 100644
--- a/npc/functions/aurora.txt
+++ b/npc/functions/aurora.txt
@@ -195,7 +195,7 @@ function script FYEConf_Regnum {
// Configure World Expo
function script FYEConf_Expo {
- $WORLDEXPO_ENEMY$=any("Xakabael the Dark", "Isbamuth", "Saulc", "SUSAN");
+ $WORLDEXPO_ENEMY$=any("Xakabael the Dark", "Isbamuth", "Saulc", "SUSAN", "Terogan");
setarray $FYREWARD_PT, 100, 200;
setarray $FYREWARD_ID, Bread, Bread;
setarray $FYREWARD_AM, 1, 2;
@@ -236,6 +236,54 @@ function script FYE_Fishing {
}
+
+
+
+
+// "Submit" button from 003-1/events.txt
+// Don't forget to enable it in npc/utils.txt as well!!
+function script FYE_Submit {
+ .@day=getq(Q_AuroraEvent);
+ .@pts=getq2(Q_AuroraEvent);
+
+ // Handle daily login score rewards
+ if (.@day != gettimeparam(GETTIME_DAYOFMONTH)) {
+ setq1 Q_AuroraEvent, gettimeparam(GETTIME_DAYOFMONTH);
+ setq2 Q_AuroraEvent, .@pts+$FYLOGIN_PTS;
+ .@pts=getq2(Q_AuroraEvent);
+ if ($FYLOGIN_PTS)
+ dispbottom l("Daily Event Bonus: %d Points!", $FYLOGIN_PTS);
+ }
+
+ // Give you points
+ if ($EVENT$ == "Expo") {
+ // .:: WORLD EXPO EVENT ::.
+ .@pts+=countitem(EventTreasure1)*1;
+ .@pts+=countitem(EventTreasure2)*3;
+ .@pts+=countitem(EventTreasure3)*5;
+
+ setq2 Q_AuroraEvent, .@pts;
+ delitem EventTreasure1, countitem(EventTreasure1);
+ delitem EventTreasure2, countitem(EventTreasure2);
+ delitem EventTreasure3, countitem(EventTreasure3);
+ } else if ($EVENT$ == "Fishing") {
+ // .:: CATCH THE GOLD FISH EVENT ::.
+ .@pts+=countitem(EventFish)*1;
+
+ setq2 Q_AuroraEvent, .@pts;
+ delitem EventFish, countitem(EventFish);
+ } else {
+ // Wut? This is not an Aurora Event
+ Exception($EVENT$+" is NOT a valid Aurora Event; Misdefinition.\n\nPlease ensure that it is defined in utils, aurora, news, and command/event.\n\nFYE_Submit - FYEventUsesRanking - FYE_* - FYEConf_* - FYStopEvent", RB_DEFAULT|RB_ISFATAL);
+ }
+ return;
+}
+
+
+
+
+
+
// Stops any Aurora Event
function script FYStopEvent {
setarray .@av$, "Kamelot", "Regnum", "Expo", "Fishing";
@@ -247,10 +295,9 @@ function script FYStopEvent {
}
-// Handle the ending of Aurora Events
+// Handle the ending of Aurora Events (see also functions/util.txt)
function script FYRewardEvent {
- setarray .@av$, "Expo", "Fishing";
- if (array_find(.@av$, $EVENT$) >= 0) {
+ if (FYEventUsesRanking()) {
debugmes("Rewards are due");
// This code absolutely can't fail:
.@nb = query_sql("SELECT c.name, i.count2, c.char_id FROM `quest` AS i, `char` AS c WHERE i.quest_id="+Q_AuroraEvent+" AND i.char_id=c.char_id ORDER BY i.count2 DESC LIMIT 10", $@aurora_name$, $@aurora_value, $@aurora_charid);
@@ -285,7 +332,6 @@ function script FYRewardEvent {
}
-
// Normalize Aurora Event after a server restart
function script FYE_Normalize {
if ($EVENT$ == "Regnum") {