diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-08-05 15:03:15 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-08-05 15:03:15 -0300 |
commit | 60a1a09e65b1d0454cc6abdd4d4ef4966a6d283d (patch) | |
tree | 2ce1b2027119b7898e19f6319e79b724001c30ea /npc | |
parent | 01c5867999b02f367d74698d73638a0104572c67 (diff) | |
download | serverdata-jesusalva/masterpatch.tar.gz serverdata-jesusalva/masterpatch.tar.bz2 serverdata-jesusalva/masterpatch.tar.xz serverdata-jesusalva/masterpatch.zip |
Placeholder to send referrer rewards.jesusalva/masterpatch
The rewards themselves have dependencies. So skipped for MR 243.
/wip
Diffstat (limited to 'npc')
-rw-r--r-- | npc/functions/global_event_handler.txt | 1 | ||||
-rw-r--r-- | npc/functions/referral.txt | 54 | ||||
-rw-r--r-- | npc/items/gift.txt | 3 | ||||
-rw-r--r-- | npc/scripts.conf | 1 |
4 files changed, 59 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; +} + + diff --git a/npc/items/gift.txt b/npc/items/gift.txt index 9f5296f3..68e94595 100644 --- a/npc/items/gift.txt +++ b/npc/items/gift.txt @@ -8,7 +8,10 @@ function script OpenFriendGift { dispbottom l("You must reach level 5 to open this gift."); getitembound FriendGift, 1, 1; } else { + // FIXME PLACEHOLDER !! + getitem Acorn, 1; //getitem EventCoin, rand(1,3); + .@aid=getvaultvar(REFERRAL_PROG); .@vid="playerCache"::account2vault(.@aid); .@cid="playerCache"::account2char(.@aid); diff --git a/npc/scripts.conf b/npc/scripts.conf index d060ccb7..7bc709ad 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -62,6 +62,7 @@ "npc/functions/skills.txt", "npc/functions/lockpicks.txt", "npc/functions/crafting.txt", +"npc/functions/referral.txt", // quest debug "npc/functions/quest-debug/functions.txt", |