mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 06:06:23 +00:00
Merge branch 'azerothcore:master' into Playerbot
This commit is contained in:
@@ -1692,7 +1692,7 @@ public:
|
||||
|
||||
Item* item = playerTarget->StoreNewItem(dest, itemId, true);
|
||||
|
||||
Player* p = handler->GetSession()->GetPlayer();
|
||||
Player* p = handler->GetSession() ? handler->GetSession()->GetPlayer() : nullptr;
|
||||
// remove binding (let GM give it to another player later)
|
||||
if (p && p == playerTarget)
|
||||
{
|
||||
|
||||
@@ -36,10 +36,22 @@ using namespace Acore::ChatCommands;
|
||||
class reset_commandscript : public CommandScript
|
||||
{
|
||||
public:
|
||||
|
||||
reset_commandscript() : CommandScript("reset_commandscript") { }
|
||||
|
||||
ChatCommandTable GetCommands() const override
|
||||
{
|
||||
static ChatCommandTable resetItemsCommandTable =
|
||||
{
|
||||
{ "equipped", HandleResetItemsEquippedCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "bags", HandleResetItemsInBagsCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "bank", HandleResetItemsInBankCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "keyring", HandleResetItemsKeyringCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "currency", HandleResetItemsInCurrenciesListCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "vendor_buyback", HandleResetItemsInVendorBuyBackTabCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "all", HandleResetItemsAllCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "allbags", HandleResetItemsAllAndDeleteBagsCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
};
|
||||
static ChatCommandTable resetCommandTable =
|
||||
{
|
||||
{ "achievements", HandleResetAchievementsCommand, SEC_CONSOLE, Console::Yes },
|
||||
@@ -48,6 +60,7 @@ public:
|
||||
{ "spells", HandleResetSpellsCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "stats", HandleResetStatsCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "talents", HandleResetTalentsCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "items", resetItemsCommandTable },
|
||||
{ "all", HandleResetAllCommand, SEC_CONSOLE, Console::Yes }
|
||||
};
|
||||
static ChatCommandTable commandTable =
|
||||
@@ -296,6 +309,418 @@ public:
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleResetItemsEquippedCommand(ChatHandler* handler, Optional<PlayerIdentifier> target)
|
||||
{
|
||||
Player* targetPlayer = GetPlayerFromIdentifierOrSelectedTarget(handler, target);
|
||||
|
||||
if (!targetPlayer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int16 deletedItemsCount = ResetItemsEquipped(targetPlayer);
|
||||
handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_EQUIPPED, deletedItemsCount, handler->GetNameLink(targetPlayer).c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleResetItemsInBagsCommand(ChatHandler* handler, Optional<PlayerIdentifier> target)
|
||||
{
|
||||
Player* targetPlayer = GetPlayerFromIdentifierOrSelectedTarget(handler, target);
|
||||
|
||||
if (!targetPlayer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int16 deletedItemsCount = ResetItemsInBags(targetPlayer);
|
||||
handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_BAGS, deletedItemsCount, handler->GetNameLink(targetPlayer).c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleResetItemsKeyringCommand(ChatHandler* handler, Optional<PlayerIdentifier> target)
|
||||
{
|
||||
Player* targetPlayer = GetPlayerFromIdentifierOrSelectedTarget(handler, target);
|
||||
|
||||
if (!targetPlayer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int16 deletedItemsCount = ResetItemsInKeyring(targetPlayer);
|
||||
handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_KEYRING, deletedItemsCount, handler->GetNameLink(targetPlayer).c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleResetItemsInCurrenciesListCommand(ChatHandler* handler, Optional<PlayerIdentifier> target)
|
||||
{
|
||||
Player* targetPlayer = GetPlayerFromIdentifierOrSelectedTarget(handler, target);
|
||||
|
||||
if (!targetPlayer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int16 deletedItemsCount = ResetItemsInCurrenciesList(targetPlayer);
|
||||
handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_CURRENCY, deletedItemsCount, handler->GetNameLink(targetPlayer).c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleResetItemsInBankCommand(ChatHandler* handler, Optional<PlayerIdentifier> target)
|
||||
{
|
||||
Player* targetPlayer = GetPlayerFromIdentifierOrSelectedTarget(handler, target);
|
||||
|
||||
if (!targetPlayer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int16 deletedItemsCount = ResetItemsInBank(targetPlayer);
|
||||
handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_BANK, deletedItemsCount, handler->GetNameLink(targetPlayer).c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleResetItemsInVendorBuyBackTabCommand(ChatHandler* handler, Optional<PlayerIdentifier> target)
|
||||
{
|
||||
Player* targetPlayer = GetPlayerFromIdentifierOrSelectedTarget(handler, target);
|
||||
|
||||
if (!targetPlayer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int16 deletedItemsCount = ResetItemsInVendorBuyBackTab(targetPlayer);
|
||||
handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_BUYBACK, deletedItemsCount, handler->GetNameLink(targetPlayer).c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleResetItemsAllCommand(ChatHandler* handler, Optional<PlayerIdentifier> target)
|
||||
{
|
||||
Player* targetPlayer = GetPlayerFromIdentifierOrSelectedTarget(handler, target);
|
||||
|
||||
if (!targetPlayer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// Delete all items destinations
|
||||
int16 deletedItemsEquippedCount = ResetItemsEquipped(targetPlayer);
|
||||
int16 deletedItemsInBagsCount = ResetItemsInBags(targetPlayer);
|
||||
int16 deletedItemsInBankCount = ResetItemsInBank(targetPlayer);
|
||||
int16 deletedItemsInKeyringCount = ResetItemsInKeyring(targetPlayer);
|
||||
int16 deletedItemsInCurrenciesListCount = ResetItemsInCurrenciesList(targetPlayer);
|
||||
int16 deletedItemsInVendorBuyBackTabCount = ResetItemsInVendorBuyBackTab(targetPlayer);
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_ALL, handler->GetNameLink(targetPlayer).c_str(),
|
||||
deletedItemsEquippedCount,
|
||||
deletedItemsInBagsCount,
|
||||
deletedItemsInBankCount,
|
||||
deletedItemsInKeyringCount,
|
||||
deletedItemsInCurrenciesListCount,
|
||||
deletedItemsInVendorBuyBackTabCount);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleResetItemsAllAndDeleteBagsCommand(ChatHandler* handler, Optional<PlayerIdentifier> target)
|
||||
{
|
||||
Player* targetPlayer = GetPlayerFromIdentifierOrSelectedTarget(handler, target);
|
||||
|
||||
if (!targetPlayer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// Delete all items destinations
|
||||
int16 deletedItemsEquippedCount = ResetItemsEquipped(targetPlayer);
|
||||
int16 deletedItemsInBagsCount = ResetItemsInBags(targetPlayer);
|
||||
int16 deletedItemsInBankCount = ResetItemsInBank(targetPlayer);
|
||||
int16 deletedItemsInKeyringCount = ResetItemsInKeyring(targetPlayer);
|
||||
int16 deletedItemsInCurrenciesListCount = ResetItemsInCurrenciesList(targetPlayer);
|
||||
int16 deletedItemsInVendorBuyBackTabCount = ResetItemsInVendorBuyBackTab(targetPlayer);
|
||||
int16 deletedItemsStandardBagsCount = ResetItemsDeleteStandardBags(targetPlayer);
|
||||
int16 deletedItemsBankBagsCount = ResetItemsDeleteBankBags(targetPlayer);
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_ALL_BAGS, handler->GetNameLink(targetPlayer).c_str(),
|
||||
deletedItemsEquippedCount,
|
||||
deletedItemsInBagsCount,
|
||||
deletedItemsInBankCount,
|
||||
deletedItemsInKeyringCount,
|
||||
deletedItemsInCurrenciesListCount,
|
||||
deletedItemsInVendorBuyBackTabCount,
|
||||
deletedItemsStandardBagsCount,
|
||||
deletedItemsBankBagsCount);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
static Player* GetPlayerFromIdentifierOrSelectedTarget(ChatHandler* handler, Optional<PlayerIdentifier> target)
|
||||
{
|
||||
Player* targetPlayer = nullptr;
|
||||
|
||||
// Check if there is an optional target player name
|
||||
// Do not use TargetOrSelf, we must be sure to select ourself
|
||||
if (!target)
|
||||
{
|
||||
// No optional target, so try to get selected target
|
||||
target = PlayerIdentifier::FromTarget(handler);
|
||||
|
||||
if (!target)
|
||||
{
|
||||
// No character selected
|
||||
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
return targetPlayer;
|
||||
}
|
||||
|
||||
targetPlayer = target->GetConnectedPlayer();
|
||||
}
|
||||
else
|
||||
{
|
||||
targetPlayer = target->GetConnectedPlayer();
|
||||
|
||||
if (!targetPlayer || !target->IsConnected())
|
||||
{
|
||||
// No character selected
|
||||
handler->SendSysMessage(LANG_PLAYER_NOT_EXIST_OR_OFFLINE);
|
||||
}
|
||||
}
|
||||
|
||||
return targetPlayer;
|
||||
}
|
||||
|
||||
static int16 ResetItemsEquipped(Player* playerTarget)
|
||||
{
|
||||
if (!playerTarget)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int16 count = 0;
|
||||
for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i)
|
||||
{
|
||||
Item* pItem = playerTarget->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
|
||||
if (pItem)
|
||||
{
|
||||
playerTarget->DestroyItem(INVENTORY_SLOT_BAG_0, i, true);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static int16 ResetItemsInBags(Player* playerTarget)
|
||||
{
|
||||
if (!playerTarget)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int16 count = 0;
|
||||
// Default bagpack :
|
||||
for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i)
|
||||
{
|
||||
Item* pItem = playerTarget->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
|
||||
if (pItem)
|
||||
{
|
||||
playerTarget->DestroyItem(INVENTORY_SLOT_BAG_0, i, true);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
// Bag slots
|
||||
for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||
{
|
||||
Bag* pBag = (Bag*)playerTarget->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
|
||||
if (pBag)
|
||||
{
|
||||
for (uint8 j = 0; j < pBag->GetBagSize(); ++j)
|
||||
{
|
||||
Item* pItem = pBag->GetItemByPos(j);
|
||||
if (pItem)
|
||||
{
|
||||
playerTarget->DestroyItem(i, j, true);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static int16 ResetItemsInBank(Player* playerTarget)
|
||||
{
|
||||
if (!playerTarget)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int16 count = 0;
|
||||
// Normal bank slot
|
||||
for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i)
|
||||
{
|
||||
Item* pItem = playerTarget->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
|
||||
if (pItem)
|
||||
{
|
||||
playerTarget->DestroyItem(INVENTORY_SLOT_BAG_0, i, true);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
// Bank bagslots
|
||||
for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i)
|
||||
{
|
||||
Bag* pBag = (Bag*)playerTarget->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
|
||||
if (pBag)
|
||||
{
|
||||
for (uint8 j = 0; j < pBag->GetBagSize(); ++j)
|
||||
{
|
||||
Item* pItem = pBag->GetItemByPos(j);
|
||||
if (pItem)
|
||||
{
|
||||
playerTarget->DestroyItem(i, j, true);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static int16 ResetItemsInKeyring(Player* playerTarget)
|
||||
{
|
||||
if (!playerTarget)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int16 count = 0;
|
||||
for (uint8 i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; ++i)
|
||||
{
|
||||
Item* pItem = playerTarget->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
|
||||
if (pItem)
|
||||
{
|
||||
playerTarget->DestroyItem(INVENTORY_SLOT_BAG_0, i, true);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static int16 ResetItemsInCurrenciesList(Player* playerTarget)
|
||||
{
|
||||
if (!playerTarget)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int16 count = 0;
|
||||
for (uint8 i = CURRENCYTOKEN_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i)
|
||||
{
|
||||
Item* pItem = playerTarget->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
|
||||
if (pItem)
|
||||
{
|
||||
playerTarget->DestroyItem(INVENTORY_SLOT_BAG_0, i, true);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static int16 ResetItemsInVendorBuyBackTab(Player* playerTarget)
|
||||
{
|
||||
if (!playerTarget)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int16 count = 0;
|
||||
for (uint8 i = BUYBACK_SLOT_START; i < BUYBACK_SLOT_END; ++i)
|
||||
{
|
||||
Item* pItem = playerTarget->GetItemFromBuyBackSlot(i);
|
||||
if (pItem)
|
||||
{
|
||||
playerTarget->RemoveItemFromBuyBackSlot(i, true);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static int16 ResetItemsDeleteStandardBags(Player* playerTarget)
|
||||
{
|
||||
if (!playerTarget)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int16 count = 0;
|
||||
// Standard bag slots
|
||||
for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||
{
|
||||
Bag* pBag = (Bag*)playerTarget->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
|
||||
if (pBag)
|
||||
{
|
||||
playerTarget->DestroyItem(INVENTORY_SLOT_BAG_0, i, true);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static int16 ResetItemsDeleteBankBags(Player* playerTarget)
|
||||
{
|
||||
if (!playerTarget)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int16 count = 0;
|
||||
// Bank bags
|
||||
for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i)
|
||||
{
|
||||
Bag* pBag = (Bag*)playerTarget->GetItemByPos(INVENTORY_SLOT_BAG_0, i);
|
||||
if (pBag)
|
||||
{
|
||||
// prevent no empty ?
|
||||
playerTarget->DestroyItem(INVENTORY_SLOT_BAG_0, i, true);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_reset_commandscript()
|
||||
|
||||
@@ -829,7 +829,6 @@ public:
|
||||
if (Group* EventGroup = player->GetGroup())
|
||||
{
|
||||
uint8 GroupMemberCount = 0;
|
||||
uint8 DeadMemberCount = 0;
|
||||
uint8 FailedMemberCount = 0;
|
||||
|
||||
Group::MemberSlotList const& members = EventGroup->GetMemberSlots();
|
||||
@@ -845,9 +844,6 @@ public:
|
||||
++FailedMemberCount;
|
||||
}
|
||||
++GroupMemberCount;
|
||||
|
||||
if (groupMember->isDead())
|
||||
++DeadMemberCount;
|
||||
}
|
||||
|
||||
if (GroupMemberCount == FailedMemberCount || !player->IsWithinDistInMap(me, EVENT_AREA_RADIUS))
|
||||
|
||||
@@ -94,6 +94,10 @@ struct boss_alar : public BossAI
|
||||
boss_alar(Creature* creature) : BossAI(creature, DATA_ALAR)
|
||||
{
|
||||
me->SetCombatMovement(false);
|
||||
scheduler.SetValidator([this]
|
||||
{
|
||||
return !me->HasUnitState(UNIT_STATE_CASTING);
|
||||
});
|
||||
}
|
||||
|
||||
void JustReachedHome() override
|
||||
@@ -111,6 +115,8 @@ struct boss_alar : public BossAI
|
||||
_canAttackCooldown = true;
|
||||
_baseAttackOverride = false;
|
||||
_spawnPhoenixes = false;
|
||||
_hasPretendedToDie = false;
|
||||
_transitionScheduler.CancelAll();
|
||||
_platform = 0;
|
||||
_noMelee = false;
|
||||
_platformRoll = 0;
|
||||
@@ -177,30 +183,34 @@ struct boss_alar : public BossAI
|
||||
if (damage >= me->GetHealth() && _platform < POINT_MIDDLE)
|
||||
{
|
||||
damage = 0;
|
||||
DoCastSelf(SPELL_EMBER_BLAST, true);
|
||||
PretendToDie(me);
|
||||
ScheduleUniqueTimedEvent(1s, [&]{
|
||||
me->SetVisible(false);
|
||||
}, EVENT_INVISIBLE);
|
||||
ScheduleUniqueTimedEvent(8s, [&]{
|
||||
me->SetPosition(alarPoints[POINT_MIDDLE]);
|
||||
}, EVENT_RELOCATE_MIDDLE);
|
||||
ScheduleUniqueTimedEvent(12s, [&]
|
||||
if (!_hasPretendedToDie)
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->SetVisible(true);
|
||||
DoCastSelf(SPELL_CLEAR_ALL_DEBUFFS, true);
|
||||
DoCastSelf(SPELL_REBIRTH_PHASE2);
|
||||
}, EVENT_MOVE_TO_PHASE_2);
|
||||
ScheduleUniqueTimedEvent(16001ms, [&]{
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
_noMelee = false;
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
_platform = POINT_MIDDLE;
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
ScheduleAbilities();
|
||||
}, EVENT_REBIRTH);
|
||||
_hasPretendedToDie = true;
|
||||
DoCastSelf(SPELL_EMBER_BLAST, true);
|
||||
PretendToDie(me);
|
||||
_transitionScheduler.Schedule(1s, [this](TaskContext)
|
||||
{
|
||||
me->SetVisible(false);
|
||||
}).Schedule(8s, [this](TaskContext)
|
||||
{
|
||||
me->SetPosition(alarPoints[POINT_MIDDLE]);
|
||||
}).Schedule(12s, [this](TaskContext)
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->SetVisible(true);
|
||||
DoCastSelf(SPELL_CLEAR_ALL_DEBUFFS, true);
|
||||
DoCastSelf(SPELL_REBIRTH_PHASE2);
|
||||
}).Schedule(16001ms, [this](TaskContext)
|
||||
{
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
_noMelee = false;
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
_platform = POINT_MIDDLE;
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
ScheduleAbilities();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,6 +229,7 @@ struct boss_alar : public BossAI
|
||||
|
||||
void ScheduleAbilities()
|
||||
{
|
||||
_transitionScheduler.CancelAll();
|
||||
ScheduleTimedEvent(57s, [&]
|
||||
{
|
||||
DoCastVictim(SPELL_MELT_ARMOR);
|
||||
@@ -264,7 +275,7 @@ struct boss_alar : public BossAI
|
||||
_noMelee = true;
|
||||
scheduler.Schedule(2s, [this](TaskContext)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 10.0f, true))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 110.0f, true))
|
||||
{
|
||||
SpawnPhoenixes(2, target);
|
||||
}
|
||||
@@ -352,6 +363,8 @@ struct boss_alar : public BossAI
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_transitionScheduler.Update(diff);
|
||||
|
||||
if (!UpdateVictim())
|
||||
{
|
||||
return;
|
||||
@@ -401,6 +414,7 @@ struct boss_alar : public BossAI
|
||||
}
|
||||
|
||||
private:
|
||||
bool _hasPretendedToDie;
|
||||
bool _canAttackCooldown;
|
||||
bool _baseAttackOverride;
|
||||
bool _spawnPhoenixes;
|
||||
@@ -409,6 +423,7 @@ private:
|
||||
uint8 _platformRoll;
|
||||
uint8 _noQuillTimes;
|
||||
std::chrono::seconds _platformMoveRepeatTimer;
|
||||
TaskScheduler _transitionScheduler;
|
||||
};
|
||||
|
||||
class CastQuill : public BasicEvent
|
||||
|
||||
@@ -36,7 +36,8 @@ enum Spells
|
||||
SPELL_WRATH_OF_THE_ASTROMANCER = 42783,
|
||||
SPELL_BLINDING_LIGHT = 33009,
|
||||
SPELL_PSYCHIC_SCREAM = 34322,
|
||||
SPELL_VOID_BOLT = 39329
|
||||
SPELL_VOID_BOLT = 39329,
|
||||
SPELL_TRUE_BEAM = 33365,
|
||||
};
|
||||
|
||||
enum Misc
|
||||
@@ -122,7 +123,7 @@ struct boss_high_astromancer_solarian : public BossAI
|
||||
scheduler.Schedule(3650ms, [this](TaskContext context)
|
||||
{
|
||||
me->GetMotionMaster()->Clear();
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true, true, -SPELL_WRATH_OF_THE_ASTROMANCER))
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, false, true, -SPELL_WRATH_OF_THE_ASTROMANCER))
|
||||
{
|
||||
DoCast(target, SPELL_ARCANE_MISSILES);
|
||||
}
|
||||
@@ -145,6 +146,7 @@ struct boss_high_astromancer_solarian : public BossAI
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
Talk(SAY_SUMMON);
|
||||
me->RemoveAllAuras();
|
||||
me->SetModelVisible(false);
|
||||
scheduler.DelayAll(21s);
|
||||
scheduler.Schedule(6s, [this](TaskContext)
|
||||
@@ -157,6 +159,7 @@ struct boss_high_astromancer_solarian : public BossAI
|
||||
{
|
||||
if (light->GetDistance2d(CENTER_X, CENTER_Y) < 20.0f)
|
||||
{
|
||||
DoCast(light, SPELL_TRUE_BEAM);
|
||||
me->SetPosition(*light);
|
||||
me->StopMovingOnCurrentPos();
|
||||
}
|
||||
@@ -179,6 +182,7 @@ struct boss_high_astromancer_solarian : public BossAI
|
||||
light->RemoveAllAuras();
|
||||
if (light->GetDistance2d(CENTER_X, CENTER_Y) < 20.0f)
|
||||
{
|
||||
me->RemoveAllAuras();
|
||||
me->SetModelVisible(true);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1159,7 +1159,10 @@ class spell_kaelthas_mind_control : public SpellScript
|
||||
void SelectTarget(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (Unit* victim = GetCaster()->GetVictim())
|
||||
{
|
||||
targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true));
|
||||
}
|
||||
targets.remove_if(Acore::ObjectTypeIdCheck(TYPEID_PLAYER, false));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
Reference in New Issue
Block a user