summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/global_event_handler.txt1
-rw-r--r--npc/functions/referral.txt54
2 files changed, 55 insertions, 0 deletions
diff --git a/npc/functions/global_event_handler.txt b/npc/functions/global_event_handler.txt
index a6d634ed..bc469645 100644
--- a/npc/functions/global_event_handler.txt
+++ b/npc/functions/global_event_handler.txt
@@ -44,6 +44,7 @@ OnPCDieEvent:
OnPCBaseLvUpEvent:
//callfunc("newquestwarning");
+ callfunc("ReferralSendLvReward");
end;
OnNPCKillEvent:
diff --git a/npc/functions/referral.txt b/npc/functions/referral.txt
new file mode 100644
index 00000000..48231992
--- /dev/null
+++ b/npc/functions/referral.txt
@@ -0,0 +1,54 @@
+// The Mana World scripts.
+// Author:
+// Moubootaur Legends Team
+// Jesusalva
+// Description:
+// Referral System - rewards
+// Note: Does not support multi-levelup
+
+function script ReferralSendLvReward {
+ .@referv=getvaultvar(REFERRAL_PROG);
+ if (.@referv < 1)
+ return;
+
+ .@cid="playerCache"::account2char(.@aid);
+ .@status=getvaultvar(REFERRAL_CTRL);
+ switch (BaseLevel) {
+ case 25:
+ if (.@status > 1)
+ break;
+
+ // FIXME PLACEHOLDER !!
+ rodex_sendmail(.@cid, "TMW Team", "Recruited Player got Lv 25!", strcharinfo(0)+" just got level 25!\nAs they get stronger, more rewards will be sent to you!", 0, Acorn, 1);
+ .@status+=1;
+ break;
+ case 50:
+ if (.@status > 2)
+ break;
+
+ // FIXME PLACEHOLDER !!
+ rodex_sendmail(.@cid, "TMW Team", "Recruited Player got Lv 25!", strcharinfo(0)+" just got level 25!\nAs they get stronger, more rewards will be sent to you!", 0, Acorn, 1);
+ .@status+=1;
+ break;
+ case 75:
+ if (.@status > 3)
+ break;
+
+ // FIXME PLACEHOLDER !!
+ rodex_sendmail(.@cid, "TMW Team", "Recruited Player got Lv 25!", strcharinfo(0)+" just got level 25!\nAs they get stronger, more rewards will be sent to you!", 0, Acorn, 1);
+ .@status+=1;
+ break;
+ case 100:
+ if (.@status > 4)
+ break;
+
+ // FIXME PLACEHOLDER !!
+ rodex_sendmail(.@cid, "TMW Team", "Recruited Player got Lv 25!", strcharinfo(0)+" just got level 25!\nAs they get stronger, more rewards will be sent to you!", 0, Acorn, 1);
+ .@status+=1;
+ break;
+ }
+ setvaultvar(REFERRAL_CTRL, .@status);
+ return;
+}
+
+