An_Executioner.pl - Quest File
xxxxxxxxxx
1
#modified by greenbean 03/23/2010
2
3
#my $wave = 0;
4
my $rspeed = 1.1;
5
my $dest = 0;
6
7
sub EVENT_SPAWN {
8
quest::settimer("begin_delay", 3);
9
}
10
11
sub EVENT_SIGNAL {
12
if ($signal == 0) {
13
#Depop & Respawn
14
#Stop the timers
15
quest::stoptimer("begin_delay");
16
quest::stoptimer("move_check");
17
quest::stoptimer("talk_prisoner");
18
quest::stoptimer("sig_prisoner");
19
quest::stoptimer("do_execution");
20
#Spawn new executioner
21
quest::spawn2(201439,0,0,232,-1048,74,360); # NPC: An_Executioner
22
#Depop this executioner
23
quest::depop();
24
}
25
26
elsif ($signal == 1) {
27
#wave 1
28
$rspeed = 1.1; # prisoner dies in 34s
29
}
30
elsif ($signal == 2) {
31
#wave 2
32
$rspeed = 1.3; # prisoner dies in 33s
33
}
34
elsif ($signal == 3) {
35
#wave 3
36
$rspeed = 1.5; # prisoner dies in 32s
37
}
38
elsif ($signal == 4) {
39
#wave 4
40
$rspeed = 1.6; # prisoner dies in 30s
41
}
42
elsif ($signal == 5) {
43
#Depop no respawn
44
quest::stoptimer("begin_delay");
45
quest::stoptimer("move_check");
46
quest::stoptimer("talk_prisoner");
47
quest::stoptimer("sig_prisoner");
48
quest::stoptimer("do_execution");
49
quest::depop();
50
}
51
}
52
53
sub EVENT_TIMER {
54
if ($timer eq "begin_delay") {
55
quest::stoptimer("begin_delay");
56
quest::modifynpcstat("runspeed", $rspeed);
57
quest::moveto(196, -1052, 73.1, -2, 1);
58
$dest = 1;
59
quest::settimer("move_check",1);
60
}
61
elsif ($timer eq "move_check") {
62
quest::stoptimer("move_check");
63
my $x = $npc->GetX();
64
my $y = $npc->GetY();
65
66
if ($dest == 1) {
67
$dist = $npc->CalculateDistance(196, -1052, $npc->GetZ());
68
if ($dist < 1.5) {
69
quest::moveto(196, -1156, 80.1, -2, 1);
70
$dest = 2;
71
}
72
quest::settimer("move_check", 1);
73
}
74
elsif ($dest == 2) {
75
$dist = $npc->CalculateDistance(196, -1156, $npc->GetZ());
76
if ($dist < 1.5) {
77
quest::moveto(173, -1156, 80.1, -2, 1);
78
$dest = 3;
79
}
80
quest::settimer("move_check", 1);
81
}
82
elsif ($dest == 3) {
83
$dist = $npc->CalculateDistance(173, -1156, $npc->GetZ());
84
if ($dist < 1.5) {
85
quest::settimer("talk_prisoner", 2);
86
$dest = 0;
87
}
88
else {
89
quest::settimer("move_check", 1);
90
}
91
}
92
}
93
elsif ($timer eq "talk_prisoner") {
94
quest::stoptimer("talk_prisoner");
95
quest::emote("intones, 'Do you have any final words before your sentence is carried out?'");
96
quest::settimer("sig_prisoner", 3);
97
}
98
elsif ($timer eq "sig_prisoner") {
99
quest::stoptimer("sig_prisoner");
100
#prisoner emote
101
quest::signalwith(201424,1,0); # NPC: a_sentenced_prisoner
102
quest::settimer("do_execution", 13);
103
}
104
elsif ($timer eq "do_execution") {
105
quest::stoptimer("do_execution");
106
quest::say("Very well.");
107
#Signal prisoner death. (depop)
108
quest::signalwith(201424,0,5); # NPC: a_sentenced_prisoner
109
#Executed - Let controller know this was a fail
110
quest::signalwith(201425, 3, 5); # NPC: #Event_Execution_Control
111
}
112
}
113
114
Quest Source: 28 May 2022