summaryrefslogtreecommitdiff
path: root/world/map/npc/009-7/battlemaster.txt
blob: e211092cc488781485c2a4aba96a3bb5db3372d8 (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
009-7.gat,40,35,0|script|Battle Master#Duels|322,
{
  if(($fightclub_enabled % 6) != 3) goto L_Disabled;
  mes "[Battle Master]";
  mes "\"Hey, you seem tough enough! Would you like to prove your skills?\"";
  next;
  menu
    "PvP Cave (50gp)", L_PVP,
    "Last Man Standing (150gp)", L_Brodomir,
    "Nevermind.", L_Next;

L_Disabled:
  mes "[Battle Master]";
  mes "I am busy, come back later.";
  close;

L_Next:
  mes "[Battle Master]";
  mes "\"Ha ha, coward.\"";
  close;

L_Brodomir:
  if (Zeny < 150) goto L_NoMoney;
  set Zeny, Zeny - 150;
  mes "[Battle Master]";
  mes "\"Get ready!\"";
  close2;
  set Duel_LMS, 1; // tell the arena to send the player back here when he exits
  warp "009-6.gat", 33, 37;
  savepoint "009-7.gat", 39, 37;
  end;

L_PVP:
  if (Zeny < 50) goto L_NoMoney;
  set Zeny, Zeny - 50;
  mes "[Battle Master]";
  mes "\"Get ready!\"";
  close2;
  set Duel_PVP, 1; // tell the arena to send the player back here when he dies
  warp "001-3.gat", 0, 0;
  savepoint "009-7.gat", 39, 37;
  end;

L_NoMoney:
  mes "\"Wait a second, you don't have enough money.\"";
  close;
}


// death and exit handlers below

function|script|fightclub_GoBack|,
{
  if(Duel_LMS == 1) goto L_GoBack;
  return;

L_GoBack:
  set Duel_LMS, 0;
  warp "009-7.gat", 39, 37;
  gmcommand "@alive";
  message strcharinfo(0), "Thank you for participating in Last Man Standing!";
  return;

L_Clean:
  set Duel_LMS, 0;
  return;

L_Death:
  if((Duel_LMS != 1) && ((getmap() == "009-6") || (getmap() == "009-5"))) L_NormalExit;
  if(Duel_LMS != 1) end;
  if((getmap() != "009-6") && (getmap() != "009-5")) goto L_Clean;
  goto L_GoBack;

OnPCKilledEvent:
  goto L_Death;

OnPCDieEvent:
  goto L_Death;

OnResave:
  if(Duel_LMS != 1) end;
  savepoint "009-7.gat", 39, 37;
  return;

L_NormalExit:
  warp "009-3.gat", 162, 82;
  gmcommand "@alive";
  return;
}
009-6.gat,36,48,0|script|#GoBack2#Duels|127,0,1,
{
  callfunc "fightclub_GoBack"; end;
}
009-5.gat,53,74,0|script|#GoBack3#Duels|127,3,1,
{
  callfunc "fightclub_GoBack"; end;
}


function|script|fightclub_GoBack2|,
{
  if(Duel_PVP == 1) goto L_GoBack;
  return;

L_GoBack:
  set Duel_PVP, 0;
  warp "009-7.gat", 39, 37;
  gmcommand "@alive";
  message strcharinfo(0), "Thank you for participating in the PVP cave!";
  return;

L_Clean:
  set Duel_PVP, 0;
  return;

L_Death:
  if(Duel_PVP != 1) end;
  if((getmap() != "001-2") && (getmap() != "001-3")) goto L_Clean;
  goto L_GoBack;

OnPCKilledEvent:
  goto L_Death;

OnPCDieEvent:
  goto L_Death;
}
001-2.gat,130,22,0|script|#GoBack4#Duels|127,1,1,
{
  callfunc "fightclub_GoBack2"; end;
}
001-3.gat,73,28,0|script|#GoBack#Duels|127,0,1,
{
  callfunc "fightclub_GoBack2"; end;
}