summaryrefslogtreecommitdiff
path: root/npc/functions/dungeon.txt
blob: 2cd4bbd0818e56dc1ab7cb251694e1b322b7032b (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// TMW2 Script
// Authors:
//    Jesusalva
// Description:
//    Dungeon utilities

-	script	#DungeonCore	NPC_HIDDEN,{
    end;

// Main initialization
OnInit:
    setarray .heatmap$, "007-2";
    setarray .cursemap$, "006-4", "006-4-1";
    end;

// Heartbeat for Heat effects
OnHeat:
    // Did you left?
    .@i=array_find(.heatmap$, getmap());
    if (.@i < 0) {
        @heat$="";
        end;
    }

    // First time seeing this
    if (@heat$ != getmap()) {
        @heat$=getmap();
        dispbottom l("This is a hot map, you're suffering damage over time.");
    }

    // You are in a HEATMAP$, so suffer damage from heat
    if (@coolio > gettimetick(2))
        percentheal -1, 0;
    else
        percentheal -5, 0;

    // New tick (dies in 140~180 seconds)
    addtimer2 rand2(7000, 9000), .name$+"::OnHeat";
    end;


/////////////////////////////////////////
// Heartbeat for Cursed Land map effects
OnCurse:
    // Did you left?
    .@i=array_find(.cursemap$, getmap());
    if (.@i < 0) {
        @curse$="";
        end;
    }

    // First time seeing this
    if (@curse$ != getmap()) {
        @curse$=getmap();
        dispbottom l("This is a Cursed Lands map, you're lose mana over time and may also incurr in debuffs if mana is low.");
    }

    // You are in a CURSEMAP$, so suffer damage from heat
    if (@purifio > gettimetick(2))
        percentheal 0, -5;
    else
        percentheal 0, -1;

    // MP is below 20%, you'll get cursed
    if (Sp*100 < MaxSp*20)
        SC_Bonus(10, SC_CURSE, 1);

    // MP is below 1%, you'll get start losing HP rapidly
    if (Sp*100 < MaxSp)
        percentheal -7, 0;

    // New tick (dies in 140~180 seconds)
    addtimer2 rand2(7000, 9000), .name$+"::OnCurse";
    end;
}

//////////////////////////////
007-2	mapflag	nosave	007-1,99,189
006-4	mapflag	nosave	006-3,54,36
006-4-1	mapflag	nosave	006-3,54,36