View difference between Paste ID: MATpZm7r and yeP7uC7W
SHOW: | | - or go back to the newest paste.
1
local SAY_WILLIX_START   = "Woo hoo! Finally getting out of here. It's going to be rough though. Keep your eyes peeled for trouble."
2
local SAY_WILLIX_1       = "Up there is where Charlga Razorflank resides. Blasted old crone."
3
local SAY_WILLIX_2       = "There's blueleaf tuber in this trench! It's like gold waiting to be mined I tell you!"
4
local SAY_WILLIX_3       = "There could be danger around every corner here."
5
local SAY_WILLIX_4       = "I don't see how these foul animals live in this place... sheesh it smells!"
6
local SAY_WILLIX_5       = "I think I see a way for us to get out of this big twisted mess of a bramble."
7
local SAY_WILLIX_6       = "Glad to be out of that wretched trench. Not much nicer up here though!"
8
local SAY_WILLIX_7       = "Finally! I'll be glad to get out of this place."
9
local SAY_WILLIX_END     = "I think I'll rest a moment and catch my breath before heading back to Ratchet. Thanks for all the help!"
10
 
11
local RAGING_AGAMAR    = 4514
12
local NPC_WILLIX       = 4508
13
 
14
 
15
local T = {}
16-
local currentWP = 0
16+
17
{
18
{1, 2194.38, 1791.65, 65.48},
19-
{0, 2194.38, 1791.65, 65.48},
19+
{2, 2188.56, 1805.87, 64.45},
20-
{1, 2188.56, 1805.87, 64.45},
20+
{3, 2186.2, 1836.28, 59.859},
21-
{2, 2186.2, 1836.28, 59.859},
21+
{4, 2163.27, 1851.67, 56.73},
22-
{3, 2163.27, 1851.67, 56.73},
22+
{5, 2140.22, 1845.02, 48.32},
23-
{4, 2140.22, 1845.02, 48.32},
23+
{6, 2131.5, 1804.29, 46.85},
24-
{5, 2131.5, 1804.29, 46.85},
24+
{7, 2096.18, 1789.03, 51.13},
25-
{6, 2096.18, 1789.03, 51.13},
25+
{8, 2074.46, 1780.09, 55.64},
26-
{7, 2074.46, 1780.09, 55.64},
26+
{9, 2055.12, 1768.67, 58.46},
27-
{8, 2055.12, 1768.67, 58.46},
27+
{10, 2037.83, 1748.62, 60.27},
28-
{9, 2037.83, 1748.62, 60.27},
28+
{11, 2037.51, 1728.94, 60.85},
29-
{10, 2037.51, 1728.94, 60.85},
29+
{12, 2044.7, 1711.71, 59.71},
30-
{11, 2044.7, 1711.71, 59.71},
30+
{13, 2067.66, 1701.84, 57.77},
31-
{12, 2067.66, 1701.84, 57.77},
31+
{14, 2078.91, 1704.54, 56.77},
32-
{13, 2078.91, 1704.54, 56.77},
32+
{15, 2097.65, 1715.24, 54.74},
33-
{14, 2097.65, 1715.24, 54.74},
33+
{16, 2106.44, 1720.98, 54.41},
34-
{15, 2106.44, 1720.98, 54.41},
34+
{17, 2123.96, 1732.56, 52.27},
35-
{16, 2123.96, 1732.56, 52.27},
35+
{18, 2153.82, 1728.73, 51.92},
36-
{17, 2153.82, 1728.73, 51.92},
36+
{19, 2163.49, 1706.33, 54.42},
37-
{18, 2163.49, 1706.33, 54.42},
37+
{20, 2158.75, 1695.98, 55.7},
38-
{19, 2158.75, 1695.98, 55.7},
38+
{21, 2142.6, 1680.72, 58.24},
39-
{20, 2142.6, 1680.72, 58.24},
39+
{22, 2118.31, 1671.54, 59.21},
40-
{21, 2118.31, 1671.54, 59.21},
40+
{23, 2086.02, 1672.04, 61.24},
41-
{22, 2086.02, 1672.04, 61.24},
41+
{24, 2068.81, 1658.93, 61.24},
42-
{23, 2068.81, 1658.93, 61.24},
42+
{25, 2062.82, 1633.31, 64.35},
43-
{24, 2062.82, 1633.31, 64.35},
43+
{26, 2060.92, 1600.11, 62.41},
44-
{25, 2060.92, 1600.11, 62.41},
44+
{27, 2063.05, 1589.16, 63.26},
45-
{26, 2063.05, 1589.16, 63.26},
45+
{28, 2063.67, 1577.22, 65.89},
46-
{27, 2063.67, 1577.22, 65.89},
46+
{29, 2057.94, 1560.68, 68.4},
47-
{28, 2057.94, 1560.68, 68.4},
47+
{30, 2052.56, 1548.05, 73.35},
48-
{29, 2052.56, 1548.05, 73.35},
48+
{31, 2045.22, 1543.4, 76.65},
49-
{30, 2045.22, 1543.4, 76.65},
49+
{32, 2034.35, 1543.01, 79.7},
50-
{31, 2034.35, 1543.01, 79.7},
50+
{33, 2029.95, 1542.94, 80.79},
51-
{32, 2029.95, 1542.94, 80.79},
51+
{34, 2021.34, 1538.67, 80.8},
52-
{33, 2021.34, 1538.67, 80.8},
52+
{35, 2012.45, 1549.48, 79.93},
53-
{34, 2012.45, 1549.48, 79.93},
53+
{36, 2008.05, 1554.92, 80.44},
54-
{35, 2008.05, 1554.92, 80.44},
54+
{37, 2006.54, 1562.72, 81.11},
55-
{36, 2006.54, 1562.72, 81.11},
55+
{38, 2003.8, 1576.43, 81.57},
56-
{37, 2003.8, 1576.43, 81.57},
56+
{39, 2000.57, 1590.06, 80.62},
57-
{38, 2000.57, 1590.06, 80.62},
57+
{40, 1998.96, 1596.87, 80.22},
58-
{39, 1998.96, 1596.87, 80.22},
58+
{41, 1991.19, 1600.82, 79.39},
59-
{40, 1991.19, 1600.82, 79.39},
59+
{42, 1980.71, 1601.44, 79.77},
60-
{41, 1980.71, 1601.44, 79.77},
60+
{43, 1967.22, 1600.18, 80.62},
61-
{42, 1967.22, 1600.18, 80.62},
61+
{44, 1956.43, 1596.97, 81.75},
62-
{43, 1956.43, 1596.97, 81.75},
62+
{45, 1954.87, 1592.02, 82.18},
63-
{44, 1954.87, 1592.02, 82.18},
63+
{46, 1948.35, 1571.35, 80.96},
64-
{45, 1948.35, 1571.35, 80.96},
64+
{47, 1947.02, 1566.42, 81.8}
65-
{46, 1947.02, 1566.42, 81.8}
65+
66
 
67
-- EVENTS:
68
function WILLIX_OnQuestAccept(event, player, creature, quest)
69
        creature:SetWalk(0)
70
        creature:SetSpeed(3, 1)
71
        creature:SetFaction(10) -- 69
72
        creature:SendUnitSay(SAY_WILLIX_START, 0)
73
        creature:MoveTo(1, 2188.56, 1805.87, 64.45)    
74-
        creature:MoveTo(0, 2188.56, 1805.87, 64.45)    
74+
75
end    
76
 
77
function WILLIX_OnReachWP(event, creature, pointType, waypointId)
78
        if (pointType ~= 8) then return end -- Only act if point is reached with MoveTo
79-
T[creature:GetGUIDLow()] = currentWP+1;
79+
        T[creature:GetGUIDLow()] = waypointId
80-
        if (waypointId == 0) then
80+
        if (waypointId == 1) then
81
            creature:RegisterEvent(WILLIX_OnMove, 0, 1)
82-
        elseif (waypointId == 2) then
82+
        elseif (waypointId == 3) then
83
                creature:Emote(1)
84
                creature:SendUnitSay(SAY_WILLIX_1, 0) -- Point Emote
85
            creature:RegisterEvent(WILLIX_OnMove, 5000, 1)     
86-
        elseif (waypointId == 6) then
86+
        elseif (waypointId == 7) then
87
                creature:Emote(1)
88
                creature:SendUnitSay(SAY_WILLIX_2, 0)
89
            creature:RegisterEvent(WILLIX_OnMove, 0, 1)
90-
        elseif (waypointId == 8) then
90+
        elseif (waypointId == 9) then
91
                creature:Emote(1)
92
                creature:SendUnitSay(SAY_WILLIX_3, 0)
93
            creature:RegisterEvent(WILLIX_OnMove, 0, 1)
94-
        elseif (waypointId == 14) then
94+
95
                creature:Emote(1)
96
                creature:SendUnitSay(SAY_WILLIX_4, 0)
97
            creature:RegisterEvent(WILLIX_OnMove, 0, 1)
98
        elseif (waypointId == 16) then
99
                local AGAMAR1 = creature:SpawnCreature(RAGING_AGAMAR, 2166.330, 1718.457, 53.368, 0.647, 3, 25000)
100
                local AGAMAR2 = creature:SpawnCreature(RAGING_AGAMAR, 2157.686, 1717.527, 52.591, 1.040, 3, 25000)
101
                        AGAMAR1:AttackStart(creature)
102
                        AGAMAR2:AttackStart(creature)  
103
                creature:RegisterEvent(WILLIX_OnMove, 0, 1)                            
104-
        elseif (waypointId == 25) then
104+
        elseif (waypointId == 26) then
105
                creature:Emote(1)
106
                creature:SendUnitSay(SAY_WILLIX_5, 0)
107
            creature:RegisterEvent(WILLIX_OnMove, 3000, 1)             
108-
        elseif (waypointId == 33) then
108+
        elseif (waypointId == 34) then
109
                creature:Emote(1)
110
                creature:SendUnitSay(SAY_WILLIX_6, 0)
111
            creature:RegisterEvent(WILLIX_OnMove, 0, 1)
112-
        elseif (waypointId == 44) then
112+
        elseif (waypointId == 45) then
113
                creature:Emote(1)
114
                creature:SendUnitSay(SAY_WILLIX_7, 0)
115
                        local AGAMAR3 = creature:SpawnCreature(RAGING_AGAMAR, 1964.465, 1602.200, 81.008, 3.818, 3, 25000)
116
                        local AGAMAR4 = crweature:SpawnCreature(RAGING_AGAMAR, 1962.268, 1597.519, 81.307, 3.995, 3, 25000)
117
                                AGAMAR3:AttackStart(creature)
118
                                AGAMAR4:AttackStart(creature)  
119
            creature:RegisterEvent(WILLIX_OnMove, 3000, 1)
120-
        elseif (waypointId == 45) thend
120+
        elseif (waypointId == 46) then
121
                creature:SendUnitSay(SAY_WILLIX_END, 0)
122
        else
123
            creature:RegisterEvent(WILLIX_OnMove, 0, 1)
124
        end
125
end
126
127
-- MECHANICAL:
128
function WILLIX_OnMove(event, delay, pCall, creature)
129
        creature:SendUnitSay(T[creature:GetGUIDLow()], 0) -- DEBUG ONLY, Prints " 1 "
130
        local wp = T[creature:GetGUIDLow()]
131-
    for k,_ in ipairs(WILLIX_Waypoints) do
131+
        if (not wp or not WILLIX_Waypoints[wp]) then
132-
        if (WILLIX_Waypoints[k][1] == T[creature:GetGUIDLow()]) then
132+
            return
133-
            creature:MoveTo(WILLIX_Waypoints[k][1], WILLIX_Waypoints[k][2],WILLIX_Waypoints[k][3], WILLIX_Waypoints[k][4])
133+
134
        creature:MoveTo(wp+1, WILLIX_Waypoints[wp][2],WILLIX_Waypoints[wp][3], WILLIX_Waypoints[wp][4])
135-
    end
135+
136
 
137
function WILLIX_OnEmote(event, creature, player, emoteid)
138
                        creature:SendUnitYell("Test",0)
139
        local AGAMAR1 = creature:SpawnCreature(RAGING_AGAMAR, 2188.364, 1842.793, 59.498, 4.762, 3, 25000)
140
                                AGAMAR1:AttackStart(creature)
141
end    
142
 
143
-- REGISTRY:
144
RegisterCreatureEvent(NPC_WILLIX, 6, WILLIX_OnReachWP)
145
RegisterCreatureEvent(NPC_WILLIX, 8, WILLIX_OnEmote)
146
RegisterCreatureEvent(NPC_WILLIX, 31, WILLIX_OnQuestAccept)