summaryrefslogtreecommitdiff
path: root/npc/magic/revive.txt
blob: 96620c7e438b9755a50dad9d701b81f285319063 (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
// TMW2 script
// Author: Jesusalva <admin@tmw2.org>
//
// Magic Script: TMW2_REVIVE
// Magic Script: TMW2_RESSURECT
//
// Skill to revive players
// TODO: Reimburse EXP?

// revive target (level, target)
function	script	SK_resurrect	{
    .@lv=getarg(0);
    .@tg=getarg(1);
    .@me=getcharid(3);
    attachrid(.@tg);
    if (ispcdead()) {
        recovery(.@tg);
        percentheal 100, 0;
        percentheal -(100 - 10 * .@lv), 0;
    }
    detachrid();
    attachrid(.@me);
	return;
}

// revives getarg(0)
function	script	SK_revive	{
	.@target=getarg(0);
	if (getunittype(.@target) != UNITTYPE_PC) {
		dispbottom l("This skill can only be used on players!");
		return;
	}
    recovery(.@target);
	return;
}

// revive in getarg(0) range from caster
function	script	SK_ressurect	{
    .@r=getarg(0);
    getmapxy(.@m$, .@x, .@y, 0);
    recovery(.@m$, .@x-.@r, .@y-.@r, .@x+.@r, .@y+.@r);
	return;
}

// revives the whole map [ULTIMATE]
function	script	SK_sanctum	{
    BaseLevel-=1; // Maybe EXP Gain -300% for a hour?
    recovery(getmap());
    //maptimer AUTOREVIVE 15 minutes
	return;
}