TrinityCore
Loading...
Searching...
No Matches
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
41
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 ENSURE_AI(hyjal_trashAI, creature->AI())->IsEvent = true;
524 break;
525 }
527 creature->SetDisableReputationGain(true);//no repu for solo farming
528 // Check if Creature is a boss.
529 if (creature->isWorldBoss())
530 {
531 if (!FirstBossDead) BossGUID[0] = creature->GetGUID();
532 else BossGUID[1] = creature->GetGUID();
533 CheckTimer = 5000;
534 }
535 }
536}
537
538void hyjalAI::SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3])
539{
540 // 1 in 4 chance we give a rally yell. Not sure if the chance is offilike.
541 if (rand32() % 4 == 0)
542 Talk(RALLY);
543
544 InfernalCount = 0;//reset infernal count every new wave
545
547 for (uint8 i = 0; i < 18; ++i)
548 {
549 if (wave[Count].Mob[i])
550 SummonCreature(wave[Count].Mob[i], Base);
551 }
552
553 if (!wave[Count].IsBoss)
554 {
555 uint32 stateValue = Count+1;
556 if (FirstBossDead)
557 stateValue -= 9; // Subtract 9 from it to give the proper wave number if we are greater than 8
558
559 // Set world state to our current wave number
560 instance->DoUpdateWorldState(WORLD_STATE_WAVES, stateValue); // Set world state to our current wave number
561 // Enable world state
562 instance->DoUpdateWorldState(WORLD_STATE_ENEMY, 1); // Enable world state
563
564 instance->SetData(DATA_TRASH, EnemyCount); // Send data for instance script to update count
565
566 if (!Debug)
568 else
569 {
570 NextWaveTimer = 15000;
571 TC_LOG_DEBUG("scripts", "HyjalAI: debug mode is enabled. Next Wave in 15 seconds");
572 }
573 }
574 else
575 {
576 // Set world state for waves to 0 to disable it.
579
580 // Set World State for enemies invading to 1.
582
583 Summon = false;
584 }
585 CheckTimer = 5000;
586}
587
589{
590 if (!player || IsDummy || !instance)
591 return;
592
593 Talk(BEGIN);
594
595 EventBegun = true;
596 Summon = true;
597
598 NextWaveTimer = 15000;
599 CheckTimer = 5000;
600 PlayerGUID = player->GetGUID();
601
603
607
608 DeSpawnVeins();
609}
610
612{
613 return instance->GetData(Event);
614}
615
617{
619
620 if (Faction == 0)
621 {
623 AddWaypoint(0, JainaWPs[0][0], JainaWPs[0][1], JainaWPs[0][2]);
624 AddWaypoint(1, JainaWPs[1][0], JainaWPs[1][1], JainaWPs[1][2]);
625 Start(false);
626 SetDespawnAtEnd(false);//move to center of alliance base
627 }
628 if (Faction == 1)
629 {
632 if (JainaDummy)
633 {
635 ENSURE_AI(hyjalAI, JainaDummy->AI())->IsDummy = true;
636 DummyGuid = JainaDummy->GetGUID();
637 }
639 Start(false);
640 SetDespawnAtEnd(false);//move to center of alliance base
641 }
642 SpawnVeins();
643 Overrun = true;
644 me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);//cant talk after overrun event started
645}
646
648{
649 if (Faction == 0)
650 {
651 if (VeinsSpawned[0])//prevent any buggers
652 return;
653 for (uint8 i = 0; i < 7; ++i)
654 {
655 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);
656 if (gem)
657 VeinGUID[i]=gem->GetGUID();
658 }
659 VeinsSpawned[0] = true;
660 }
661 else
662 {
663 if (VeinsSpawned[1])
664 return;
665 for (uint8 i = 7; i < 14; ++i)
666 {
667 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);
668 if (gem)
669 VeinGUID[i] = gem->GetGUID();
670 }
671 VeinsSpawned[1] = true;
672 }
673}
674
676{
677 if (Faction == 1)
678 {
680 if (!unit)return;
681 hyjalAI* ai = CAST_AI(hyjalAI, unit->AI());
682 if (!ai)return;
683 for (uint8 i = 0; i < 7; ++i)
684 {
686 gem->Delete();
687 }
688 }
689 else if (Faction)
690 {
692 if (!unit)
693 return;
694 hyjalAI* ai = CAST_AI(hyjalAI, unit->AI());
695 if (!ai)
696 return;
697 for (uint8 i = 7; i < 14; ++i)
698 {
700 gem->Delete();
701 }
702 }
703}
704
706{
707 if (IsDummy)
708 {
709 if (MassTeleportTimer < diff && DoMassTeleport)
710 {
712 DoMassTeleport = false;
713 }
714 else
715 MassTeleportTimer -= diff;
716 return;
717 }
718 if (DoHide)
719 {
720 DoHide = false;
721 switch (me->GetEntry())
722 {
723 case JAINA:
725 {
726 me->SetVisible(false);
728 HideNearPos(5037.76f, -1889.71f);
729 for (uint8 i = 0; i < 92; ++i)//summon fires
731
732 }
733 else me->SetVisible(true);
734 break;
735 case THRALL: //thrall
737 {
738 me->SetVisible(false);
740 HideNearPos(5563, -2763.19f);
741 HideNearPos(5542.2f, -2629.36f);
742 for (uint8 i = 0; i < 65; ++i)//summon fires
744
745 }
746 else me->SetVisible(true);
747 break;
748 }
749 }
750 if (DoRespawn)
751 {
752 if (RespawnTimer <= diff)
753 {
754 DoRespawn = false;
756 if (Faction == 0)
757 {
758 RespawnNearPos(5037.76f, -1889.71f);
759 } else if (Faction == 1)
760 {
761 RespawnNearPos(5563, -2763.19f);
762 RespawnNearPos(5542.2f, -2629.36f);
763 }
764 me->SetVisible(true);
765 }else{
766 RespawnTimer -= diff;
767 me->SetVisible(false);
768 }
769 return;
770 }
771 if (Overrun)
772 DoOverrun(Faction, diff);
773 if (bRetreat)
774 {
775 if (RetreatTimer <= diff)
776 {
777 IsDummy = true;
778 bRetreat = false;
780 switch (me->GetEntry())
781 {
782 case JAINA://jaina
783 HideNearPos(5037.76f, -1889.71f);
784 break;
785 case THRALL://thrall
786 HideNearPos(5563, -2763.19f);
787 HideNearPos(5542.2f, -2629.36f);
788 HideNearPos(5603.75f, -2853.12f);
789 break;
790 }
791 me->SetVisible(false);
792 } else RetreatTimer -= diff;
793 }
794
795 if (!EventBegun)
796 return;
797
798 if (Summon)
799 {
800 if (EnemyCount)
801 {
803 if (!EnemyCount)
804 NextWaveTimer = 5000;
805 }
806
807 if (NextWaveTimer <= diff)
808 {
809 if (Faction == 0)
811 else if (Faction == 1)
813 ++WaveCount;
814 } else NextWaveTimer -= diff;
815 }
816
817 if (CheckTimer <= diff)
818 {
819 for (uint8 i = 0; i < 2; ++i)
820 {
821 if (!BossGUID[i].IsEmpty())
822 {
824 if (unit && (!unit->IsAlive()))
825 {
826 if (BossGUID[i] == BossGUID[0])
827 {
828 Talk(INCOMING);
829 FirstBossDead = true;
830 }
831 else if (BossGUID[i] == BossGUID[1])
832 {
833 if (me->GetEntry() == THRALL) // thrall yell success after boss deaded,jaina yell success after select gossip
834 {
835 Talk(SUCCESS);
836 }
837 SecondBossDead = true;
838 }
839 EventBegun = false;
840 CheckTimer = 0;
842 BossGUID[i].Clear();
843 instance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); // Reset world state for enemies to disable it
844 }
845 }
846 }
847 CheckTimer = 5000;
848 } else CheckTimer -= diff;
849
850 if (!UpdateVictim())
851 return;
852
853 for (uint8 i = 0; i < HYJAL_AI_MAX_SPELLS; ++i)
854 {
855 if (Spells[i].SpellId)
856 {
857 if (SpellTimer[i] <= diff)
858 {
859 if (me->IsNonMeleeSpellCast(false))
861
862 Unit* target = nullptr;
863
864 switch (Spells[i].TargetType)
865 {
866 case TARGETTYPE_SELF:
867 target = me;
868 break;
869
872 break;
873
875 target = me->GetVictim();
876 break;
877 }
878
879 if (target && target->IsAlive())
880 {
881 DoCast(target, Spells[i].SpellId);
882 SpellTimer[i] = Spells[i].Cooldown;
883 }
884 } else SpellTimer[i] -= diff;
885 }
886 }
887}
888
889void hyjalAI::JustDied(Unit* /*killer*/)
890{
891 if (IsDummy)return;
892 me->Respawn();
893 me->SetVisible(false);
894 DoRespawn = true;
895 RespawnTimer = 120000;
896 Talk(DEATH);
897 Summons.DespawnAll();//despawn all wave's summons
898 instance->SetData(DATA_RESET_RAIDDAMAGE, 0);//reset damage on die
899}
900
901void hyjalAI::HideNearPos(float x, float y)
902{
903 // First get all creatures.
904 std::list<Creature*> creatures;
906 Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
907 Cell::VisitGridObjects(x, y, me->GetMap(), creature_searcher, me->GetGridActivationRange());
908
909 if (!creatures.empty())
910 {
911 for (std::list<Creature*>::const_iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
912 {
913 (*itr)->SetVisible(false);
914 (*itr)->SetFaction(FACTION_FRIENDLY);//make them friendly so mobs won't attack them
915 }
916 }
917}
918
919void hyjalAI::RespawnNearPos(float x, float y)
920{
924}
925
926void hyjalAI::WaypointReached(uint32 waypointId, uint32 /*pathId*/)
927{
928 if (waypointId == 1 || (waypointId == 0 && me->GetEntry() == THRALL))
929 {
930 WaitForTeleport = true;
931 TeleportTimer = 20000;
932 if (me->GetEntry() == JAINA)
934 if (me->GetEntry() == THRALL && !DummyGuid.IsEmpty())
935 {
937 {
938 hyjalAI* ai = ENSURE_AI(hyjalAI, creature->AI());
940 ai->DoMassTeleport = true;
941 ai->MassTeleportTimer = 20000;
942 creature->CastSpell(me, SPELL_MASS_TELEPORT, false);
943 }
944 }
945 //do some talking
946 //all alive guards walk near here
947 // First get all creatures.
948 std::list<Creature*> creatures;
950 Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
951 Cell::VisitGridObjects(me, creature_searcher, me->GetGridActivationRange());
952
953 if (!creatures.empty())
954 {
955 for (std::list<Creature*>::const_iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
956 {
957 if ((*itr) && (*itr)->IsAlive() && (*itr) != me && (*itr)->GetEntry() != JAINA)
958 {
959 if (!(*itr)->IsWithinDist(me, 60))
960 (*itr)->SetWalk(false);
961 float x, y, z;
962 (*itr)->SetDefaultMovementType(IDLE_MOTION_TYPE);
963 (*itr)->GetMotionMaster()->Initialize();
964 float range = 10;
965 if (me->GetEntry() == THRALL)range = 20;
966 me->GetNearPoint(nullptr, x, y, z, range, me->GetAbsoluteAngle((*itr)));
967 (*itr)->GetMotionMaster()->MovePoint(0, x+irand(-5, 5), y+irand(-5, 5), me->GetPositionZ());
968 }
969 }
970 }
971 }
972}
973void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
974{
975 EscortAI::UpdateAI(diff);
976 if (WaitForTeleport)
977 {
978 if (TeleportTimer <= diff)
979 {
980 std::list<Creature*> creatures;
982 Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
983 Cell::VisitGridObjects(me, creature_searcher, me->GetGridActivationRange());
984
985 if (!creatures.empty())
986 {
987 for (std::list<Creature*>::const_iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
988 {
989 if ((*itr) && (*itr)->IsAlive())
990 {
991 (*itr)->CastSpell(*itr, SPELL_TELEPORT_VISUAL, true);
992 (*itr)->SetFaction(FACTION_FRIENDLY);//make them friendly so mobs won't attack them
993 (*itr)->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
994 }
995 }
997 bRetreat = true;
998 RetreatTimer = 1000;
999 }
1000
1001 WaitForTeleport = false;
1002 Teleported = true;
1003 }TeleportTimer -= diff;
1004 }
1005 if (!Teleported)
1006 return;
1007 Overrun = false;//execute once
1008 switch (faction)
1009 {
1010 case 0://alliance
1011 for (uint8 i = 0; i < 92; ++i)//summon fires
1013
1014 for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls
1015 {
1016 uint8 r = rand32() % 4;
1017 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);
1018 if (unit)
1019 {
1020 ENSURE_AI(hyjal_trashAI, unit->AI())->faction = Faction;
1021 ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
1022 ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
1023 unit->setActive(true);
1024 unit->SetFarVisible(true);
1025 }
1026 }
1027 for (uint8 i = 0; i < 3; ++i)//summon 3 abominations
1028 {
1029 uint8 r = rand32() % 4;
1030 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);
1031 if (unit)
1032 {
1033 ENSURE_AI(hyjal_trashAI, unit->AI())->faction = Faction;
1034 ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
1035 ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
1036 unit->setActive(true);
1037 unit->SetFarVisible(true);
1038 }
1039 }
1040 for (uint8 i = 0; i < 5; ++i)//summon 5 gargoyles
1041 {
1043 if (unit)
1044 {
1046 ENSURE_AI(hyjal_trashAI, unit->AI())->faction = Faction;
1047 ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
1048 ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
1049 unit->setActive(true);
1050 unit->SetFarVisible(true);
1051 }
1052 }
1053 break;
1054 case 1://horde
1055 for (uint8 i = 0; i < 65; ++i)//summon fires
1057
1058 for (uint8 i = 0; i < 26; ++i)//summon infernals
1059 {
1061 if (unit)
1062 {
1063 unit->SetHomePosition(InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3]);
1064 ENSURE_AI(hyjal_trashAI, unit->AI())->faction = Faction;
1065 ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
1066 ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
1067 unit->setActive(true);
1068 unit->SetFarVisible(true);
1069 }
1070 }
1071 for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls
1072 {
1073 uint8 r = rand32() % 4;
1074 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);
1075 if (unit)
1076 {
1077 ENSURE_AI(hyjal_trashAI, unit->AI())->faction = Faction;
1078 ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
1079 ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
1080 unit->setActive(true);
1081 unit->SetFarVisible(true);
1082 }
1083 }
1084 for (uint8 i = 0; i < 5; ++i)//summon 5 abominations
1085 {
1086 uint8 r = rand32() % 4;
1087 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);
1088 if (unit)
1089 {
1090 ENSURE_AI(hyjal_trashAI, unit->AI())->faction = Faction;
1091 ENSURE_AI(hyjal_trashAI, unit->AI())->IsOverrun = true;
1092 ENSURE_AI(hyjal_trashAI, unit->AI())->OverrunType = i;
1093 unit->setActive(true);
1094 unit->SetFarVisible(true);
1095 }
1096 }
1097 break;
1098 }
1099}
uint8_t uint8
Definition Define.h:156
uint32_t uint32
Definition Define.h:154
@ SPECIAL
#define TC_LOG_DEBUG(filterType__, message__,...)
Definition Log.h:173
@ IDLE_MOTION_TYPE
@ TEMPSUMMON_MANUAL_DESPAWN
@ TEMPSUMMON_TIMED_DESPAWN
@ TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
Spells
Definition PlayerAI.cpp:32
int32 irand(int32 min, int32 max)
Definition Random.cpp:36
uint32 rand32()
Definition Random.cpp:71
@ FACTION_FRIENDLY
EvadeReason
#define CAST_AI(a, b)
Definition UnitAI.h:29
#define ENSURE_AI(a, b)
Definition UnitAI.h:30
@ UNIT_NPC_FLAG_GOSSIP
@ UNIT_FLAG_NON_ATTACKABLE
static Position SpawnLoc[]
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
void EngagementOver()
bool LoadCreaturesAddon()
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:394
void Respawn(bool force=false)
bool isWorldBoss() const
void SetDisableReputationGain(bool disable)
Definition Creature.h:420
void SetTappedBy(Unit const *unit, bool withGroup=true)
CreatureAI * AI() const
Definition Creature.h:235
void DoUpdateWorldState(int32 worldStateId, int32 value)
virtual ObjectGuid GetGuidData(uint32 type) const override
InstanceMap * instance
GameObject * GetGameObject(ObjectGuid const &guid)
Definition Map.cpp:3588
void MoveTargetedHome()
bool IsEmpty() const
Definition ObjectGuid.h:362
void Clear()
Definition ObjectGuid.h:329
uint32 GetEntry() const
Definition Object.h:89
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:71
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:81
Definition Unit.h:647
void SetVisible(bool x)
Definition Unit.cpp:8787
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true, bool skipChanneledAllowingActions=false) const
Definition Unit.cpp:3219
void CombatStop(bool includingCast=false, bool mutualPvP=true, bool(*unitFilter)(Unit const *otherUnit)=nullptr)
Definition Unit.cpp:6031
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition Unit.cpp:3253
MotionMaster * GetMotionMaster()
Definition Unit.h:1750
bool IsAlive() const
Definition Unit.h:1205
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:1013
void SetNpcFlag(NPCFlags flags)
Definition Unit.h:1012
bool SetWalk(bool enable)
Definition Unit.cpp:13422
Unit * GetVictim() const
Definition Unit.h:738
void RemoveAllAuras()
Definition Unit.cpp:4400
Map * GetMap() const
Definition Object.h:411
InstanceScript * GetInstanceScript() const
Definition Object.cpp:394
void GetNearPoint(WorldObject const *searcher, float &x, float &y, float &z, float distance2d, float absAngle) const
Definition Object.cpp:2719
float GetGridActivationRange() const
Definition Object.cpp:769
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:1403
void setActive(bool isActiveObject)
Definition Object.cpp:274
GameObject * SummonGameObject(uint32 entry, Position const &pos, QuaternionData const &rot, Seconds respawnTime, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition Object.cpp:1446
void SetFarVisible(bool on)
Definition Object.cpp:325
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:99
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:100
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_TELEPORT_VISUAL
Definition hyjalAI.h:28
@ 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
@ FEL_STALKER
Definition hyjal.h:66
@ TYRANDE
Definition hyjal.h:70
@ BANSHEE
Definition hyjal.h:61
@ GARGOYLE
Definition hyjal.h:63
@ GIANT_INFERNAL
Definition hyjal.h:65
@ FROST_WYRM
Definition hyjal.h:64
@ ABOMINATION
Definition hyjal.h:59
@ JAINA
Definition hyjal.h:68
@ CRYPT_FIEND
Definition hyjal.h:62
@ GHOUL
Definition hyjal.h:60
@ THRALL
Definition hyjal.h:69
@ NECROMANCER
Definition hyjal.h:58
@ 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:118
@ GO_ROARING_FLAME
Definition hyjal.h:88
@ GO_ANCIENT_VEIN
Definition hyjal.h:87
@ WORLD_STATE_WAVES
Definition hyjal.h:50
@ WORLD_STATE_ENEMY
Definition hyjal.h:51
@ WORLD_STATE_ENEMYCOUNT
Definition hyjal.h:52
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:140
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:87
constexpr float GetPositionY() const
Definition Position.h:88
float GetAbsoluteAngle(float x, float y) const
Definition Position.h:136
constexpr float GetPositionZ() const
Definition Position.h:89
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:919
bool WaitForTeleport
Definition hyjalAI.h:188
void SpawnVeins()
Definition hyjalAI.cpp:647
uint32 RespawnTimer
Definition hyjalAI.h:193
void SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3])
Definition hyjalAI.cpp:538
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:588
uint8 InfernalCount
Definition hyjalAI.h:184
void WaypointReached(uint32 waypointId, uint32) override
Definition hyjalAI.cpp:926
ObjectGuid VeinGUID[14]
Definition hyjalAI.h:168
uint32 EnemyCount
Definition hyjalAI.h:174
void DeSpawnVeins()
Definition hyjalAI.cpp:675
void SummonedCreatureDespawn(Creature *summoned) override
Definition hyjalAI.cpp:380
void UpdateAI(uint32 diff) override
Definition hyjalAI.cpp:705
void Initialize()
Definition hyjalAI.cpp:340
uint32 MassTeleportTimer
Definition hyjalAI.h:197
void HideNearPos(float x, float y)
Definition hyjalAI.cpp:901
uint32 NextWaveTimer
Definition hyjalAI.h:170
bool EventBegun
Definition hyjalAI.h:177
void Retreat()
Definition hyjalAI.cpp:616
ObjectGuid PlayerGUID
Definition hyjalAI.h:166
void JustEngagedWith(Unit *who) override
Definition hyjalAI.cpp:439
uint32 GetInstanceData(uint32 Event)
Definition hyjalAI.cpp:611
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:973
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:889
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