summaryrefslogtreecommitdiff
path: root/npc/009-7/eventHandler.txt
blob: 0ddf96d2bff04d0039d8279ec9189bf9f4dd7d15 (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
84
85
86
87
88
009-7,45,33,0	script	#trapdoor2FightClub	NPC327,0,0,{
    if(countitem(647)||countitem(725)||countitem(1178)||countitem(5131)||countitem(5132)||countitem(5133)||countitem(5134)||countitem(5135)||countitem(5136)||countitem(5137)||countitem(5138)||countitem(5139)||countitem(5140)||(getgmlevel()>=20)) goto L_Enter;
    end;

L_Enter:
    warp "009-7",34,22; // this warp is a special thanks for contributors
    end;
}
009-7,33,21,0	script	#trapdoor3FightClub	NPC327,0,0,{
    warp "009-7",44,32;
    end;
}

009-7,22,38,0	script	#FightClubUtils	NPC32767,{
    end;

OnIntrusion:
    if(getgmlevel() >= 60) end; // allow GMs to be in the ring
    if(getcharid(3) == $@Duel_RedPlayer) end; // do not kill the red fighter
    if(getcharid(3) == $@Duel_BluePlayer) end; // do not kill the blue fighter
    donpcevent "Rouge#Duels::OnAnnounceIntrusion";
    callfunc "fightclub_DestroyMe"; // only kill the intruder(s)
    end;

OnDelayedStart:
    callfunc "fightclub_StartBattle";
    end;

OnDelayedNextBattle:
    callfunc "fightclub_NextBattleProceed";
    end;

OnBecomeKiller:
    callfunc "fightclub_enter_killer";
    end;

OnCommandIntrusion:
    areatimer 0, "009-7", $@fightclub_x1, $@fightclub_y1, $@fightclub_x2, $@fightclub_y2, 0, "#FightClubUtils::OnIntrusion"; // we can not do this directly on #handler because it already have a timer
    end;
}

009-7,20,45,0	script	#FightClubTimeLimit	NPC32767,0,0,{
    end;

OnStartTimer:
    $@Duel_TotalTime = 0;
    goto L_StartTimer;

OnStopTimer:
    stopnpctimer;
    end;

OnTimer1000:
    $@Duel_TotalTime = ($@Duel_TotalTime + 1);
    if($@Duel_TotalTime >= $@Duel_TimeLimit) goto L_TimeOut;
    goto L_StartTimer;

L_TimeOut:
    stopnpctimer;
    callfunc "fightclub_TimeOut";
    end;

L_StartTimer:
    setnpctimer 0;
    initnpctimer;
    end;

OnInit:
    $@Duel_TotalTime = 0;
    end;
}

009-7,20,44,0	script	#FightClubHandler	NPC32767,0,0,{
    end;

OnInit:
    // this event is called when the map server boots up
    $@fightclub_x1 = 27;
    $@fightclub_y1 = 42;
    $@fightclub_x2 = 38;
    $@fightclub_y2 = 48;
    end;

OnTimer2000:
    // this events checks who is on stage every 2 seconds
    end;
}