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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
// TMW2 scripts.
// Authors:
// Jesusalva
// Description:
// Main Quest
003-0,49,35,0 script #MQ25Trigger NPC_HIDDEN,3,0,{
end;
OnTouch:
.@m$=getmap();
.@n$=instance_npcname(.name$);
if (is_night())
doevent instance_npcname(.name$)+"::OnBegin";
else
addtimer 1000, instance_npcname(.name$)+"::OnCheck";
end;
// Checks if you are in designated ambush zone. If not, keep hidden
OnCheck:
.@m$=getmap();
.@n$=instance_npcname(.name$);
if (!isin(.@m$, 44, 24, 54, 34))
end;
// goto OnBegin;
// Begin
OnBegin:
.@m$=getmap();
.@n$=instance_npcname(.name$);
.PLAYER=getcharid(3);
// Is assassin ambushing you or professor?
if (is_night()) {
.@x=any(46, 52);
.@y=34;
} else {
getmapxy(.@m$, .@x, .@y, 0);
.@y-=3;
if (.@y < 34)
.@y=34;
}
setcells .@m$, 47, 35, 51, 35, 3, "MQ2Wall"+getcharid(0);
if (isin(.@m$, 44, 24, 54, 34)) {
warp .@m$, 49, 33;
atcommand("@refresh");
}
.ASSASSIN=monster(.@m$, .@x, .@y, l("Assassin"), Assassin, 1, .@n$+"::OnAssassinDefeat");
unittalk(.ASSASSIN, l("Die now!!"));
// Nerf ATK, boost HP
/*
Hp: 4211
Attack: [198, 214]
*/
setunitdata(.@REF, UDT_MAXHP, 4750);
setunitdata(.@REF, UDT_HP, 4750);
setunitdata(.@REF, UDT_ATKMIN, 150);
setunitdata(.@REF, UDT_ATKMAX, 180);
// TODO: unitwalk
/*
// TODO: Energy Balls. Should they spawn at (21,31) and (69,31)?
// At this time they are utterly deadly. You could use a skill to
// disable them... Perhaps... A grenade?
dispbottom col(l("SCRIPT ERROR (%s/%s)", .@m$, .@n$), 1);
dispbottom l("An error happened: unitwalk failed");
*/
// TODO: Assassinate
initnpctimer;
end;
OnTimer15000:
.@n$=instance_npcname(.name$);
unittalk(.ASSASSIN, ("Heh... He gave me a ball, but..."));
end;
OnTimer20000:
.@n$=instance_npcname(.name$);
unittalk(.ASSASSIN, ("I can do this alone!"));
end;
OnTimer60000:
.@n$=instance_npcname(.name$);
unittalk(.ASSASSIN, ("Tsc...! I'll need reinforcements!"));
end;
OnTimer65000:
.@n$=instance_npcname(.name$);
unittalk(.ASSASSIN, ("How was the summoning again...?!"));
end;
OnTimer75000:
.@n$=instance_npcname(.name$);
unittalk(.ASSASSIN, ("Oh, that's right!"));
end;
OnTimer82000:
.@n$=instance_npcname(.name$);
unittalk(.ASSASSIN, ("ENEEEEEEEEERGY BALLLLLLL!"));
getmapxy(.@m$, .@x, .@y, UNITTYPE_MOB, .ASSASSIN);
.@REF=monster(.@m$, .@x, .@y, "Energy Ball", EnergyBall, 1);
// Nerf the monster, be careful, it has a powerful skill!
setunitdata(.@REF, UDT_AGI, 1);
setunitdata(.@REF, UDT_LUK, 1);
setunitdata(.@REF, UDT_DEF, 10);
setunitdata(.@REF, UDT_MDEF, 20);
setunitdata(.@REF, UDT_MAXHP, 1000);
setunitdata(.@REF, UDT_HP, 1000);
end;
OnAssassinDefeat:
stopnpctimer;
.@m$=getmap();
.@n$=instance_npcname(.name$);
delcells "MQ2Wall"+getcharid(0);
LUA_ASKED_TO_SAVE_PROFESSOR=false;
getexp 16, 5; // Extra bonus :>
if (is_night()) {
unittalk(getnpcid(instance_npcname(.name$)), l("Thanks for the help, I guess...?"));
} else {
dispbottom l("A mission well done. I should report to lua now.");
}
// Extra extra EXTRA bonus
CsysNpcCraft(SmallKnife, IOPT_SPLASHDAMAGE, 1, 0,0, 0,0, VAR_MAXHPPERCENT, -5);
addtimer 100, instance_npcname(.name$)+"::OnAbort";
specialeffect(FX_FANFARE, SELF, getcharid(3));
end;
OnAbort:
stopnpctimer;
end;
OnInit:
disablenpc .name$;
end;
OnInstanceInit:
if (is_night()) {
.@n$=instance_npcname("Professor#003-0");
enablenpc .@n$;
}
.ASSASSIN=0;
.PLAYER=0;
end;
}
003-0,49,24,4 script Professor#003-0 NPC_PLAYER,{
npctalkonce l("I wonder if it'll take too long for the ship to arrive...");
end;
OnTouchNPC:
npctalk l("An error happened: professor_was_assasinated() error");
npctalk ("SCRIPT ERROR (OnTouch Game Over)");
end;
OnInit:
.@ini=true;
OnInstanceInit:
if (.@ini)
.@npcId = getnpcid(.name$);
else
.@npcId = getnpcid(instance_npcname(.name$));
setunitdata(.@npcId, UDT_HEADTOP, GraduationCap);
setunitdata(.@npcId, UDT_HEADMIDDLE, GraduationRobe); // TODO: Bathrobe
setunitdata(.@npcId, UDT_HEADBOTTOM, Slippers); // Hey hey!
setunitdata(.@npcId, UDT_WEAPON, CottonGloves);
setunitdata(.@npcId, UDT_HAIRSTYLE, 2);
setunitdata(.@npcId, UDT_HAIRCOLOR, 4);
.sex=G_MALE;
.distance=5;
disablenpc .name$;
end;
}
|