summaryrefslogtreecommitdiff
path: root/npc/functions/global_event_handler.txt
blob: 89df294c741f95b5f8f6d3c18fb0927dfbf00ac2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
-	script	#GlobalHandler	NPC32767,{
    end;

OnPCLoginEvent:
    @login_event = 1;
    adddefaultskills();
    //callfunc "fixHeadStyles"; // convert headstyles
    ClearVariables(); // removes / converts old variables
    DisplayMOTD(); // send the motd to the client, if enabled
    TMWBirthday();
    // add more here
    vaultOnLogin();
    @login_event = 2;
    end;

OnPCLogoutEvent:
    vaultOnLogout();
    end;

OnPCKillEvent:
    elanore_decrease_exp(); // decrease heal exp for doing bad things
    end;

OnNPCKillEvent:
OnMobKillEvent:
    MobPoints();
    end;

OnPCDieEvent:
    @necromancer = 0;
    callfunc "SpawnGhost";
    set @killerrid, 0; // reset killer rid
    end;

// Cleanup: Retain chat logs for 24~48 hours
// Cleanup: Retain item logs for 2 months
OnClock0501:
    query_sql("DELETE FROM `picklog` WHERE `time` < '"+sqldate(0, -2)+"'");
    query_sql("DELETE FROM `zenylog` WHERE `time` < '"+sqldate(0, -2)+"'");
OnClock1701:
    if (gettime(GETTIME_DAYOFMONTH) > 1)
        query_sql("DELETE FROM `chatlog` WHERE `time` < '"+sqldate(-1)+"'");
    end;

OnInit:
    MOTD(); // set the MOTD array
    end;

OnDie:
    percentheal -100, -100;
    end;
}