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
|
// TMW2 Scripts.
//
// TMW-BR Original Authors:
// Programmer: Adson Renato
// Texts: Arkanjo
// Review: Jesusalva
//
// Authors:
// Jesusalva
// Description:
// Stowaway hidden in a ship's hole. Contrabandist. Trade potions, dyes,
// food, water, and money for a hat.
002-1,45,26,0 script Alige NPC_ALIGE,{
.@q=getq(ShipQuests_Alige);
mesn;
mesq lg("Hey, dude! The guards are after me. I need your help, and I can reward you.");
next;
mesn strcharinfo(0);
menu
l("Guaaaards! Sailors! Help! We have a stowaway!"), L_Revolt,
l("Not right now, I'm busy."), L_Close,
l("Did you said reward?!"), L_GoGo;
L_Revolt:
message strcharinfo(0), l("Guaaaards! Sailors! Help! We have a stowaway!");
mesn;
mesq l("No, please don't! I have 3 kids to feed. They are looking for me for contraband. Please, let me go!");
close;
L_Close:
close;
L_GoGo:
mesn;
mesq l("But... I need to solve a problem first. So please come back later.");
close;
OnInit:
.sex = G_MALE;
.distance = 2;
// Preventive check against faulty update. Must be removed afterwards.
// UPDATE `quest` SET `count1` = '0' WHERE `quest`.`quest_id` = 2;
.@nb = query_sql("select `char_id` from `quest` WHERE (`count1`>=1 and `quest_id`=2) LIMIT 2", .@name$);
if (getarraysize(.@name$) > 0) {
debugmes "FATAL ERROR: Quest log not updated.";
debugmes "disabling Alige to prevent weirder bugs.";
debugmes "UPDATE `quest` SET `count1` = '0' WHERE `quest`.`quest_id` = 2";
disablenpc .name$;
}
end;
OnTouch:
if (getareausers() <= 1)
setnpcdir "Alige", 2; // 6
close;
OnUnTouch:
if (getareausers() == 0)
setnpcdir "Alige", 4; // 8
close;
}
|