// This is the global event dispatcher // Do not add code to this file. Please only add callfuncs // // Author: meko -|script|#GlobalHandler|32767 { end; OnPCLoginEvent: set @login_event, 1; callfunc "fixHeadStyles"; // convert headstyles callfunc "ClearVariables"; // removes / converts old variables callfunc "DisplayMOTD"; // send the motd to the client, if enabled callfunc "getBroadcast"; // get the scheduled broadcast, if any addtimer 0, "Magic Timer::OnLogin"; // prevent cast rate abuse callfunc "MaybeGiveBirthday"; callfunc "MiriamExpire"; // force the speed skill quest to expire callfunc "ConvertChristmas21"; // Christmas 2021 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; OnMobKillEvent: callfunc "MobPoints"; callfunc "MobKillHandler"; callfunc "SweetTooth"; callfunc "spawns_on_mobkill"; end; OnPCDieEvent: set @necromancer, 0; addtimer 0, "Magic Timer::OnClear"; // reset magic block on death addtimer 0, "::OnDischarge"; // seeks OnDischarge in ALL npcs (discharge chargeable spells on PC death) callfunc "SpawnGhost"; callfunc "MiriamExpire"; // force the speed skill quest to expire set @killerrid, 0; // reset killer rid set TowelLastUsed, gettimetick(2); // reset towel cooldown timer end; OnPCLogoutEvent: if (getnpcid("#Upmarmu#" + getcharid(3)) >= 1) addnpctimer 0, "#Upmarmu#" + getcharid(3) + "::OnDestroy"; // @upmarmu_spell_npc_name$ is already lost at this point so it must be done like this callfunc "VaultLogout"; end; OnInit: callfunc "ClearGlobalVars"; callfunc "MOTD"; // set the MOTD array end; 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; }