summaryrefslogtreecommitdiff
path: root/world/map
diff options
context:
space:
mode:
authorHello TMW <hello@themanaworld.org>2024-10-30 19:16:38 +0000
committerLed Mitz <smoothshifter@tuta.io>2024-10-30 19:16:38 +0000
commitcfe87b027d8b3f6dd01acf21cc6e7187c6a96283 (patch)
treed95fd489fb729cbab8cc1c4473e018465028e3f5 /world/map
parentad066a6c3faf848f3fc82c58bfbc8eaa1a422ea4 (diff)
downloadserverdata-cfe87b027d8b3f6dd01acf21cc6e7187c6a96283.tar.gz
serverdata-cfe87b027d8b3f6dd01acf21cc6e7187c6a96283.tar.bz2
serverdata-cfe87b027d8b3f6dd01acf21cc6e7187c6a96283.tar.xz
serverdata-cfe87b027d8b3f6dd01acf21cc6e7187c6a96283.zip
This implements simple system allowing to award boss points to person who killed eventer playing powerfull boss.
It implemented by setting PC_BOSS_REWARD character variable via @setvar on eventer. If this variable set on killed character, its value = amount of boss points to award to PK killer.
Diffstat (limited to 'world/map')
-rw-r--r--world/map/npc/functions/global_event_handler.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/world/map/npc/functions/global_event_handler.txt b/world/map/npc/functions/global_event_handler.txt
index b1c5917e..dfc7966f 100644
--- a/world/map/npc/functions/global_event_handler.txt
+++ b/world/map/npc/functions/global_event_handler.txt
@@ -20,11 +20,13 @@ OnPCLoginEvent:
callfunc "VaultLogin"; // Mirror Lake Protocol biddings
callfunc "VaultLogout"; // Clean some stuff, to be safe
if (WEIGHT_LIMIT) set MaxWeightOverride, WEIGHT_LIMIT; // If this char var set, override max weight (tradebots, etc)
+ if (PC_BOSS_REWARD) set @PC_BOSS_REWARD, PC_BOSS_REWARD; // Load tempvar from per-acct var (needed by maybe_reward_boss_kill)
// add more here
set @login_event, 2;
end;
OnPCKillEvent:
+ callfunc "maybe_reward_boss_kill";
callfunc "elanore_decrease_exp"; // decrease heal exp for doing bad things
callfunc "SweetTooth";
end;
@@ -59,3 +61,18 @@ OnDay0411:
callfunc "MaybeAnnounceBirthday";
end;
}
+
+// Inputs: nothing, but assumes RID attached and @victimrid set on PK kill
+// Return: nothing, but adjusts BOSS_POINTS
+// TODO: move this func somewhere else maybe?
+function|script|maybe_reward_boss_kill
+{ // not here or lacks reward for head -> skip rewarding.
+ if ((@victimrid < 1) || !(isloggedin(@victimrid)) || (get(@PC_BOSS_REWARD, @victimrid)) < 1) goto L_SkipReward;
+ set BOSS_POINTS, (BOSS_POINTS + get(@PC_BOSS_REWARD, @victimrid));
+ message strcharinfo(0), "[boss reward] : you killed eventer-controlled boss and gained " + get(@PC_BOSS_REWARD, @victimrid) +
+ " boss points, for total of " + BOSS_POINTS + " boss points";
+ return;
+
+L_SkipReward:
+ return;
+}