TrinityCore
hyjalAI.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/* ScriptData
19SDName: HyjalAI
20SD%Complete: 90
21SDComment:
22SDCategory: Caverns of Time, Mount Hyjal
23EndScriptData */
24
25#include "CellImpl.h"
26#include "GridNotifiersImpl.h"
27#include "hyjal_trash.h"
28#include "hyjalAI.h"
29#include "InstanceScript.h"
30#include "Log.h"
31#include "MotionMaster.h"
32#include "ObjectAccessor.h"
33#include "TemporarySummon.h"
34
36{
40};
41
43{
45};
46
47// Locations for summoning gargoyls and frost wyrms in special cases
49{
50 {5497.08f, -2493.23f, 1535.72f}, //spawn point for the gargoyles near the horde gate
51 {5624.53f, -2548.12f, 1551.54f}, //spawn point for the frost wyrm near the horde gate
52 {5604.41f, -2811.98f, 1547.77f} //spawn point for the gargoyles and wyrms near the horde tower
53};
54
55// Locations for summoning waves in Alliance base
56float AllianceBase[4][3]=
57{
58 {4928.48f, -1526.38f, 1326.83f},
59 {4923.54f, -1514.29f, 1327.98f},
60 {4928.41f, -1510.35f, 1327.99f},
61 {4938.35f, -1521.00f, 1326.69f}
62};
63
64float JainaDummySpawn[2][4]=
65{
66 {5497.01f, -2719.03f, 1483.08f, 2.90426f},
67 {5484.98f, -2721.69f, 1483.39f, 6.00656f}
68};
69
70// Locations for summoning waves in Horde base
71float HordeBase[4][3]=
72{
73 {5458.01f, -2340.27f, 1459.60f},
74 {5466.01f, -2334.69f, 1460.06f},
75 {5468.45f, -2355.13f, 1459.99f},
76 {5479.06f, -2344.16f, 1461.74f}
77};
78
79// Lady Jaina's waypoints when retreathing
80float JainaWPs[2][3]=
81{
82 {5078.56f, -1789.79f, 1320.73f}, //next to the small stairs
83 {5037.38f, -1778.39f, 1322.61f}, //center of alliance base
84};
85
86float InfernalPos[8][3]=//spawn points for the infernals in the horde base
87{
88 {5453.59f, -2764.52f, 1493.50f},
89 {5478.4f, -2781.77f, 1497.52f},
90 {5506.09f, -2780.53f, 1496.32f},
91 {5532.1f, -2763.42f, 1492.37f},
92 {5544.16f, -2733.99f, 1487.14f},
93 {5536.19f, -2708.18f, 1480.01f},
94 {5510.16f, -2691.75f, 1479.66f},
95 {5482.39f, -2689.19f, 1481.09f}
96};
97
98float InfernalSPWP[26][4]=//spawn points for the infernals in the horde base used in the cleaning wave
99{
100 {5490.96f, -2718.72f, 1482.96f, 0.49773f},
101 {5449.51f, -2723.32f, 1485.69f, 2.69685f},
102 {5520.83f, -2624.68f, 1483.82f, 1.20459f},
103 {5558.28f, -2629.26f, 1485.76f, 0.37992f},
104 {5567.97f, -2758.69f, 1494.10f, 5.04125f},
105 {5384.90f, -2793.47f, 1503.90f, 5.55412f},
106 {5495.33f, -2814.06f, 1501.56f, 1.12055f},
107 {5472.63f, -2929.39f, 1538.31f, 1.95777f},
108 {5334.72f, -2952.29f, 1534.34f, 0.50869f},
109 {5398.36f, -2872.46f, 1512.38f, 0.76787f},
110 {5514.39f, -2768.63f, 1492.30f, 1.55721f},
111 {5598.91f, -2703.75f, 1495.64f, 2.56644f},
112 {5467.80f, -2655.93f, 1482.27f, 0.85819f},
113 {5399.83f, -2985.24f, 1545.04f, 5.92559f},
114 {5232.13f, -2967.05f, 1553.09f, 5.41351f},
115 {5272.02f, -3082.52f, 1567.09f, 3.40681f},
116 {5343.26f, -3120.71f, 1582.92f, 3.16727f},
117 {5371.26f, -3175.24f, 1587.41f, 6.10466f},
118 {5434.67f, -3177.91f, 1579.25f, 2.77850f},
119 {5237.39f, -3149.25f, 1593.59f, 0.83855f},
120 {5202.15f, -3016.64f, 1566.28f, 3.31256f},
121 {5302.54f, -2914.37f, 1528.53f, 3.37146f},
122 {5439.04f, -2834.81f, 1508.80f, 2.14231f},
123 {5421.33f, -2771.04f, 1494.28f, 6.06223f},
124 {5549.76f, -2692.93f, 1482.68f, 2.19414f},
125 {5459.78f, -2755.71f, 1490.68f, 1.05139f}
126};
127
128float VeinPos[14][8]=//spawn points of the ancient gem veins
129{
130 {5184.84f, -1982.59f, 1382.66f, 2.58079f, 0, 0, 0.960944f, 0.276742f}, //alliance
131 {5107.66f, -2071.16f, 1368.37f, 2.65148f, 0, 0, 0.970124f, 0.242611f}, //alliance
132 {5040.53f, -2227.65f, 1403.17f, 3.35049f, 0, 0, 0.99455f, -0.104257f}, //alliance
133 {5187.59f, -2453.12f, 1455.51f, 5.87943f, 0, 0, 0.20051f, -0.979692f}, //alliance
134 {5429.43f, -2340.65f, 1465.38f, 4.7681f, 0, 0, 0.687138f, -0.726527f}, //alliance
135 {5463.99f, -2315.95f, 1470.29f, 1.52045f, 0, 0, 0.689084f, 0.724682f}, //alliance
136 {5624.65f, -2495.09f, 1510.11f, 0.0124869f, 0, 0, 0.00624342f, 0.999981f}, //alliance
137 {5285.41f, -3348.32f, 1663.01f, 1.57152f, 0, 0, 0.707362f, 0.706852f}, //horde
138 {5417.69f, -3372.52f, 1656.31f, 0.361993f, 0, 0, 0.18001f, 0.983665f}, //horde
139 {5315.34f, -3238.32f, 1622.88f, 3.03627f, 0, 0, 0.998614f, 0.0526347f}, //horde
140 {5303.4f, -3096.44f, 1596.41f, 1.72073f, 0, 0, 0.758081f, 0.65216f}, //horde
141 {5265.13f, -3177.27f, 1616.22f, 0.813604f, 0, 0, 0.395674f, 0.918391f}, //horde
142 {5374.3f, -3420.59f, 1653.43f, 1.45762f, 0, 0, 0.665981f, 0.745969f}, //horde
143 {5441.54f, -3321.59f, 1651.55f, 0.258306f, 0, 0, 0.128794f, 0.991671f} //horde
144};
145
146float AllianceOverrunGargPos[5][4]=//gargoyle spawn points in the alliance overrun
147{
148 {5279.94f, -2049.68f, 1311.38f, 0}, //garg1
149 {5289.15f, -2219.06f, 1291.12f, 0}, //garg2
150 {5202.07f, -2136.10f, 1305.07f, 2.8f}, //garg3
151 {5071.52f, -2425.63f, 1454.48f, 5.54f}, //garg4
152 {5120.65f, -2467.92f, 1463.93f, 2.54f}//garg5
153};
154
155float AllianceFirePos[92][8]=//spawn points for the fire visuals (GO) in the alliance base
156{
157 {5039.9f, -1796.84f, 1323.88f, 2.59222f, 0, 0, 0.962511f, 0.271243f},
158 {5087.2f, -1795.2f, 1320.68f, 1.03946f, 0, 0, 0.496644f, 0.867954f},
159 {5112.68f, -1806.66f, 1359.93f, 1.37799f, 0, 0, 0.63576f, 0.771887f},
160 {5095.61f, -1793.27f, 1359.78f, 0.580806f, 0, 0, 0.286338f, 0.958129f},
161 {5090.43f, -1784.45f, 1360.44f, 0.796784f, 0, 0, 0.387937f, 0.921686f},
162 {5139.25f, -1783.11f, 1359.39f, 3.30849f, 0, 0, 0.99652f, -0.0833509f},
163 {5112.16f, -1763.72f, 1361.35f, 5.10312f, 0, 0, 0.556388f, -0.830922f},
164 {4981.18f, -1793.98f, 1335.7f, 3.23072f, 0, 0, 0.999007f, -0.0445498f},
165 {4996.57f, -1766.75f, 1341.62f, 3.5331f, 0, 0, 0.980902f, -0.194505f},
166 {4983.74f, -1769.25f, 1345.75f, 3.79228f, 0, 0, 0.947541f, -0.319635f},
167 {4996.01f, -1774.43f, 1330.71f, 3.07364f, 0, 0, 0.999423f, 0.0339693f},
168 {5094.2f, -1726.13f, 1330.55f, 1.56175f, 0, 0, 0.703901f, 0.710298f},
169 {5079.82f, -1721.24f, 1336.26f, 1.18868f, 0, 0, 0.559964f, 0.828517f},
170 {5077.68f, -1717.15f, 1327.78f, 0.0145145f, 0, 0, 0.00725717f, 0.999974f},
171 {5122.27f, -1738.22f, 1341.67f, 0.835256f, 0, 0, 0.405593f, 0.914054f},
172 {5131.88f, -1741.15f, 1335.25f, 2.15472f, 0, 0, 0.880712f, 0.473653f},
173 {5196.93f, -1772.99f, 1345.2f, 0.128397f, 0, 0, 0.0641544f, 0.99794f},
174 {5225.33f, -1756.06f, 1344.17f, 3.04223f, 0, 0, 0.998766f, 0.0496599f},
175 {5224.84f, -1767.05f, 1360.06f, 3.19538f, 0, 0, 0.999638f, -0.0268922f},
176 {5202.05f, -1763.47f, 1361.68f, 2.59455f, 0, 0, 0.962826f, 0.270122f},
177 {5194.74f, -1766.66f, 1356.94f, 0.0734191f, 0, 0, 0.0367013f, 0.999326f},
178 {5159.67f, -1832.97f, 1344.5f, 5.17457f, 0, 0, 0.526356f, -0.850264f},
179 {5096.17f, -1858.73f, 1332.46f, 5.30021f, 0, 0, 0.471939f, -0.881631f},
180 {5110.7f, -1856.59f, 1342.84f, 5.97564f, 0, 0, 0.153167f, -0.9882f},
181 {5109.76f, -1855.3f, 1332.38f, 4.89572f, 0, 0, 0.639411f, -0.768865f},
182 {5068.95f, -1837.37f, 1328.81f, 2.61569f, 0, 0, 0.965628f, 0.25993f},
183 {5064.4f, -1824.77f, 1329.02f, 2.16409f, 0, 0, 0.88292f, 0.469524f},
184 {5059.89f, -1848.79f, 1329.59f, 0.0709955f, 0, 0, 0.0354903f, 0.99937f},
185 {5014.37f, -1851.39f, 1322.56f, 4.66949f, 0, 0, 0.722111f, -0.691777f},
186 {5025.1f, -1848.27f, 1323.39f, 4.44565f, 0, 0, 0.794854f, -0.606801f},
187 {4942.63f, -1890.13f, 1326.59f, 3.28719f, 0, 0, 0.997351f, -0.0727343f},
188 {4937.95f, -1888.71f, 1352.41f, 3.41678f, 0, 0, 0.990549f, -0.13716f},
189 {4922.48f, -1881.92f, 1352.41f, 5.03077f, 0, 0, 0.586075f, -0.810257f},
190 {4915.35f, -1894.32f, 1351.24f, 6.22457f, 0, 0, 0.0293048f, -0.999571f},
191 {4922.71f, -1904.84f, 1352.56f, 1.37866f, 0, 0, 0.63602f, 0.771672f},
192 {4932.89f, -1905.49f, 1352.56f, 1.89702f, 0, 0, 0.812549f, 0.582893f},
193 {5011.83f, -1861.05f, 1345.86f, 4.43777f, 0, 0, 0.797239f, -0.603664f},
194 {5011.83f, -1861.05f, 1363.26f, 4.748f, 0, 0, 0.694406f, -0.719583f},
195 {5021.46f, -1858.35f, 1342.17f, 4.86188f, 0, 0, 0.652329f, -0.757936f},
196 {4995.02f, -1698.3f, 1370.38f, 6.15779f, 0, 0, 0.0626579f, -0.998035f},
197 {5119.85f, -1728.9f, 1336.04f, 5.87112f, 0, 0, 0.204579f, -0.97885f},
198 {5214.75f, -1751.02f, 1342.5f, 5.08965f, 0, 0, 0.561972f, -0.827156f},
199 {5075.04f, -1822.43f, 1328.87f, 3.99951f, 0, 0, 0.9094f, -0.415924f},
200 {5057.09f, -1823.32f, 1350.35f, 3.88169f, 0, 0, 0.93231f, -0.361659f},
201 {4984.6f, -1816.99f, 1329.21f, 3.05308f, 0, 0, 0.999021f, 0.0442417f},
202 {4983.35f, -1811.55f, 1356.82f, 3.33975f, 0, 0, 0.995096f, -0.098917f},
203 {4984.11f, -1825.73f, 1350.76f, 2.26375f, 0, 0, 0.905211f, 0.424962f},
204 {4968.47f, -1786.46f, 1354.09f, 3.07663f, 0, 0, 0.999473f, 0.0324733f},
205 {5061.82f, -1751.16f, 1339.07f, 5.94727f, 0, 0, 0.167171f, -0.985928f},
206 {5063.75f, -1763, 1351.91f, 0.759707f, 0, 0, 0.370784f, 0.928719f},
207 {5078.65f, -1708.26f, 1353.9f, 1.27022f, 0, 0, 0.593264f, 0.805008f},
208 {4983.19f, -1755.96f, 1331.13f, 4.28221f, 0, 0, 0.841733f, -0.539894f},
209 {4972.76f, -1755.3f, 1332.5f, 4.21938f, 0, 0, 0.858276f, -0.513188f},
210 {4961.65f, -1760.82f, 1351.69f, 3.56515f, 0, 0, 0.977659f, -0.210198f},
211 {5086.45f, -1779.83f, 1321.62f, 6.23157f, 0, 0, 0.0258051f, -0.999667f},
212 {5063.15f, -1756.74f, 1328.56f, 0.886926f, 0, 0, 0.42907f, 0.903271f},
213 {5042.45f, -1800.61f, 1323.88f, 2.50093f, 0, 0, 0.949131f, 0.31488f},
214 {5084.74f, -1725.35f, 1327.89f, 1.65034f, 0, 0, 0.734663f, 0.678432f},
215 {4993.25f, -1758.1f, 1331.07f, 3.49995f, 0, 0, 0.98399f, -0.178223f},
216 {5078.53f, -1867.85f, 1348.91f, 5.85612f, 0, 0, 0.211913f, -0.977288f},
217 {5080.74f, -1869.73f, 1333.18f, 6.18206f, 0, 0, 0.0505424f, -0.998722f},
218 {5089.55f, -1894.13f, 1356.08f, 1.52072f, 0, 0, 0.689181f, 0.724589f},
219 {5113.24f, -1899.49f, 1363.77f, 1.50108f, 0, 0, 0.682034f, 0.731321f},
220 {4984.18f, -1907.69f, 1325.62f, 3.82193f, 0, 0, 0.942698f, -0.333646f},
221 {5094.14f, -2432.08f, 1429.38f, 4.70083f, 0, 0, 0.711182f, -0.703007f},
222 {5329.89f, -2113.30f, 1281.06f, 5.60560f, 0, 0, 0.332347f, -0.943157f},
223 {5170.87f, -2148.13f, 1278.32f, 1.63540f, 0, 0, 0.729573f, 0.683903f },
224 {5132.94f, -1960.25f, 1367.8f, 3.69787f, 0, 0, 0.961568f, -0.274566f},
225 {5280.82f, -2351.55f, 1431.57f, 4.46913f, 0, 0, 0.787677f, -0.616088f},
226 {5176.78f, -2121.43f, 1295.27f, 3.24153f, 0, 0, 0.998752f, -0.04995f},
227 {5332.75f, -2101.41f, 1296.37f, 5.50350f, 0, 0, 0.380043f, -0.924969f},
228 {5265.70f, -2050.27f, 1287.57f, 0.50051f, 0, 0, 0.247655f, 0.968848f },
229 {5194.21f, -2129.89f, 1274.04f, 3.08053f, 0, 0, 0.999534f, 0.0305272f},
230 {5225.81f, -1985.50f, 1364.15f, 0.37247f, 0, 0, 0.185163f, 0.982708f },
231 {5339.46f, -2204.47f, 1280.45f, 0.99921f, 0, 0, 0.479081f, 0.877771f },
232 {5269.63f, -2020.57f, 1299.62f, 3.00201f, 0, 0, 0.997566f, 0.0697332f},
233 {5111.54f, -2445.70f, 1435.31f, 2.70983f, 0, 0, 0.976788f, 0.214207f },
234 {5111.24f, -1901.14f, 1355.33f, 1.61028f, 0, 0, 0.720929f, 0.693009f },
235 {5310.42f, -2207.82f, 1277.46f, 0.50441f, 0, 0, 0.249544f, 0.968363f },
236 {5150.81f, -2042.13f, 1394.3f, 2.21031f, 0, 0, 0.893534f, 0.448995f },
237 {5224.84f, -2376.61f, 1366.33f, 5.0621f, 0, 0, 0.573311f, -0.819338f},
238 {5105.41f, -2454.86f, 1446.16f, 4.64584f, 0, 0, 0.730239f, -0.683191f},
239 {5309.65f, -2188.28f, 1266.84f, 5.56631f, 0, 0, 0.350811f, -0.936446f},
240 {5281.46f, -2047.82f, 1287.67f, 2.44909f, 0, 0, 0.940652f, 0.339373f },
241 {5325.45f, -2189.41f, 1309.6f, 6.23783f, 0, 0, 0.0226771f, -0.999743f},
242 {5190.96f, -2142.54f, 1293.03f, 6.25668f, 0, 0, 0.0132544f, -0.999912f},
243 {5089.99f, -2467.49f, 1441.8f, 0.77381f, 0, 0, 0.377326f, 0.92608f },
244 {5195.08f, -2129.01f, 1285.36f, 3.55727f, 0, 0, 0.978480f, -0.206344f},
245 {5353.76f, -2116.28f, 1299.27f, 6.17894f, 0, 0, 0.0521006f, -0.998642f},
246 {5271.14f, -2037.38f, 1299.24f, 4.07879f, 0, 0, 0.892201f, -0.451638f},
247 {5332.5f , -2181.28f, 1279.95f, 4.6906f, 0, 0, 0.714768f, -0.699362f},
248 {5108.2f , -2429.84f, 1427.73f, 4.5194f, 0, 0, 0.771943f, -0.635691f}
249};
250
251float HordeFirePos[65][8]=//spawn points for the fire visuals (GO) in the horde base
252{
253 {5524.11f, -2612.73f, 1483.38f, 1.96198f, 0, 0, 0.831047f, 0.556202f},
254 {5514.42f, -2617.19f, 1505.77f, 1.82453f, 0, 0, 0.790892f, 0.611956f},
255 {5510.21f, -2624.77f, 1485.34f, 1.71065f, 0, 0, 0.754783f, 0.655974f},
256 {5570.72f, -2619.04f, 1487.62f, 0.728898f, 0, 0, 0.356435f, 0.93432f},
257 {5570.29f, -2639.37f, 1487.31f, 1.49308f, 0, 0, 0.679104f, 0.734042f},
258 {5583.56f, -2637.2f, 1503.78f, 1.46559f, 0, 0, 0.668951f, 0.743307f},
259 {5571.53f, -2626.81f, 1510.99f, 0.362107f, 0, 0, 0.180066f, 0.983654f},
260 {5545.97f, -2659.62f, 1489.64f, 5.07055f, 0, 0, 0.569845f, -0.821752f},
261 {5557.44f, -2675.91f, 1482.58f, 1.70118f, 0, 0, 0.751671f, 0.659539f},
262 {5594.98f, -2742.31f, 1495.51f, 4.5993f, 0, 0, 0.74594f, -0.666013f},
263 {5599.65f, -2755.6f, 1505.05f, 1.66896f, 0, 0, 0.740947f, 0.671564f},
264 {5565.95f, -2774.75f, 1499.48f, 6.22425f, 0, 0, 0.0294611f, -0.999566f},
265 {5567.1f, -2769.7f, 1511.17f, 5.99257f, 0, 0, 0.144799f, -0.989461f},
266 {5572.84f, -2774.16f, 1527.06f, 0.836428f, 0, 0, 0.406129f, 0.913816f},
267 {5538.32f, -2805.94f, 1498.87f, 4.30082f, 0, 0, 0.836674f, -0.547701f},
268 {5515.66f, -2801.74f, 1503.53f, 5.57316f, 0, 0, 0.347602f, -0.937642f},
269 {5516.76f, -2827.14f, 1501.15f, 0.35026f, 0, 0, 0.174236f, 0.984704f},
270 {5536.13f, -2813.51f, 1537.21f, 4.51681f, 0, 0, 0.772765f, -0.634692f},
271 {5525.05f, -2825.16f, 1538.53f, 0.489275f, 0, 0, 0.242205f, 0.970225f},
272 {5534.42f, -2815.45f, 1562.84f, 4.62834f, 0, 0, 0.736191f, -0.676774f},
273 {5519.64f, -2831.12f, 1526.46f, 0.611008f, 0, 0, 0.300774f, 0.953696f},
274 {5551.04f, -2827.55f, 1523.5f, 3.35206f, 0, 0, 0.994468f, -0.10504f},
275 {5469.22f, -2802.87f, 1503.5f, 4.99509f, 0, 0, 0.600436f, -0.799673f},
276 {5427.8f, -2737.26f, 1487.12f, 1.78673f, 0, 0, 0.779186f, 0.626793f},
277 {5454.1f, -2709.1f, 1485.92f, 3.03552f, 0, 0, 0.998594f, 0.0530137f},
278 {5436.3f, -2718.2f, 1506.02f, 2.7567f, 0, 0, 0.981539f, 0.191261f},
279 {5412.6f, -2740.55f, 1510.79f, 2.98446f, 0, 0, 0.996915f, 0.0784832f},
280 {5406.12f, -2752.48f, 1521.01f, 2.05769f, 0, 0, 0.856705f, 0.515807f},
281 {5445.24f, -2676.35f, 1521.89f, 2.91378f, 0, 0, 0.99352f, 0.113661f},
282 {5481.4f, -2665.08f, 1482.23f, 4.30001f, 0, 0, 0.836895f, -0.547363f},
283 {5443.51f, -2675.44f, 1487.12f, 2.90986f, 0, 0, 0.993295f, 0.115606f},
284 {5391.72f, -2647.3f, 1528.9f, 3.76987f, 0, 0, 0.951063f, -0.308997f},
285 {5421.09f, -2734.12f, 1521.01f, 2.70567f, 0, 0, 0.97634f, 0.216242f},
286 {5405.39f, -2710.33f, 1533.77f, 2.51324f, 0, 0, 0.951052f, 0.309032f},
287 {5423.96f, -2703.76f, 1516.34f, 2.79206f, 0, 0, 0.984767f, 0.173879f},
288 {5444.75f, -2735.23f, 1486.37f, 2.22657f, 0, 0, 0.897155f, 0.441715f},
289 {5570.98f, -2747.91f, 1495.7f, 5.14433f, 0, 0, 0.53915f, -0.84221f},
290 {5567.79f, -2673.9f, 1484.66f, 2.72529f, 0, 0, 0.978415f, 0.20665f},
291 {5600.71f, -2696.8f, 1500.42f, 0.443704f, 0, 0, 0.220036f, 0.975492f},
292 {5600.7f, -2693.04f, 1515.2f, 5.16003f, 0, 0, 0.532522f, -0.846416f},
293 {5627.56f, -2839.66f, 1510.53f, 5.41527f, 0, 0, 0.420463f, -0.907309f},
294 {5622.02f, -2868.71f, 1516.22f, 2.25482f, 0, 0, 0.903303f, 0.429002f},
295 {5586.61f, -2878.97f, 1510.34f, 4.55604f, 0, 0, 0.76017f, -0.649724f},
296 {5583.78f, -2843.71f, 1509.54f, 5.35715f, 0, 0, 0.44665f, -0.894709f},
297 {5580.95f, -2811.3f, 1513.3f, 3.57587f, 0, 0, 0.976518f, -0.215434f},
298 {5542.52f, -2869.31f, 1523.13f, 5.23304f, 0, 0, 0.501275f, -0.865288f},
299 {5557.35f, -2866.36f, 1518.76f, 4.48299f, 0, 0, 0.783388f, -0.621533f},
300 {5380.91f, -2849.36f, 1512.81f, 3.90962f, 0, 0, 0.927168f, -0.374646f},
301 {5395.76f, -2881.41f, 1521.11f, 4.28426f, 0, 0, 0.84118f, -0.540755f},
302 {5374.87f, -2859.63f, 1528.98f, 3.30252f, 0, 0, 0.996765f, -0.0803745f},
303 {5356.07f, -2854.66f, 1520.34f, 5.83933f, 0, 0, 0.220108f, -0.975475f},
304 {5363.01f, -2975.72f, 1539.02f, 4.13738f, 0, 0, 0.87859f, -0.477576f},
305 {5336.85f, -2980.74f, 1561.24f, 5.11126f, 0, 0, 0.553001f, -0.83318f},
306 {5335.23f, -2974.62f, 1540.05f, 5.04451f, 0, 0, 0.580496f, -0.814263f},
307 {5422.37f, -2998.87f, 1549.98f, 4.51831f, 0, 0, 0.772288f, -0.635272f},
308 {5405.54f, -3014.6f, 1562.16f, 5.86761f, 0, 0, 0.206298f, -0.978489f},
309 {5427.96f, -3019.4f, 1561.58f, 3.53498f, 0, 0, 0.980718f, -0.19543f},
310 {5348.12f, -2977.84f, 1582.47f, 3.94025f, 0, 0, 0.921323f, -0.388799f},
311 {5331.12f, -2993.71f, 1576.14f, 0.0642734f, 0, 0, 0.0321311f, 0.999484f},
312 {5321.63f, -2986.55f, 1552.2f, 5.29503f, 0, 0, 0.474219f, -0.880407f},
313 {5292.1f, -2914.36f, 1529.52f, 2.9742f, 0, 0, 0.996499f, 0.083601f},
314 {5281.77f, -2926.5f, 1530.62f, 1.67829f, 0, 0, 0.744071f, 0.6681f},
315 {5287.19f, -2909.94f, 1543.49f, 3.31192f, 0, 0, 0.996376f, -0.0850591f},
316 {5534.15f, -2679.35f, 1483.61f, 0.428685f, 0, 0, 0.212705f, 0.977116f},
317 {5545.43f, -2647.82f, 1483.05f, 5.38848f, 0, 0, 0.432578f, -0.901596f}
318};
319
320hyjalAI::hyjalAI(Creature* creature) : EscortAI(creature), Summons(me)
321{
322 Initialize();
323 instance = creature->GetInstanceScript();
324 VeinsSpawned[0] = false;
325 VeinsSpawned[1] = false;
326 InfernalCount = 0;
327 TeleportTimer = 1000;
328 Overrun = false;
329 Teleported = false;
330 WaitForTeleport = false;
331 OverrunCounter = 0;
332 OverrunCounter2 = 0;
333 InfernalPoint = 0;
334 RespawnTimer = 10000;
335 DoRespawn = false;
337 DoMassTeleport = false;
338}
339
341{
342 IsDummy = false;
343
344 // GUIDs
346 BossGUID[0].Clear();
347 BossGUID[1].Clear();
348
349 // Timers
350 NextWaveTimer = 10000;
351 CheckTimer = 0;
352 RetreatTimer = 1000;
353
354 // Misc
355 WaveCount = 0;
356 EnemyCount = 0;
357
358 //Bools
359 EventBegun = false;
360 FirstBossDead = false;
361 SecondBossDead = false;
362 Summon = false;
363 bRetreat = false;
364 Debug = false;
365
366 //Visibility
367 DoHide = true;
368
369 //Initialize spells
370 memset(Spells, 0, sizeof(Spell) * HYJAL_AI_MAX_SPELLS);
371
372 Faction = 0;
373}
374
376{
377 Summons.Summon(summoned);
378}
379
381{
382 Summons.Despawn(summoned);
383}
384
386{
387 me->setActive(true);
388 me->SetFarVisible(true);
389
390 Initialize();
391
392 // Set faction properly based on Creature entry
393 switch (me->GetEntry())
394 {
395 case JAINA:
396 Faction = 0;
398 break;
399
400 case THRALL:
401 Faction = 1;
402 break;
403
404 case TYRANDE:
405 Faction = 2;
407 break;
408 }
409
410 //Flags
412
413 //Reset Instance Data for trash count
415 {
416 //Reset World States
421 }
422}
423
425{
426 if (me->GetEntry() != JAINA)
428 me->CombatStop(true);
429
431
433 if (me->IsAlive())
435
436 me->SetTappedBy(nullptr);
437}
438
440{
441 if (IsDummy)return;
442 for (uint8 i = 0; i < HYJAL_AI_MAX_SPELLS; ++i)
443 if (Spells[i].Cooldown)
444 SpellTimer[i] = Spells[i].Cooldown;
445
446 Talk(ATTACKED);
447}
448
450{
451 if (IsDummy)
452 return;
453
455}
456
457void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
458{
459 uint32 random = rand32() % 4;
460 float SpawnLoc[3];
461
462 for (uint8 i = 0; i < 3; ++i)
463 {
464 SpawnLoc[i] = Base[random][i];
465 }
466 Creature* creature = nullptr;
467 switch (entry)
468 {
469 case 17906: //GARGOYLE
470
471 if (!FirstBossDead && (WaveCount == 1 || WaveCount == 3))
472 {//summon at tower
474 if (creature)
475 ENSURE_AI(hyjal_trashAI, creature->AI())->useFlyPath = true;
476 }
477 else
478 {//summon at gate
480 }
481 break;
482 case 17907: //FROST_WYRM,
483 if (FirstBossDead && WaveCount == 1) //summon at gate
485 else
486 {
488 if (creature)
489 ENSURE_AI(hyjal_trashAI, creature->AI())->useFlyPath = true;
490 }
491 break;
492 case 17908: //GIANT_INFERNAL
494 if (InfernalCount > 7)
495 InfernalCount = 0;
497 break;
498 default:
499 creature = me->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 2min);
500 break;
501
502 }
503
504 if (creature)
505 {
506 // Increment Enemy Count to be used in World States and instance script
507 ++EnemyCount;
508
509 creature->SetWalk(false);
510 creature->setActive(true);
511 creature->SetFarVisible(true);
512 switch (entry)
513 {
514 case NECROMANCER:
515 case ABOMINATION:
516 case GHOUL:
517 case BANSHEE:
518 case CRYPT_FIEND:
519 case GARGOYLE:
520 case FROST_WYRM:
521 case GIANT_INFERNAL:
522 case FEL_STALKER:
523 case RAGE_WINTERCHILL:
524 case ANETHERON:
525 case KAZROGAL:
526 case AZGALOR:
527 ENSURE_AI(hyjal_trashAI, creature->AI())->IsEvent = true;
528 break;
529 }
531 creature->SetDisableReputationGain(true);//no repu for solo farming
532 // Check if Creature is a boss.
533 if (creature->isWorldBoss())
534 {
535 if (!FirstBossDead) BossGUID[0] = creature->GetGUID();
536 else BossGUID[1] = creature->GetGUID();
537 CheckTimer = 5000;
538 }
539 }
540}
541
542void hyjalAI::SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3])
543{
544 // 1 in 4 chance we give a rally yell. Not sure if the chance is offilike.
545 if (rand32() % 4 == 0)
546 Talk(RALLY);
547
548 InfernalCount = 0;//reset infernal count every new wave
549
551 for (uint8 i = 0; i < 18; ++i)
552 {
553 if (wave[Count].Mob[i])
554 SummonCreature(wave[Count].Mob[i], Base);
555 }
556
557 if (!wave[Count].IsBoss)
558 {
559 uint32 stateValue = Count+1;
560 if (FirstBossDead)
561 stateValue -= 9; // Subtract 9 from it to give the proper wave number if we are greater than 8
562
563 // Set world state to our current wave number
564 instance->DoUpdateWorldState(WORLD_STATE_WAVES, stateValue); // Set world state to our current wave number
565 // Enable world state
566 instance->DoUpdateWorldState(WORLD_STATE_ENEMY, 1); // Enable world state
567
568 instance->SetData(DATA_TRASH, EnemyCount); // Send data for instance script to update count
569
570 if (!Debug)
572 else
573 {
574 NextWaveTimer = 15000;
575 TC_LOG_DEBUG("scripts", "HyjalAI: debug mode is enabled. Next Wave in 15 seconds");
576 }
577 }
578 else
579 {
580 // Set world state for waves to 0 to disable it.
583
584 // Set World State for enemies invading to 1.
586
587 Summon = false;
588 }
589 CheckTimer = 5000;
590}
591
593{
594 if (!player || IsDummy || !instance)
595 return;
596
597 Talk(BEGIN);
598
599 EventBegun = true;
600 Summon = true;
601
602 NextWaveTimer = 15000;
603 CheckTimer = 5000;
604 PlayerGUID = player->GetGUID();
605
607
611
612 DeSpawnVeins();
613}
614
616{
617 return instance->GetData(Event);
618}
619
621{
623
624 if (Faction == 0)
625 {
627 AddWaypoint(0, JainaWPs[0][0], JainaWPs[0][1], JainaWPs[0][2]);
628 AddWaypoint(1, JainaWPs[1][0], JainaWPs[1][1], JainaWPs[1][2]);
629 Start(false);
630 SetDespawnAtEnd(false);//move to center of alliance base
631 }
632 if (Faction == 1)
633 {
636 if (JainaDummy)
637 {
639 ENSURE_AI(hyjalAI, JainaDummy->AI())->IsDummy = true;
640 DummyGuid = JainaDummy->GetGUID();
641 }
643 Start(false);
644 SetDespawnAtEnd(false);//move to center of alliance base
645 }
646 SpawnVeins();
647 Overrun = true;
648 me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);//cant talk after overrun event started
649}
650
652{
653 if (Faction == 0)
654 {
655 if (VeinsSpawned[0])//prevent any buggers
656 return;
657 for (uint8 i = 0; i < 7; ++i)
658 {
659 GameObject* gem = me->SummonGameObject(GO_ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], QuaternionData(VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7]), 0s);
660 if (gem)
661 VeinGUID[i]=gem->GetGUID();
662 }
663 VeinsSpawned[0] = true;
664 }
665 else
666 {
667 if (VeinsSpawned[1])
668 return;
669 for (uint8 i = 7; i < 14; ++i)
670 {
671 GameObject* gem = me->SummonGameObject(GO_ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], QuaternionData(VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7]), 0s);
672 if (gem)
673 VeinGUID[i] = gem->GetGUID();
674 }
675 VeinsSpawned[1] = true;
676 }
677}
678
680{
681 if (Faction == 1)
682 {
684 if (!unit)return;
685 hyjalAI* ai = CAST_AI(hyjalAI, unit->AI());
686 if (!ai)return;
687 for (uint8 i = 0; i < 7; ++i)
688 {
690 gem->Delete();
691 }
692 }
693 else if (Faction)
694 {
696 if (!unit)
697 return;
698 hyjalAI* ai = CAST_AI(hyjalAI, unit->AI());
699 if (!ai)
700 return;
701 for (uint8 i = 7; i < 14; ++i)
702 {
704 gem->Delete();
705 }
706 }
707}
708
710{
711 if (IsDummy)
712 {
713 if (MassTeleportTimer < diff && DoMassTeleport)
714 {
716 DoMassTeleport = false;
717 }
718 else
719 MassTeleportTimer -= diff;
720 return;
721 }
722 if (DoHide)
723 {
724 DoHide = false;
725 switch (me->GetEntry())
726 {
727 case JAINA:
729 {
730 me->SetVisible(false);
732 HideNearPos(5037.76f, -1889.71f);
733 for (uint8 i = 0; i < 92; ++i)//summon fires
735
736 }
737 else me->SetVisible(true);
738 break;
739 case THRALL: //thrall
741 {
742 me->SetVisible(false);
744 HideNearPos(5563, -2763.19f);
745 HideNearPos(5542.2f, -2629.36f);
746 for (uint8 i = 0; i < 65; ++i)//summon fires
748
749 }
750 else me->SetVisible(true);
751 break;
752 }
753 }
754 if (DoRespawn)
755 {
756 if (RespawnTimer <= diff)
757 {
758 DoRespawn = false;
760 if (Faction == 0)
761 {
762 RespawnNearPos(5037.76f, -1889.71f);
763 } else if (Faction == 1)
764 {
765 RespawnNearPos(5563, -2763.19f);
766 RespawnNearPos(5542.2f, -2629.36f);
767 }
768 me->SetVisible(true);
769 }else{
770 RespawnTimer -= diff;
771 me->SetVisible(false);
772 }
773 return;
774 }
775 if (Overrun)
776 DoOverrun(Faction, diff);
777 if (bRetreat)
778 {
779 if (RetreatTimer <= diff)
780 {
781 IsDummy = true;
782 bRetreat = false;
784 switch (me->GetEntry())
785 {
786 case JAINA://jaina
787 HideNearPos(5037.76f, -1889.71f);
788 break;
789 case THRALL://thrall
790 HideNearPos(5563, -2763.19f);
791 HideNearPos(5542.2f, -2629.36f);
792 HideNearPos(5603.75f, -2853.12f);
793 break;
794 }
795 me->SetVisible(false);
796 } else RetreatTimer -= diff;
797 }
798
799 if (!EventBegun)
800 return;
801
802 if (Summon)
803 {
804 if (EnemyCount)
805 {
807 if (!EnemyCount)
808 NextWaveTimer = 5000;
809 }
810
811 if (NextWaveTimer <= diff)
812 {
813 if (Faction == 0)
815 else if (Faction == 1)
817 ++WaveCount;
818 } else NextWaveTimer -= diff;
819 }
820
821 if (CheckTimer <= diff)
822 {
823 for (uint8 i = 0; i < 2; ++i)
824 {
825 if (!BossGUID[i].IsEmpty())
826 {
828 if (unit && (!unit->IsAlive()))
829 {
830 if (BossGUID[i] == BossGUID[0])
831 {
832 Talk(INCOMING);
833 FirstBossDead = true;
834 }
835 else if (BossGUID[i] == BossGUID[1])
836 {
837 if (me->GetEntry() == THRALL) // thrall yell success after boss deaded,jaina yell success after select gossip
838 {
839 Talk(SUCCESS);
840 }
841 SecondBossDead = true;
842 }
843 EventBegun = false;
844 CheckTimer = 0;
846 BossGUID[i].Clear();
847 instance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); // Reset world state for enemies to disable it
848 }
849 }
850 }
851 CheckTimer = 5000;
852 } else CheckTimer -= diff;
853
854 if (!UpdateVictim())
855 return;
856
857 for (uint8 i = 0; i < HYJAL_AI_MAX_SPELLS; ++i)
858 {
859 if (Spells[i].SpellId)
860 {
861 if (SpellTimer[i] <= diff)
862 {
863 if (me->IsNonMeleeSpellCast(false))
865
866 Unit* target = nullptr;
867
868 switch (Spells[i].TargetType)
869 {
870 case TARGETTYPE_SELF:
871 target = me;
872 break;
873
876 break;
877
879 target = me->GetVictim();
880 break;
881 }
882
883 if (target && target->IsAlive())
884 {
885 DoCast(target, Spells[i].SpellId);
886 SpellTimer[i] = Spells[i].Cooldown;
887 }
888 } else SpellTimer[i] -= diff;
889 }
890 }
891}
892
893void hyjalAI::JustDied(Unit* /*killer*/)
894{
895 if (IsDummy)return;
896 me->Respawn();
897 me->SetVisible(false);
898 DoRespawn = true;
899 RespawnTimer = 120000;
900 Talk(DEATH);
901 Summons.DespawnAll();//despawn all wave's summons
902 instance->SetData(DATA_RESET_RAIDDAMAGE, 0);//reset damage on die
903}
904
905void hyjalAI::HideNearPos(float x, float y)
906{
907 // First get all creatures.
908 std::list<Creature*> creatures;
910 Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
911 Cell::VisitGridObjects(x, y, me->GetMap(), creature_searcher, me->GetGridActivationRange());
912
913 if (!creatures.empty())
914 {
915 for (std::list<Creature*>::const_iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
916 {
917 (*itr)->SetVisible(false);
918 (*itr)->SetFaction(FACTION_FRIENDLY);//make them friendly so mobs won't attack them
919 }
920 }
921}
922
923void hyjalAI::RespawnNearPos(float x, float y)
924{
928}
929
930void hyjalAI::WaypointReached(uint32 waypointId, uint32 /*pathId*/)
931{
932 if (waypointId == 1 || (waypointId == 0 && me->GetEntry() == THRALL))
933 {
934 WaitForTeleport = true;
935 TeleportTimer = 20000;
936 if (me->GetEntry() == JAINA)
938 if (me->GetEntry() == THRALL && !DummyGuid.IsEmpty())
939 {
941 {
942 hyjalAI* ai = ENSURE_AI(hyjalAI, creature->AI());
944 ai->DoMassTeleport = true;
945 ai->MassTeleportTimer = 20000;
946 creature->CastSpell(me, SPELL_MASS_TELEPORT, false);
947 }
948 }
949 //do some talking
950 //all alive guards walk near here
951 // First get all creatures.
952 std::list<Creature*> creatures;
954 Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
955 Cell::VisitGridObjects(me, creature_searcher, me->GetGridActivationRange());
956
957 if (!creatures.empty())
958 {
959 for (std::list<Creature*>::const_iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
960 {
961 if ((*itr) && (*itr)->IsAlive() && (*itr) != me && (*itr)->GetEntry() != JAINA)
962 {
963 if (!(*itr)->IsWithinDist(me, 60))
964 (*itr)->SetWalk(false);
965 float x, y, z;
966 (*itr)->SetDefaultMovementType(IDLE_MOTION_TYPE);
967 (*itr)->GetMotionMaster()->Initialize();
968 float range = 10;
969 if (me->GetEntry() == THRALL)range = 20;
970 me->GetNearPoint(nullptr, x, y, z, range, me->GetAbsoluteAngle((*itr)));
971 (*itr)->GetMotionMaster()->MovePoint(0, x+irand(-5, 5), y+irand(-5, 5), me->GetPositionZ());
972 }
973 }
974 }
975 }
976}
977void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
978{
979 EscortAI::UpdateAI(diff);
980 if (WaitForTeleport)
981 {
982 if (TeleportTimer <= diff)
983 {
984 std::list<Creature*> creatures;
986 Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
987 Cell::VisitGridObjects(me, creature_searcher, me->GetGridActivationRange());
988
989 if (!creatures.empty())
990 {
991 for (std::list<Creature*>::const_iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
992 {
993 if ((*itr) && (*itr)->IsAlive())
994 {
995 (*itr)->CastSpell(*itr, SPELL_TELEPORT_VISUAL, true);
996 (*itr)->SetFaction(FACTION_FRIENDLY);//make them friendly so mobs won't attack them
997 (*itr)->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
998 }
999 }
1001 bRetreat = true;
1002 RetreatTimer = 1000;
1003 }
1004
1005 WaitForTeleport = false;
1006 Teleported = true;
1007 }TeleportTimer -= diff;
1008 }
1009 if (!Teleported)
1010 return;
1011 Overrun = false;//execute once
1012 switch (faction)
1013 {
1014 case 0://alliance
1015 for (uint8 i = 0; i < 92; ++i)//summon fires
1017
1018 for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls
1019 {
1020 uint8 r = rand32() % 4;
1021 Creature* unit = me->SummonCreature(GHOUL, AllianceBase[r][0]+irand(-15, 15), AllianceBase[r][1]+irand(-15, 15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2min);
1022 if (unit)
1023 {
1024 ENSURE_AI(hyjal_trashAI, unit->AI())->faction = Faction;
1025 ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
1026 ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
1027 unit->setActive(true);
1028 unit->SetFarVisible(true);
1029 }
1030 }
1031 for (uint8 i = 0; i < 3; ++i)//summon 3 abominations
1032 {
1033 uint8 r = rand32() % 4;
1034 Creature* unit = me->SummonCreature(ABOMINATION, AllianceBase[r][0]+irand(-15, 15), AllianceBase[r][1]+irand(-15, 15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2min);
1035 if (unit)
1036 {
1037 ENSURE_AI(hyjal_trashAI, unit->AI())->faction = Faction;
1038 ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
1039 ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
1040 unit->setActive(true);
1041 unit->SetFarVisible(true);
1042 }
1043 }
1044 for (uint8 i = 0; i < 5; ++i)//summon 5 gargoyles
1045 {
1047 if (unit)
1048 {
1050 ENSURE_AI(hyjal_trashAI, unit->AI())->faction = Faction;
1051 ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
1052 ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
1053 unit->setActive(true);
1054 unit->SetFarVisible(true);
1055 }
1056 }
1057 break;
1058 case 1://horde
1059 for (uint8 i = 0; i < 65; ++i)//summon fires
1061
1062 for (uint8 i = 0; i < 26; ++i)//summon infernals
1063 {
1065 if (unit)
1066 {
1067 unit->SetHomePosition(InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3]);
1068 ENSURE_AI(hyjal_trashAI, unit->AI())->faction = Faction;
1069 ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
1070 ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
1071 unit->setActive(true);
1072 unit->SetFarVisible(true);
1073 }
1074 }
1075 for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls
1076 {
1077 uint8 r = rand32() % 4;
1078 Creature* unit = me->SummonCreature(GHOUL, HordeBase[r][0]+irand(-15, 15), HordeBase[r][1]+irand(-15, 15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2min);
1079 if (unit)
1080 {
1081 ENSURE_AI(hyjal_trashAI, unit->AI())->faction = Faction;
1082 ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
1083 ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
1084 unit->setActive(true);
1085 unit->SetFarVisible(true);
1086 }
1087 }
1088 for (uint8 i = 0; i < 5; ++i)//summon 5 abominations
1089 {
1090 uint8 r = rand32() % 4;
1091 Creature* unit = me->SummonCreature(ABOMINATION, HordeBase[r][0]+irand(-15, 15), HordeBase[r][1]+irand(-15, 15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2min);
1092 if (unit)
1093 {
1094 ENSURE_AI(hyjal_trashAI, unit->AI())->faction = Faction;
1095 ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
1096 ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
1097 unit->setActive(true);
1098 unit->SetFarVisible(true);
1099 }
1100 }
1101 break;
1102 }
1103}
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
@ SPECIAL
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:156
@ IDLE_MOTION_TYPE
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: ObjectDefines.h:70
@ TEMPSUMMON_TIMED_DESPAWN
Definition: ObjectDefines.h:65
@ TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
Definition: ObjectDefines.h:63
Spells
Definition: PlayerAI.cpp:32
int32 irand(int32 min, int32 max)
Definition: Random.cpp:35
uint32 rand32()
Definition: Random.cpp:70
@ FACTION_FRIENDLY
EvadeReason
Definition: UnitAICommon.h:30
#define CAST_AI(a, b)
Definition: UnitAI.h:28
#define ENSURE_AI(a, b)
Definition: UnitAI.h:29
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:297
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:145
Position const SpawnLoc
Definition: boss_skadi.cpp:124
@ SPELL_TELEPORT_VISUAL
Definition: chapter5.cpp:164
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
void EngagementOver()
Definition: CreatureAI.cpp:287
bool LoadCreaturesAddon()
Definition: Creature.cpp:2749
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:371
void Respawn(bool force=false)
Definition: Creature.cpp:2303
bool isWorldBoss() const
Definition: Creature.cpp:2484
void SetDisableReputationGain(bool disable)
Definition: Creature.h:397
void SetTappedBy(Unit const *unit, bool withGroup=true)
Definition: Creature.cpp:1339
CreatureAI * AI() const
Definition: Creature.h:214
void DoUpdateWorldState(int32 worldStateId, int32 value)
virtual ObjectGuid GetGuidData(uint32 type) const override
InstanceMap * instance
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3489
void MoveTargetedHome()
bool IsEmpty() const
Definition: ObjectGuid.h:319
void Clear()
Definition: ObjectGuid.h:286
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
void SetVisible(bool x)
Definition: Unit.cpp:8351
void CombatStop(bool includingCast=false, bool mutualPvP=true, bool(*unitFilter)(Unit const *otherUnit)=nullptr)
Definition: Unit.cpp:5827
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:3089
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:3059
bool IsAlive() const
Definition: Unit.h:1164
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:983
void SetNpcFlag(NPCFlags flags)
Definition: Unit.h:982
bool SetWalk(bool enable)
Definition: Unit.cpp:12707
Unit * GetVictim() const
Definition: Unit.h:715
void RemoveAllAuras()
Definition: Unit.cpp:4242
Map * GetMap() const
Definition: Object.h:624
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1042
void GetNearPoint(WorldObject const *searcher, float &x, float &y, float &z, float distance2d, float absAngle) const
Definition: Object.cpp:3368
float GetGridActivationRange() const
Definition: Object.cpp:1431
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition: Object.cpp:2025
void setActive(bool isActiveObject)
Definition: Object.cpp:922
GameObject * SummonGameObject(uint32 entry, Position const &pos, QuaternionData const &rot, Seconds respawnTime, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2065
void SetFarVisible(bool on)
Definition: Object.cpp:973
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:91
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:92
float VeinPos[14][8]
Definition: hyjalAI.cpp:128
float AllianceOverrunGargPos[5][4]
Definition: hyjalAI.cpp:146
float JainaWPs[2][3]
Definition: hyjalAI.cpp:80
float HordeBase[4][3]
Definition: hyjalAI.cpp:71
float InfernalPos[8][3]
Definition: hyjalAI.cpp:86
float JainaDummySpawn[2][4]
Definition: hyjalAI.cpp:64
Spawns
Definition: hyjalAI.cpp:36
@ SPAWN_NEAR_TOWER
Definition: hyjalAI.cpp:39
@ SPAWN_GARG_GATE
Definition: hyjalAI.cpp:37
@ SPAWN_WYRM_GATE
Definition: hyjalAI.cpp:38
float InfernalSPWP[26][4]
Definition: hyjalAI.cpp:98
float HordeFirePos[65][8]
Definition: hyjalAI.cpp:251
float AllianceBase[4][3]
Definition: hyjalAI.cpp:56
float SpawnPointSpecial[3][3]
Definition: hyjalAI.cpp:48
@ JAINA_RETREAT_HORDE_BASE
Definition: hyjalAI.cpp:44
float AllianceFirePos[92][8]
Definition: hyjalAI.cpp:155
TargetType
Definition: hyjalAI.h:104
@ TARGETTYPE_RANDOM
Definition: hyjalAI.h:106
@ TARGETTYPE_SELF
Definition: hyjalAI.h:105
@ TARGETTYPE_VICTIM
Definition: hyjalAI.h:107
const Wave HordeWaves[]
Definition: hyjalAI.h:78
@ SPELL_BRILLIANCE_AURA
Definition: hyjalAI.h:32
@ SPELL_TRUESHOT_AURA
Definition: hyjalAI.h:42
@ SPELL_MASS_TELEPORT
Definition: hyjalAI.h:29
const Wave AllianceWaves[]
Definition: hyjalAI.h:53
@ ATTACKED
Definition: hyjalAI.h:112
@ BEGIN
Definition: hyjalAI.h:113
@ INCOMING
Definition: hyjalAI.h:114
@ RALLY
Definition: hyjalAI.h:115
@ DEATH
Definition: hyjalAI.h:118
@ SUCCESS
Definition: hyjalAI.h:117
#define HYJAL_AI_MAX_SPELLS
Definition: hyjalAI.h:24
NPCTEXTS
Definition: hyjal.cpp:57
@ KAZROGAL
Definition: hyjal.h:76
@ AZGALOR
Definition: hyjal.h:77
@ FEL_STALKER
Definition: hyjal.h:67
@ TYRANDE
Definition: hyjal.h:71
@ BANSHEE
Definition: hyjal.h:62
@ ANETHERON
Definition: hyjal.h:75
@ GARGOYLE
Definition: hyjal.h:64
@ GIANT_INFERNAL
Definition: hyjal.h:66
@ FROST_WYRM
Definition: hyjal.h:65
@ ABOMINATION
Definition: hyjal.h:60
@ JAINA
Definition: hyjal.h:69
@ CRYPT_FIEND
Definition: hyjal.h:63
@ GHOUL
Definition: hyjal.h:61
@ RAGE_WINTERCHILL
Definition: hyjal.h:74
@ THRALL
Definition: hyjal.h:70
@ NECROMANCER
Definition: hyjal.h:59
@ TYPE_RETREAT
Definition: hyjal.h:45
@ DATA_TRASH
Definition: hyjal.h:39
@ DATA_RAIDDAMAGE
Definition: hyjal.h:43
@ DATA_RESET_RAIDDAMAGE
Definition: hyjal.h:44
@ DATA_THRALL
Definition: hyjal.h:37
@ DATA_JAINAPROUDMOORE
Definition: hyjal.h:36
@ DATA_ALLIANCE_RETREAT
Definition: hyjal.h:41
@ DATA_HORDE_RETREAT
Definition: hyjal.h:42
@ DATA_RESET_TRASH_COUNT
Definition: hyjal.h:40
#define MINRAIDDAMAGE
Definition: hyjal.h:92
@ GO_ROARING_FLAME
Definition: hyjal.h:89
@ GO_ANCIENT_VEIN
Definition: hyjal.h:88
@ WORLD_STATE_WAVES
Definition: hyjal.h:51
@ WORLD_STATE_ENEMY
Definition: hyjal.h:52
@ WORLD_STATE_ENEMYCOUNT
Definition: hyjal.h:53
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
size_t Count(ContainerMapList< TypeList< H, T > > const &elements, SPECIFIC_TYPE *fake)
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:179
void Start(bool isActiveAttacker=true, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false)
void AddWaypoint(uint32 id, float x, float y, float z, bool run)
void MoveInLineOfSight(Unit *who) override
void SetDespawnAtEnd(bool despawn)
void UpdateAI(uint32 diff) override
constexpr float GetPositionX() const
Definition: Position.h:76
constexpr float GetPositionY() const
Definition: Position.h:77
float GetAbsoluteAngle(float x, float y) const
Definition: Position.h:125
constexpr float GetPositionZ() const
Definition: Position.h:78
Definition: hyjalAI.h:47
uint32 WaveTimer
Definition: hyjalAI.h:49
bool Debug
Definition: hyjalAI.h:182
void RespawnNearPos(float x, float y)
Definition: hyjalAI.cpp:923
bool WaitForTeleport
Definition: hyjalAI.h:188
void SpawnVeins()
Definition: hyjalAI.cpp:651
uint32 RespawnTimer
Definition: hyjalAI.h:193
void SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3])
Definition: hyjalAI.cpp:542
bool FirstBossDead
Definition: hyjalAI.h:178
void EnterEvadeMode(EvadeReason why) override
Definition: hyjalAI.cpp:424
uint32 OverrunCounter2
Definition: hyjalAI.h:191
bool Summon
Definition: hyjalAI.h:180
bool DoMassTeleport
Definition: hyjalAI.h:198
uint32 CheckTimer
Definition: hyjalAI.h:172
bool VeinsSpawned[2]
Definition: hyjalAI.h:183
bool DoRespawn
Definition: hyjalAI.h:194
bool SecondBossDead
Definition: hyjalAI.h:179
ObjectGuid BossGUID[2]
Definition: hyjalAI.h:167
uint32 RetreatTimer
Definition: hyjalAI.h:175
bool bRetreat
Definition: hyjalAI.h:181
void StartEvent(Player *player)
Definition: hyjalAI.cpp:592
uint8 InfernalCount
Definition: hyjalAI.h:184
void WaypointReached(uint32 waypointId, uint32) override
Definition: hyjalAI.cpp:930
ObjectGuid VeinGUID[14]
Definition: hyjalAI.h:168
uint32 EnemyCount
Definition: hyjalAI.h:174
void DeSpawnVeins()
Definition: hyjalAI.cpp:679
void SummonedCreatureDespawn(Creature *summoned) override
Definition: hyjalAI.cpp:380
void UpdateAI(uint32 diff) override
Definition: hyjalAI.cpp:709
void Initialize()
Definition: hyjalAI.cpp:340
uint32 MassTeleportTimer
Definition: hyjalAI.h:197
void HideNearPos(float x, float y)
Definition: hyjalAI.cpp:905
uint32 NextWaveTimer
Definition: hyjalAI.h:170
bool EventBegun
Definition: hyjalAI.h:177
void Retreat()
Definition: hyjalAI.cpp:620
ObjectGuid PlayerGUID
Definition: hyjalAI.h:166
void JustEngagedWith(Unit *who) override
Definition: hyjalAI.cpp:439
uint32 GetInstanceData(uint32 Event)
Definition: hyjalAI.cpp:615
uint32 OverrunCounter
Definition: hyjalAI.h:190
hyjalAI(Creature *creature)
Definition: hyjalAI.cpp:320
uint32 TeleportTimer
Definition: hyjalAI.h:189
uint32 WaveCount
Definition: hyjalAI.h:171
InstanceScript * instance
Definition: hyjalAI.h:164
void DoOverrun(uint32 faction, const uint32 diff)
Definition: hyjalAI.cpp:977
void Reset() override
Definition: hyjalAI.cpp:385
bool Overrun
Definition: hyjalAI.h:186
uint32 SpellTimer[3]
Definition: hyjalAI.h:209
void SummonCreature(uint32 entry, float Base[4][3])
Definition: hyjalAI.cpp:457
bool Teleported
Definition: hyjalAI.h:187
uint32 Faction
Definition: hyjalAI.h:173
void MoveInLineOfSight(Unit *who) override
Definition: hyjalAI.cpp:449
void JustDied(Unit *killer) override
Definition: hyjalAI.cpp:893
bool DoHide
Definition: hyjalAI.h:195
ObjectGuid DummyGuid
Definition: hyjalAI.h:199
bool IsDummy
Definition: hyjalAI.h:196
void JustSummoned(Creature *summoned) override
Definition: hyjalAI.cpp:375