summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2025-01-11 23:38:59 +0000
committerJesusalva Jesusalva <jesusalva@tmw2.org>2025-01-11 23:38:59 +0000
commit6c4785c4f0e0583555a6970fa74aef4fe8ebfb82 (patch)
treed396c0d8c7b63ee1c5f785872d9f05641538043c
parentde33061871b1bd1d484b13f4746e88e935ba3ac7 (diff)
downloadserverdata-6c4785c4f0e0583555a6970fa74aef4fe8ebfb82.tar.gz
serverdata-6c4785c4f0e0583555a6970fa74aef4fe8ebfb82.tar.bz2
serverdata-6c4785c4f0e0583555a6970fa74aef4fe8ebfb82.tar.xz
serverdata-6c4785c4f0e0583555a6970fa74aef4fe8ebfb82.zip
Stop announcing milestone level-up rewards for reborn characters.
Fixes #90 Is it possible to namespace the new function under Eistein? Like in C++: Eistein::announce_level_reward? Untested (ofc) * !blame GitLab - no way to force pipeline run on a commit containing skip ci tag. FYI in the future we can use git push -o ci.skip to skip on push! * Log a TODO, since noone's going to remember this when the time comes? * Whatever * correct mass tabs2spaces fallout * award->reward * Stop announcing milestone level-up rewards for reborn characters. Fixes #90 **** Approved-by: Jesusalva Jesusalva <jesusalva@tmw2.org>
-rw-r--r--npc/003-2/eistein.txt25
-rw-r--r--npc/003-3/malindou.txt9
2 files changed, 31 insertions, 3 deletions
diff --git a/npc/003-2/eistein.txt b/npc/003-2/eistein.txt
index c8433691e..2b3debd8c 100644
--- a/npc/003-2/eistein.txt
+++ b/npc/003-2/eistein.txt
@@ -5,6 +5,30 @@
// Description:
// Eistein rewards players for getting level landmarks.
+// Hooked into player level-up event
+function script announce_level_reward {
+ // reborn characters will have some milestones complete already.
+ .@q = getq(TulimsharQuest_Eistein);
+
+ switch (BaseLevel) {
+ case 25:
+ if (.@q > 0) break;
+ case 50:
+ if (.@q > 1) break;
+ case 75:
+ if (.@q > 2) break;
+ case 100:
+ if (.@q > 3) break;
+ case 125:
+ if (.@q > 4) break;
+ case 150:
+ if (.@q > 5) break;
+
+ dispbottom l("Milestone levelup: A reward can now be claimed in Tulimshar.");
+ }
+ return;
+}
+
003-2,35,34,0 script Eistein NPC_UKAR,{
// Level, Reward{, Reward2}
@@ -73,6 +97,7 @@
goodbye;
close;
+
OnInit:
.@npcId = getnpcid(.name$);
setunitdata(.@npcId, UDT_HEADTOP, GraduationCap);
diff --git a/npc/003-3/malindou.txt b/npc/003-3/malindou.txt
index 9ee15c013..fb0e48744 100644
--- a/npc/003-3/malindou.txt
+++ b/npc/003-3/malindou.txt
@@ -1120,6 +1120,12 @@ OnGlobalChat:
// Level up events
OnPCBaseLvUpEvent:
+ // In callfunc form in case this script is loaded before Eistein.
+ // TODO: in TMW Evolved's herc it is possible to namespace functions,
+ // namespace this when evolved and ML hercs are merged?
+ // see evolved/serverdata's npc/functions/weather.txt
+ callfunc("announce_level_reward"); // Eistein rewards
+
switch (BaseLevel) {
case 3:
case 5:
@@ -1169,9 +1175,6 @@ OnPCBaseLvUpEvent:
#REFERRAL_CTRL=4;
rodex_sendmail(atoi(gf_charid(#REFERRAL_PROG)), "TMW2 Team", "Recruited Player got Lv 100!", strcharinfo(0)+" just got level 100!\nTime to reap what you've sow for so long!", 0, SupremeGift, 1);
}
- case 125:
- case 150:
- dispbottom l("Milestone levelup: A reward can now be claimed in Tulimshar.");
break;
}
end;