This reverts commit 348b374487.
This commit is contained in:
@@ -662,10 +662,7 @@ enum BG_AV_CreaturePlace
|
|||||||
AV_CPLACE_TRIGGER18 = 319,
|
AV_CPLACE_TRIGGER18 = 319,
|
||||||
AV_CPLACE_TRIGGER19 = 320,
|
AV_CPLACE_TRIGGER19 = 320,
|
||||||
|
|
||||||
AV_CPLACE_MAX = 321,
|
AV_CPLACE_MAX = 321
|
||||||
|
|
||||||
AV_CPLACE_A_BOSS = 381,
|
|
||||||
AV_CPLACE_H_BOSS = 445
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//x, y, z, o
|
//x, y, z, o
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "BattlegroundAV.h"
|
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
#include "ScriptedCreature.h"
|
#include "ScriptedCreature.h"
|
||||||
|
|
||||||
@@ -59,11 +58,6 @@ enum Events
|
|||||||
EVENT_CHECK_RESET = 6
|
EVENT_CHECK_RESET = 6
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Factions
|
|
||||||
{
|
|
||||||
FACTION_AV_ALLIANCE = 1534
|
|
||||||
};
|
|
||||||
|
|
||||||
struct SpellPair
|
struct SpellPair
|
||||||
{
|
{
|
||||||
uint32 npcEntry;
|
uint32 npcEntry;
|
||||||
@@ -110,46 +104,6 @@ public:
|
|||||||
Reset();
|
Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttackStart(Unit* victim) override
|
|
||||||
{
|
|
||||||
ScriptedAI::AttackStart(victim);
|
|
||||||
|
|
||||||
// Boss should attack as well
|
|
||||||
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
|
|
||||||
{
|
|
||||||
if (Battleground* bg = bgMap->GetBG())
|
|
||||||
{
|
|
||||||
if (Creature* mainBoss = bg->GetBGCreature((me->GetFaction() == FACTION_AV_ALLIANCE ? AV_CPLACE_A_BOSS : AV_CPLACE_H_BOSS)))
|
|
||||||
{
|
|
||||||
if (mainBoss->IsAIEnabled && !mainBoss->IsInCombat())
|
|
||||||
{
|
|
||||||
mainBoss->AI()->AttackStart(victim);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void EnterEvadeMode() override
|
|
||||||
{
|
|
||||||
ScriptedAI::EnterEvadeMode();
|
|
||||||
|
|
||||||
// Evade boss
|
|
||||||
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
|
|
||||||
{
|
|
||||||
if (Battleground* bg = bgMap->GetBG())
|
|
||||||
{
|
|
||||||
if (Creature* mainBoss = bg->GetBGCreature((me->GetFaction() == FACTION_AV_ALLIANCE ? AV_CPLACE_A_BOSS : AV_CPLACE_H_BOSS)))
|
|
||||||
{
|
|
||||||
if (mainBoss->IsAIEnabled && !mainBoss->IsInEvadeMode())
|
|
||||||
{
|
|
||||||
mainBoss->AI()->EnterEvadeMode();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
void UpdateAI(uint32 diff) override
|
||||||
{
|
{
|
||||||
// I have a feeling this isn't blizzlike, but owell, I'm only passing by and cleaning up.
|
// I have a feeling this isn't blizzlike, but owell, I'm only passing by and cleaning up.
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "BattlegroundAV.h"
|
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
#include "ScriptedCreature.h"
|
#include "ScriptedCreature.h"
|
||||||
|
|
||||||
@@ -65,7 +64,7 @@ public:
|
|||||||
YellTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS); //20 to 30 seconds
|
YellTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS); //20 to 30 seconds
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnterCombat(Unit* /*victim*/) override
|
void EnterCombat(Unit* /*who*/) override
|
||||||
{
|
{
|
||||||
Talk(YELL_AGGRO);
|
Talk(YELL_AGGRO);
|
||||||
}
|
}
|
||||||
@@ -76,52 +75,6 @@ public:
|
|||||||
Talk(YELL_RESPAWN);
|
Talk(YELL_RESPAWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttackStart(Unit* victim) override
|
|
||||||
{
|
|
||||||
ScriptedAI::AttackStart(victim);
|
|
||||||
|
|
||||||
// Mini bosses should attack as well
|
|
||||||
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
|
|
||||||
{
|
|
||||||
if (Battleground* bg = bgMap->GetBG())
|
|
||||||
{
|
|
||||||
for (uint8 i = AV_CPLACE_H_MARSHAL_ICE; i <= AV_CPLACE_H_MARSHAL_WTOWER; ++i)
|
|
||||||
{
|
|
||||||
if (Creature* marshall = bg->GetBGCreature(i))
|
|
||||||
{
|
|
||||||
if (marshall->IsAIEnabled && !marshall->IsInCombat())
|
|
||||||
{
|
|
||||||
marshall->AI()->AttackStart(victim);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void EnterEvadeMode() override
|
|
||||||
{
|
|
||||||
ScriptedAI::EnterEvadeMode();
|
|
||||||
|
|
||||||
// Evade mini bosses
|
|
||||||
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
|
|
||||||
{
|
|
||||||
if (Battleground* bg = bgMap->GetBG())
|
|
||||||
{
|
|
||||||
for (uint8 i = AV_CPLACE_H_MARSHAL_ICE; i <= AV_CPLACE_H_MARSHAL_WTOWER; ++i)
|
|
||||||
{
|
|
||||||
if (Creature* marshall = bg->GetBGCreature(i))
|
|
||||||
{
|
|
||||||
if (marshall->IsAIEnabled && !marshall->IsInEvadeMode())
|
|
||||||
{
|
|
||||||
marshall->AI()->EnterEvadeMode();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
void UpdateAI(uint32 diff) override
|
||||||
{
|
{
|
||||||
if (!UpdateVictim())
|
if (!UpdateVictim())
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "BattlegroundAV.h"
|
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
#include "ScriptedCreature.h"
|
#include "ScriptedCreature.h"
|
||||||
|
|
||||||
@@ -60,57 +59,11 @@ public:
|
|||||||
YellTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS);
|
YellTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnterCombat(Unit* /*victim*/) override
|
void EnterCombat(Unit* /*who*/) override
|
||||||
{
|
{
|
||||||
Talk(YELL_AGGRO);
|
Talk(YELL_AGGRO);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttackStart(Unit* victim) override
|
|
||||||
{
|
|
||||||
ScriptedAI::AttackStart(victim);
|
|
||||||
|
|
||||||
// Mini bosses should attack as well
|
|
||||||
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
|
|
||||||
{
|
|
||||||
if (Battleground* bg = bgMap->GetBG())
|
|
||||||
{
|
|
||||||
for (uint8 i = AV_CPLACE_A_MARSHAL_SOUTH; i <= AV_CPLACE_A_MARSHAL_STONE; ++i)
|
|
||||||
{
|
|
||||||
if (Creature* marshall = bg->GetBGCreature(i))
|
|
||||||
{
|
|
||||||
if (marshall->IsAIEnabled && !marshall->IsInCombat())
|
|
||||||
{
|
|
||||||
marshall->AI()->AttackStart(victim);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void EnterEvadeMode() override
|
|
||||||
{
|
|
||||||
ScriptedAI::EnterEvadeMode();
|
|
||||||
|
|
||||||
// Evade mini bosses
|
|
||||||
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
|
|
||||||
{
|
|
||||||
if (Battleground* bg = bgMap->GetBG())
|
|
||||||
{
|
|
||||||
for (uint8 i = AV_CPLACE_A_MARSHAL_SOUTH; i <= AV_CPLACE_A_MARSHAL_STONE; ++i)
|
|
||||||
{
|
|
||||||
if (Creature* marshall = bg->GetBGCreature(i))
|
|
||||||
{
|
|
||||||
if (marshall->IsAIEnabled && !marshall->IsInEvadeMode())
|
|
||||||
{
|
|
||||||
marshall->AI()->EnterEvadeMode();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
void UpdateAI(uint32 diff) override
|
||||||
{
|
{
|
||||||
if (!UpdateVictim())
|
if (!UpdateVictim())
|
||||||
|
|||||||
Reference in New Issue
Block a user