mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
Over 100 camangos Cata commits applied (to c12950)
Over 100 camangos Cata commits applied. up to and inclusing c12950.
This commit is contained in:
parent
b4ec0440aa
commit
eef77eadb9
117 changed files with 4314 additions and 3547 deletions
|
|
@ -177,15 +177,15 @@ Commands and their parameters
|
||||||
|
|
||||||
TemporaryFactionFlags
|
TemporaryFactionFlags
|
||||||
---------------------
|
---------------------
|
||||||
* `TEMPFACTION_NONE`: 0x00, when no flag is used in temporary faction change, faction will be persistent. It will then require manual change back to default/another faction when changed once
|
* `TEMPFACTION_NONE` = 0x00, // When no flag is used in temporary faction change, faction will be persistent. It will then require manual change back to default/another faction when changed once
|
||||||
* `TEMPFACTION_RESTORE_RESPAWN`: 0x01, default faction will be restored at respawn
|
* `TEMPFACTION_RESTORE_RESPAWN` = 0x01, // Default faction will be restored at respawn
|
||||||
* `TEMPFACTION_RESTORE_COMBAT_STOP`: 0x02, ... at CombatStop() (happens at creature death, at evade or custom script among others)
|
* `TEMPFACTION_RESTORE_COMBAT_STOP` = 0x02, // ... at CombatStop() (happens at creature death, at evade or custom scripte among others)
|
||||||
* `TEMPFACTION_RESTORE_REACH_HOME`: 0x04, ... at reaching home in home movement (evade), if not already done at CombatStop()
|
* `TEMPFACTION_RESTORE_REACH_HOME` = 0x04, // ... at reaching home in home movement (evade), if not already done at CombatStop()
|
||||||
|
|
||||||
The next flags allow to remove unit_flags combined with a faction change (also these flags will be reapplied when the faction is changed back)
|
// The next flags allow to remove unit_flags combined with a faction change (also these flags will be reapplied when the faction is changed back)
|
||||||
|
|
||||||
* `TEMPFACTION_TOGGLE_NON_ATTACKABLE`: 0x08, remove UNIT_FLAG_NON_ATTACKABLE(0x02) when faction is changed (reapply when temp-faction is removed)
|
* `TEMPFACTION_TOGGLE_NON_ATTACKABLE` = 0x08, // Remove UNIT_FLAG_NON_ATTACKABLE(0x02) when faction is changed (reapply when temp-faction is removed)
|
||||||
* `TEMPFACTION_TOGGLE_OOC_NOT_ATTACK`: 0x10, remove UNIT_FLAG_OOC_NOT_ATTACKABLE(0x100) when faction is changed (reapply when temp-faction is removed)
|
* `TEMPFACTION_TOGGLE_OOC_NOT_ATTACK` = 0x10, // Remove UNIT_FLAG_OOC_NOT_ATTACKABLE(0x100) when faction is changed (reapply when temp-faction is removed)
|
||||||
* `TEMPFACTION_TOGGLE_PASSIVE` : 0x20, remove UNIT_FLAG_PASSIVE(0x200)
|
* `TEMPFACTION_TOGGLE_PASSIVE` = 0x20, // Remove UNIT_FLAG_PASSIVE(0x200) when faction is changed (reapply when temp-faction is removed)
|
||||||
* `TEMPFACTION_TOGGLE_PACIFIED` : 0x40, remove UNIT_FLAG_PACIFIED(0x20000) when faction is changed (reapply when temp-faction is removed)
|
* `TEMPFACTION_TOGGLE_PACIFIED` = 0x40, // Remove UNIT_FLAG_PACIFIED(0x20000) when faction is changed (reapply when temp-faction is removed)
|
||||||
* `TEMPFACTION_TOGGLE_NOT_SELECTABLE`: 0x80, remove UNIT_FLAG_NOT_SELECTABLE(0x2000000) when faction is changed (reapply when temp-faction is removed)
|
* `TEMPFACTION_TOGGLE_NOT_SELECTABLE` = 0x80, // Remove UNIT_FLAG_NOT_SELECTABLE(0x2000000) when faction is changed (reapply when temp-faction is removed)
|
||||||
|
|
@ -694,7 +694,7 @@ uint32 AuctionBotBuyer::GetBuyableEntry(AHB_Buyer_Config& config)
|
||||||
{
|
{
|
||||||
config.SameItemInfo.clear();
|
config.SameItemInfo.clear();
|
||||||
uint32 count = 0;
|
uint32 count = 0;
|
||||||
time_t Now = time(NULL);
|
time_t Now = time(nullptr);
|
||||||
|
|
||||||
AuctionHouseObject::AuctionEntryMapBounds bounds = sAuctionMgr.GetAuctionsMap(config.GetHouseType())->GetAuctionsBounds();
|
AuctionHouseObject::AuctionEntryMapBounds bounds = sAuctionMgr.GetAuctionsMap(config.GetHouseType())->GetAuctionsBounds();
|
||||||
for (AuctionHouseObject::AuctionEntryMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
|
for (AuctionHouseObject::AuctionEntryMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
|
||||||
|
|
@ -706,20 +706,21 @@ uint32 AuctionBotBuyer::GetBuyableEntry(AHB_Buyer_Config& config)
|
||||||
ItemPrototype const* prototype = item->GetProto();
|
ItemPrototype const* prototype = item->GetProto();
|
||||||
if (prototype)
|
if (prototype)
|
||||||
{
|
{
|
||||||
++config.SameItemInfo[item->GetEntry()].ItemCount; // Structure constructor will make sure Element are correctly initialised if entry is created here.
|
BuyerItemInfo& buyerItem = config.SameItemInfo[item->GetEntry()]; // Structure constructor will make sure Element are correctly initialised if entry is created here.
|
||||||
config.SameItemInfo[item->GetEntry()].BuyPrice = config.SameItemInfo[item->GetEntry()].BuyPrice + (itr->second->buyout / item->GetCount());
|
++buyerItem.ItemCount;
|
||||||
config.SameItemInfo[item->GetEntry()].BidPrice = config.SameItemInfo[item->GetEntry()].BidPrice + (itr->second->startbid / item->GetCount());
|
buyerItem.BuyPrice = buyerItem.BuyPrice + (Aentry->buyout / item->GetCount());
|
||||||
if (itr->second->buyout != 0)
|
buyerItem.BidPrice = buyerItem.BidPrice + (Aentry->startbid / item->GetCount());
|
||||||
|
if (Aentry->buyout != 0)
|
||||||
{
|
{
|
||||||
if (itr->second->buyout / item->GetCount() < config.SameItemInfo[item->GetEntry()].MinBuyPrice)
|
if (Aentry->buyout / item->GetCount() < buyerItem.MinBuyPrice)
|
||||||
config.SameItemInfo[item->GetEntry()].MinBuyPrice = itr->second->buyout / item->GetCount();
|
buyerItem.MinBuyPrice = Aentry->buyout / item->GetCount();
|
||||||
else if (config.SameItemInfo[item->GetEntry()].MinBuyPrice == 0)
|
else if (buyerItem.MinBuyPrice == 0)
|
||||||
config.SameItemInfo[item->GetEntry()].MinBuyPrice = itr->second->buyout / item->GetCount();
|
buyerItem.MinBuyPrice = Aentry->buyout / item->GetCount();
|
||||||
}
|
}
|
||||||
if (itr->second->startbid / item->GetCount() < config.SameItemInfo[item->GetEntry()].MinBidPrice)
|
if (Aentry->startbid / item->GetCount() < buyerItem.MinBidPrice)
|
||||||
config.SameItemInfo[item->GetEntry()].MinBidPrice = itr->second->startbid / item->GetCount();
|
buyerItem.MinBidPrice = Aentry->startbid / item->GetCount();
|
||||||
else if (config.SameItemInfo[item->GetEntry()].MinBidPrice == 0)
|
else if (buyerItem.MinBidPrice == 0)
|
||||||
config.SameItemInfo[item->GetEntry()].MinBidPrice = itr->second->startbid / item->GetCount();
|
buyerItem.MinBidPrice = Aentry->startbid / item->GetCount();
|
||||||
|
|
||||||
if (!Aentry->owner)
|
if (!Aentry->owner)
|
||||||
{
|
{
|
||||||
|
|
@ -898,7 +899,7 @@ void AuctionBotBuyer::addNewAuctionBuyerBotBid(AHB_Buyer_Config& config)
|
||||||
|
|
||||||
PrepareListOfEntry(config);
|
PrepareListOfEntry(config);
|
||||||
|
|
||||||
time_t Now = time(NULL);
|
time_t Now = time(nullptr);
|
||||||
uint32 BuyCycles;
|
uint32 BuyCycles;
|
||||||
if (config.CheckedEntry.size() > sAuctionBotConfig.GetItemPerCycleBoost())
|
if (config.CheckedEntry.size() > sAuctionBotConfig.GetItemPerCycleBoost())
|
||||||
{
|
{
|
||||||
|
|
@ -906,21 +907,22 @@ void AuctionBotBuyer::addNewAuctionBuyerBotBid(AHB_Buyer_Config& config)
|
||||||
BASIC_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Boost value used for Buyer! (if this happens often adjust both ItemsPerCycle in ahbot.conf)");
|
BASIC_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Boost value used for Buyer! (if this happens often adjust both ItemsPerCycle in ahbot.conf)");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ BuyCycles = sAuctionBotConfig.GetItemPerCycleNormal(); }
|
BuyCycles = sAuctionBotConfig.GetItemPerCycleNormal();
|
||||||
|
|
||||||
for (CheckEntryMap::iterator itr = config.CheckedEntry.begin(); itr != config.CheckedEntry.end();)
|
for (CheckEntryMap::iterator itr = config.CheckedEntry.begin(); itr != config.CheckedEntry.end();)
|
||||||
{
|
{
|
||||||
AuctionEntry* auction = auctionHouse->GetAuction(itr->second.AuctionId);
|
BuyerAuctionEval& auctionEval = itr->second;
|
||||||
|
AuctionEntry* auction = auctionHouse->GetAuction(auctionEval.AuctionId);
|
||||||
if (!auction || auction->moneyDeliveryTime) // is auction not active now
|
if (!auction || auction->moneyDeliveryTime) // is auction not active now
|
||||||
{
|
{
|
||||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Entry %u on ah %u doesn't exists, perhaps bought already?",
|
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Entry %u on ah %u doesn't exists, perhaps bought already?",
|
||||||
itr->second.AuctionId, auction->GetHouseId());
|
auctionEval.AuctionId, auction->GetHouseId());
|
||||||
|
|
||||||
config.CheckedEntry.erase(itr++);
|
config.CheckedEntry.erase(itr++);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((itr->second.LastChecked != 0) && ((Now - itr->second.LastChecked) <= m_CheckInterval))
|
if ((auctionEval.LastChecked != 0) && ((Now - auctionEval.LastChecked) <= m_CheckInterval))
|
||||||
{
|
{
|
||||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: In time interval wait for entry %u!", auction->Id);
|
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: In time interval wait for entry %u!", auction->Id);
|
||||||
++itr;
|
++itr;
|
||||||
|
|
@ -928,7 +930,7 @@ void AuctionBotBuyer::addNewAuctionBuyerBotBid(AHB_Buyer_Config& config)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BuyCycles == 0)
|
if (BuyCycles == 0)
|
||||||
{ break; }
|
break;
|
||||||
|
|
||||||
uint32 MaxChance = 5000;
|
uint32 MaxChance = 5000;
|
||||||
|
|
||||||
|
|
@ -945,11 +947,10 @@ void AuctionBotBuyer::addNewAuctionBuyerBotBid(AHB_Buyer_Config& config)
|
||||||
BasePrice *= item->GetCount();
|
BasePrice *= item->GetCount();
|
||||||
|
|
||||||
double MaxBuyablePrice = (BasePrice * config.BuyerPriceRatio) / 100;
|
double MaxBuyablePrice = (BasePrice * config.BuyerPriceRatio) / 100;
|
||||||
BuyerItemInfoMap::iterator sameitem_itr = config.SameItemInfo.find(item->GetEntry());
|
uint32 buyoutPrice = auction->buyout / item->GetCount();
|
||||||
uint64 buyoutPrice = auction->buyout / item->GetCount();
|
uint32 bidPrice;
|
||||||
|
uint32 bidPriceByItem;
|
||||||
|
|
||||||
uint64 bidPrice;
|
|
||||||
uint64 bidPriceByItem;
|
|
||||||
if (auction->bid >= auction->startbid)
|
if (auction->bid >= auction->startbid)
|
||||||
{
|
{
|
||||||
bidPrice = auction->GetAuctionOutBid();
|
bidPrice = auction->GetAuctionOutBid();
|
||||||
|
|
@ -963,26 +964,38 @@ void AuctionBotBuyer::addNewAuctionBuyerBotBid(AHB_Buyer_Config& config)
|
||||||
|
|
||||||
double InGame_BuyPrice;
|
double InGame_BuyPrice;
|
||||||
double InGame_BidPrice;
|
double InGame_BidPrice;
|
||||||
|
uint32 minBidPrice;
|
||||||
|
uint32 minBuyPrice;
|
||||||
|
|
||||||
|
BuyerItemInfoMap::iterator sameitem_itr = config.SameItemInfo.find(item->GetEntry());
|
||||||
if (sameitem_itr == config.SameItemInfo.end())
|
if (sameitem_itr == config.SameItemInfo.end())
|
||||||
{
|
{
|
||||||
InGame_BuyPrice = 0;
|
InGame_BuyPrice = 0;
|
||||||
InGame_BidPrice = 0;
|
InGame_BidPrice = 0;
|
||||||
|
minBidPrice = 0;
|
||||||
|
minBuyPrice = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (sameitem_itr->second.ItemCount == 1) MaxBuyablePrice = MaxBuyablePrice * 5; // if only one item exist can be buyed if the price is high too.
|
const BuyerItemInfo& sameBuyerItem = sameitem_itr->second;
|
||||||
InGame_BuyPrice = sameitem_itr->second.BuyPrice / sameitem_itr->second.ItemCount;
|
|
||||||
InGame_BidPrice = sameitem_itr->second.BidPrice / sameitem_itr->second.ItemCount;
|
if (sameBuyerItem.ItemCount == 1)
|
||||||
|
MaxBuyablePrice = MaxBuyablePrice * 5; // if only one item exist can be bought if the price is high too.
|
||||||
|
|
||||||
|
InGame_BuyPrice = sameBuyerItem.BuyPrice / sameBuyerItem.ItemCount;
|
||||||
|
InGame_BidPrice = sameBuyerItem.BidPrice / sameBuyerItem.ItemCount;
|
||||||
|
minBidPrice = sameBuyerItem.MinBidPrice;
|
||||||
|
minBuyPrice = sameBuyerItem.MinBuyPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
double MaxBidablePrice = MaxBuyablePrice - (MaxBuyablePrice / 30); // Max Bidable price defined to 70% of max buyable price
|
double MaxBidablePrice = MaxBuyablePrice - (MaxBuyablePrice / 30); // Max Bidable price defined to 70% of max buyable price
|
||||||
|
|
||||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Auction added with data:");
|
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Auction added with data:");
|
||||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: MaxPrice of Entry %u is %.1fg.", itr->second.AuctionId, MaxBuyablePrice / 10000);
|
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: MaxPrice of Entry %u is %.1fg.", auctionEval.AuctionId, MaxBuyablePrice / 10000);
|
||||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: GamePrice buy=%.1fg, bid=%.1fg.", InGame_BuyPrice / 10000, InGame_BidPrice / 10000);
|
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: GamePrice buy=%.1fg, bid=%.1fg.", InGame_BuyPrice / 10000, InGame_BidPrice / 10000);
|
||||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Minimal price see in AH Buy=" UI64FMTD "g, Bid=" UI64FMTD "g.",
|
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Minimal price see in AH Buy=%ug, Bid=%ug.",
|
||||||
sameitem_itr->second.MinBuyPrice / 10000, sameitem_itr->second.MinBidPrice / 10000);
|
minBuyPrice / 10000, minBidPrice / 10000);
|
||||||
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Actual Entry price, Buy=" UI64FMTD "g, Bid=" UI64FMTD "g.", buyoutPrice / 10000, bidPrice / 10000);
|
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: Actual Entry price, Buy=%ug, Bid=%ug.", buyoutPrice / 10000, bidPrice / 10000);
|
||||||
|
|
||||||
if (!auction->owner) // Original auction owner
|
if (!auction->owner) // Original auction owner
|
||||||
{
|
{
|
||||||
|
|
@ -990,24 +1003,24 @@ void AuctionBotBuyer::addNewAuctionBuyerBotBid(AHB_Buyer_Config& config)
|
||||||
}
|
}
|
||||||
if (auction->buyout != 0) // Is the item directly buyable?
|
if (auction->buyout != 0) // Is the item directly buyable?
|
||||||
{
|
{
|
||||||
if (IsBuyableEntry(buyoutPrice, InGame_BuyPrice, MaxBuyablePrice, sameitem_itr->second.MinBuyPrice, MaxChance, config.FactionChance))
|
if (IsBuyableEntry(buyoutPrice, InGame_BuyPrice, MaxBuyablePrice, minBuyPrice, MaxChance, config.FactionChance))
|
||||||
{
|
{
|
||||||
if (IsBidableEntry(bidPriceByItem, InGame_BuyPrice, MaxBidablePrice, sameitem_itr->second.MinBidPrice, MaxChance / 2, config.FactionChance))
|
if (IsBidableEntry(bidPriceByItem, InGame_BuyPrice, MaxBidablePrice, minBidPrice, MaxChance / 2, config.FactionChance))
|
||||||
if (urand(0, 5) == 0) PlaceBidToEntry(auction, bidPrice); else BuyEntry(auction);
|
if (urand(0, 5) == 0) PlaceBidToEntry(auction, bidPrice); else BuyEntry(auction);
|
||||||
else
|
else
|
||||||
{ BuyEntry(auction); }
|
BuyEntry(auction);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (IsBidableEntry(bidPriceByItem, InGame_BuyPrice, MaxBidablePrice, sameitem_itr->second.MinBidPrice, MaxChance / 2, config.FactionChance))
|
if (IsBidableEntry(bidPriceByItem, InGame_BuyPrice, MaxBidablePrice, minBidPrice, MaxChance / 2, config.FactionChance))
|
||||||
{ PlaceBidToEntry(auction, bidPrice); }
|
PlaceBidToEntry(auction, bidPrice);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // buyout = 0 mean only bid are possible
|
else // buyout = 0 mean only bid are possible
|
||||||
if (IsBidableEntry(bidPriceByItem, InGame_BuyPrice, MaxBidablePrice, sameitem_itr->second.MinBidPrice, MaxChance, config.FactionChance))
|
if (IsBidableEntry(bidPriceByItem, InGame_BuyPrice, MaxBidablePrice, minBidPrice, MaxChance, config.FactionChance))
|
||||||
{ PlaceBidToEntry(auction, bidPrice); }
|
PlaceBidToEntry(auction, bidPrice);
|
||||||
|
|
||||||
itr->second.LastChecked = Now;
|
auctionEval.LastChecked = Now;
|
||||||
--BuyCycles;
|
--BuyCycles;
|
||||||
|
|
||||||
++itr;
|
++itr;
|
||||||
|
|
@ -1920,9 +1933,12 @@ void AuctionHouseBot::Rebuild(bool all)
|
||||||
{
|
{
|
||||||
AuctionHouseObject::AuctionEntryMapBounds bounds = sAuctionMgr.GetAuctionsMap(AuctionHouseType(i))->GetAuctionsBounds();
|
AuctionHouseObject::AuctionEntryMapBounds bounds = sAuctionMgr.GetAuctionsMap(AuctionHouseType(i))->GetAuctionsBounds();
|
||||||
for (AuctionHouseObject::AuctionEntryMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
|
for (AuctionHouseObject::AuctionEntryMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
|
||||||
if (!itr->second->owner) // ahbot auction
|
{
|
||||||
if (all || itr->second->bid == 0) // expire now auction if no bid or forced
|
AuctionEntry* entry = itr->second;
|
||||||
itr->second->expireTime = sWorld.GetGameTime();
|
if (!entry->owner) // ahbot auction
|
||||||
|
if (all || entry->bid == 0) // expire now auction if no bid or forced
|
||||||
|
entry->expireTime = sWorld.GetGameTime();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ namespace MaNGOS
|
||||||
class BattleGroundYellBuilder
|
class BattleGroundYellBuilder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BattleGroundYellBuilder(Language language, int32 textId, Creature const* source, va_list* args = nullptr)
|
BattleGroundYellBuilder(Language language, int32 textId, Creature const* source, va_list* args = NULL)
|
||||||
: i_language(language), i_textId(textId), i_source(source), i_args(args) {}
|
: i_language(language), i_textId(textId), i_source(source), i_args(args) {}
|
||||||
void operator()(WorldPacket& data, int32 loc_idx)
|
void operator()(WorldPacket& data, int32 loc_idx)
|
||||||
{
|
{
|
||||||
|
|
@ -125,13 +125,13 @@ namespace MaNGOS
|
||||||
snprintf(str, 2048, text, arg1str, arg2str);
|
snprintf(str, 2048, text, arg1str, arg2str);
|
||||||
|
|
||||||
ObjectGuid guid;
|
ObjectGuid guid;
|
||||||
char const* pName = nullptr;
|
char const* pName = NULL;
|
||||||
if (i_source)
|
if (i_source)
|
||||||
{
|
{
|
||||||
guid = i_source->GetObjectGuid();
|
guid = i_source->GetObjectGuid();
|
||||||
pName = i_source->GetName();
|
pName = i_source->GetName();
|
||||||
}
|
}
|
||||||
ChatHandler::BuildChatPacket(data, i_msgtype, str, LANG_UNIVERSAL, CHAT_TAG_NONE, ObjectGuid(), nullptr, guid, pName);
|
ChatHandler::BuildChatPacket(data, i_msgtype, str, LANG_UNIVERSAL, CHAT_TAG_NONE, ObjectGuid(), NULL, guid, pName);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
ChatMsg i_msgtype;
|
ChatMsg i_msgtype;
|
||||||
|
|
@ -997,6 +997,7 @@ void BattleGround::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen
|
||||||
plr->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT);
|
plr->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT);
|
||||||
|
|
||||||
plr->RemoveAurasDueToSpell(isArena() ? SPELL_ARENA_DAMPENING : SPELL_BATTLEGROUND_DAMPENING);
|
plr->RemoveAurasDueToSpell(isArena() ? SPELL_ARENA_DAMPENING : SPELL_BATTLEGROUND_DAMPENING);
|
||||||
|
plr->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
|
||||||
|
|
||||||
if (!plr->IsAlive()) // resurrect on exit
|
if (!plr->IsAlive()) // resurrect on exit
|
||||||
{
|
{
|
||||||
|
|
@ -1313,11 +1314,12 @@ void BattleGround::RemoveFromBGFreeSlotQueue()
|
||||||
{
|
{
|
||||||
// set to be able to re-add if needed
|
// set to be able to re-add if needed
|
||||||
m_InBGFreeSlotQueue = false;
|
m_InBGFreeSlotQueue = false;
|
||||||
for (BGFreeSlotQueueType::iterator itr = sBattleGroundMgr.BGFreeSlotQueue[m_TypeID].begin(); itr != sBattleGroundMgr.BGFreeSlotQueue[m_TypeID].end(); ++itr)
|
BGFreeSlotQueueType& bgFreeSlot = sBattleGroundMgr.BGFreeSlotQueue[m_TypeID];
|
||||||
|
for (BGFreeSlotQueueType::iterator itr = bgFreeSlot.begin(); itr != bgFreeSlot.end(); ++itr)
|
||||||
{
|
{
|
||||||
if ((*itr)->GetInstanceID() == GetInstanceID())
|
if ((*itr)->GetInstanceID() == GetInstanceID())
|
||||||
{
|
{
|
||||||
sBattleGroundMgr.BGFreeSlotQueue[m_TypeID].erase(itr);
|
bgFreeSlot.erase(itr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -491,6 +491,12 @@ class BattleGround
|
||||||
// Process Capture event
|
// Process Capture event
|
||||||
virtual bool HandleEvent(uint32 /*eventId*/, GameObject* /*go*/) { return false; }
|
virtual bool HandleEvent(uint32 /*eventId*/, GameObject* /*go*/) { return false; }
|
||||||
|
|
||||||
|
// Called when a creature is created
|
||||||
|
virtual void HandleCreatureCreate(Creature* /*creature*/) {}
|
||||||
|
|
||||||
|
// handle capture objective complete
|
||||||
|
virtual void HandleObjectiveComplete(uint32 /*eventId*/, const std::list<Player*>& /*players*/, Team /*team*/) {}
|
||||||
|
|
||||||
// Called when a gameobject is created
|
// Called when a gameobject is created
|
||||||
virtual void HandleGameObjectCreate(GameObject* /*go*/) {}
|
virtual void HandleGameObjectCreate(GameObject* /*go*/) {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ void BattleGroundBE::HandleKillPlayer(Player* player, Player* killer)
|
||||||
|
|
||||||
bool BattleGroundBE::HandlePlayerUnderMap(Player* player)
|
bool BattleGroundBE::HandlePlayerUnderMap(Player* player)
|
||||||
{
|
{
|
||||||
player->TeleportTo(GetMapId(), 6238.930176f, 262.963470f, 0.889519f, player->GetOrientation(), false);
|
player->TeleportTo(GetMapId(), 6238.930176f, 262.963470f, 0.889519f, player->GetOrientation());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1437,7 +1437,7 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket* data, BattleGround* bg)
|
||||||
if (bg->isArena())
|
if (bg->isArena())
|
||||||
{
|
{
|
||||||
// it seems this must be according to BG_WINNER_A/H and _NOT_ BG_TEAM_A/H
|
// it seems this must be according to BG_WINNER_A/H and _NOT_ BG_TEAM_A/H
|
||||||
for (int8 i = 0; i < BG_TEAMS_COUNT; ++i)
|
for (int8 i = 0; i < PVP_TEAM_COUNT; ++i)
|
||||||
{
|
{
|
||||||
if (ArenaTeam* at = sObjectMgr.GetArenaTeamById(bg->m_ArenaTeamIds[i]))
|
if (ArenaTeam* at = sObjectMgr.GetArenaTeamById(bg->m_ArenaTeamIds[i]))
|
||||||
data->WriteBits(at->GetName().length(), 8);
|
data->WriteBits(at->GetName().length(), 8);
|
||||||
|
|
@ -1451,6 +1451,7 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket* data, BattleGround* bg)
|
||||||
{
|
{
|
||||||
ObjectGuid memberGuid = itr->first;
|
ObjectGuid memberGuid = itr->first;
|
||||||
Player* player = sObjectMgr.GetPlayer(itr->first);
|
Player* player = sObjectMgr.GetPlayer(itr->first);
|
||||||
|
const BattleGroundScore* score = itr->second;
|
||||||
|
|
||||||
data->WriteBit(0); // unk1
|
data->WriteBit(0); // unk1
|
||||||
data->WriteBit(0); // unk2
|
data->WriteBit(0); // unk2
|
||||||
|
|
@ -1466,18 +1467,18 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket* data, BattleGround* bg)
|
||||||
data->WriteBit(team == ALLIANCE); // unk7
|
data->WriteBit(team == ALLIANCE); // unk7
|
||||||
data->WriteGuidMask<7>(memberGuid);
|
data->WriteGuidMask<7>(memberGuid);
|
||||||
|
|
||||||
buffer << uint32(itr->second->HealingDone); // healing done
|
buffer << uint32(score->HealingDone); // healing done
|
||||||
buffer << uint32(itr->second->DamageDone); // damage done
|
buffer << uint32(score->DamageDone); // damage done
|
||||||
|
|
||||||
if (!bg->isArena())
|
if (!bg->isArena())
|
||||||
{
|
{
|
||||||
buffer << uint32(itr->second->BonusHonor);
|
buffer << uint32(score->BonusHonor);
|
||||||
buffer << uint32(itr->second->Deaths);
|
buffer << uint32(score->Deaths);
|
||||||
buffer << uint32(itr->second->HonorableKills);
|
buffer << uint32(score->HonorableKills);
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer.WriteGuidBytes<4>(memberGuid);
|
buffer.WriteGuidBytes<4>(memberGuid);
|
||||||
buffer << uint32(itr->second->KillingBlows);
|
buffer << uint32(score->KillingBlows);
|
||||||
// if (unk5) << uint32() unk
|
// if (unk5) << uint32() unk
|
||||||
buffer.WriteGuidBytes<5>(memberGuid);
|
buffer.WriteGuidBytes<5>(memberGuid);
|
||||||
// if (unk6) << uint32() unk
|
// if (unk6) << uint32() unk
|
||||||
|
|
@ -1493,25 +1494,25 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket* data, BattleGround* bg)
|
||||||
{
|
{
|
||||||
case BATTLEGROUND_AV:
|
case BATTLEGROUND_AV:
|
||||||
data->WriteBits(5, 24); // count of next fields
|
data->WriteBits(5, 24); // count of next fields
|
||||||
buffer << uint32(((BattleGroundAVScore*)itr->second)->GraveyardsAssaulted); // GraveyardsAssaulted
|
buffer << uint32(((BattleGroundAVScore*)score)->GraveyardsAssaulted); // GraveyardsAssaulted
|
||||||
buffer << uint32(((BattleGroundAVScore*)itr->second)->GraveyardsDefended); // GraveyardsDefended
|
buffer << uint32(((BattleGroundAVScore*)score)->GraveyardsDefended); // GraveyardsDefended
|
||||||
buffer << uint32(((BattleGroundAVScore*)itr->second)->TowersAssaulted); // TowersAssaulted
|
buffer << uint32(((BattleGroundAVScore*)score)->TowersAssaulted); // TowersAssaulted
|
||||||
buffer << uint32(((BattleGroundAVScore*)itr->second)->TowersDefended); // TowersDefended
|
buffer << uint32(((BattleGroundAVScore*)score)->TowersDefended); // TowersDefended
|
||||||
buffer << uint32(((BattleGroundAVScore*)itr->second)->SecondaryObjectives); // SecondaryObjectives - free some of the Lieutnants
|
buffer << uint32(((BattleGroundAVScore*)score)->SecondaryObjectives); // SecondaryObjectives - free some of the Lieutnants
|
||||||
break;
|
break;
|
||||||
case BATTLEGROUND_WS:
|
case BATTLEGROUND_WS:
|
||||||
data->WriteBits(2, 24); // count of next fields
|
data->WriteBits(2, 24); // count of next fields
|
||||||
buffer << uint32(((BattleGroundWGScore*)itr->second)->FlagCaptures); // flag captures
|
buffer << uint32(((BattleGroundWGScore*)score)->FlagCaptures); // flag captures
|
||||||
buffer << uint32(((BattleGroundWGScore*)itr->second)->FlagReturns); // flag returns
|
buffer << uint32(((BattleGroundWGScore*)score)->FlagReturns); // flag returns
|
||||||
break;
|
break;
|
||||||
case BATTLEGROUND_AB:
|
case BATTLEGROUND_AB:
|
||||||
data->WriteBits(2, 24); // count of next fields
|
data->WriteBits(2, 24); // count of next fields
|
||||||
buffer << uint32(((BattleGroundABScore*)itr->second)->BasesAssaulted); // bases asssulted
|
buffer << uint32(((BattleGroundABScore*)score)->BasesAssaulted); // bases asssulted
|
||||||
buffer << uint32(((BattleGroundABScore*)itr->second)->BasesDefended); // bases defended
|
buffer << uint32(((BattleGroundABScore*)score)->BasesDefended); // bases defended
|
||||||
break;
|
break;
|
||||||
case BATTLEGROUND_EY:
|
case BATTLEGROUND_EY:
|
||||||
data->WriteBits(1, 24); // count of next fields
|
data->WriteBits(1, 24); // count of next fields
|
||||||
buffer << uint32(((BattleGroundEYScore*)itr->second)->FlagCaptures); // flag captures
|
buffer << uint32(((BattleGroundEYScore*)score)->FlagCaptures); // flag captures
|
||||||
break;
|
break;
|
||||||
case BATTLEGROUND_NA:
|
case BATTLEGROUND_NA:
|
||||||
case BATTLEGROUND_BE:
|
case BATTLEGROUND_BE:
|
||||||
|
|
@ -1541,7 +1542,7 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket* data, BattleGround* bg)
|
||||||
|
|
||||||
if (bg->isRated()) // arena
|
if (bg->isRated()) // arena
|
||||||
{
|
{
|
||||||
for (int8 i = 0; i < BG_TEAMS_COUNT; ++i)
|
for (int8 i = 0; i < PVP_TEAM_COUNT; ++i)
|
||||||
{
|
{
|
||||||
uint32 pointsLost = bg->m_ArenaTeamRatingChanges[i] < 0 ? abs(bg->m_ArenaTeamRatingChanges[i]) : 0;
|
uint32 pointsLost = bg->m_ArenaTeamRatingChanges[i] < 0 ? abs(bg->m_ArenaTeamRatingChanges[i]) : 0;
|
||||||
uint32 pointsGained = bg->m_ArenaTeamRatingChanges[i] > 0 ? bg->m_ArenaTeamRatingChanges[i] : 0;
|
uint32 pointsGained = bg->m_ArenaTeamRatingChanges[i] > 0 ? bg->m_ArenaTeamRatingChanges[i] : 0;
|
||||||
|
|
@ -1558,7 +1559,7 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket* data, BattleGround* bg)
|
||||||
|
|
||||||
if (bg->isArena())
|
if (bg->isArena())
|
||||||
{
|
{
|
||||||
for (int8 i = 0; i < BG_TEAMS_COUNT; ++i)
|
for (int8 i = 0; i < PVP_TEAM_COUNT; ++i)
|
||||||
{
|
{
|
||||||
if (ArenaTeam* at = sObjectMgr.GetArenaTeamById(bg->m_ArenaTeamIds[i]))
|
if (ArenaTeam* at = sObjectMgr.GetArenaTeamById(bg->m_ArenaTeamIds[i]))
|
||||||
data->append(at->GetName().data(), at->GetName().length());
|
data->append(at->GetName().data(), at->GetName().length());
|
||||||
|
|
@ -1902,15 +1903,17 @@ void BattleGroundMgr::CreateInitialBattleGrounds()
|
||||||
uint32 MinPlayersPerTeam = fields[1].GetUInt32();
|
uint32 MinPlayersPerTeam = fields[1].GetUInt32();
|
||||||
uint32 MaxPlayersPerTeam = fields[2].GetUInt32();
|
uint32 MaxPlayersPerTeam = fields[2].GetUInt32();
|
||||||
|
|
||||||
// check values from DB
|
if (MaxPlayersPerTeam == 0)
|
||||||
if (MaxPlayersPerTeam == 0 || MinPlayersPerTeam == 0)
|
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Table `battleground_template` for id %u have wrong min/max players per team settings. BG not created.", bgTypeID);
|
sLog.outErrorDb("Table `battleground_template` for id %u doesn't allow any player per team settings. BG not created.", bgTypeID);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MinPlayersPerTeam > MaxPlayersPerTeam)
|
if (MinPlayersPerTeam > MaxPlayersPerTeam)
|
||||||
|
{
|
||||||
MinPlayersPerTeam = MaxPlayersPerTeam;
|
MinPlayersPerTeam = MaxPlayersPerTeam;
|
||||||
|
sLog.outErrorDb("Table `battleground_template` for id %u has min players > max players per team settings. Min players will use same value as max players.", bgTypeID);
|
||||||
|
}
|
||||||
|
|
||||||
float AStartLoc[4];
|
float AStartLoc[4];
|
||||||
float HStartLoc[4];
|
float HStartLoc[4];
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ void BattleGroundNA::HandleKillPlayer(Player* player, Player* killer)
|
||||||
|
|
||||||
bool BattleGroundNA::HandlePlayerUnderMap(Player* player)
|
bool BattleGroundNA::HandlePlayerUnderMap(Player* player)
|
||||||
{
|
{
|
||||||
player->TeleportTo(GetMapId(), 4055.504395f, 2919.660645f, 13.611241f, player->GetOrientation(), false);
|
player->TeleportTo(GetMapId(), 4055.504395f, 2919.660645f, 13.611241f, player->GetOrientation());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ void BattleGroundRL::HandleKillPlayer(Player* player, Player* killer)
|
||||||
|
|
||||||
bool BattleGroundRL::HandlePlayerUnderMap(Player* player)
|
bool BattleGroundRL::HandlePlayerUnderMap(Player* player)
|
||||||
{
|
{
|
||||||
player->TeleportTo(GetMapId(), 1285.810547f, 1667.896851f, 39.957642f, player->GetOrientation(), false);
|
player->TeleportTo(GetMapId(), 1285.810547f, 1667.896851f, 39.957642f, player->GetOrientation());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ bool ChatHandler::HandleServerInfoCommand(char* /*args*/)
|
||||||
bool ChatHandler::HandleDismountCommand(char* /*args*/)
|
bool ChatHandler::HandleDismountCommand(char* /*args*/)
|
||||||
{
|
{
|
||||||
Player* player = m_session->GetPlayer();
|
Player* player = m_session->GetPlayer();
|
||||||
|
|
||||||
// If player is not mounted, so go out :)
|
// If player is not mounted, so go out :)
|
||||||
if (!player->IsMounted())
|
if (!player->IsMounted())
|
||||||
{
|
{
|
||||||
|
|
@ -175,10 +175,11 @@ bool ChatHandler::HandleGMListIngameCommand(char* /*args*/)
|
||||||
HashMapHolder<Player>::MapType& m = sObjectAccessor.GetPlayers();
|
HashMapHolder<Player>::MapType& m = sObjectAccessor.GetPlayers();
|
||||||
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
|
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||||
{
|
{
|
||||||
AccountTypes itr_sec = itr->second->GetSession()->GetSecurity();
|
Player* player = itr->second;
|
||||||
if ((itr->second->isGameMaster() || (itr_sec > SEC_PLAYER && itr_sec <= (AccountTypes)sWorld.getConfig(CONFIG_UINT32_GM_LEVEL_IN_GM_LIST))) &&
|
AccountTypes security = player->GetSession()->GetSecurity();
|
||||||
(!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())))
|
if ((player->isGameMaster() || (security > SEC_PLAYER && security <= (AccountTypes)sWorld.getConfig(CONFIG_UINT32_GM_LEVEL_IN_GM_LIST))) &&
|
||||||
{ names.push_back(std::make_pair<std::string, bool>(GetNameLink(itr->second), itr->second->isAcceptWhispers())); }
|
(!m_session || player->IsVisibleGloballyFor(m_session->GetPlayer())))
|
||||||
|
names.push_back(std::make_pair<std::string, bool>(GetNameLink(player), player->isAcceptWhispers()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -189,10 +190,10 @@ bool ChatHandler::HandleGMListIngameCommand(char* /*args*/)
|
||||||
char const* accepts = GetMangosString(LANG_GM_ACCEPTS_WHISPER);
|
char const* accepts = GetMangosString(LANG_GM_ACCEPTS_WHISPER);
|
||||||
char const* not_accept = GetMangosString(LANG_GM_NO_WHISPER);
|
char const* not_accept = GetMangosString(LANG_GM_NO_WHISPER);
|
||||||
for (std::list<std::pair< std::string, bool> >::const_iterator iter = names.begin(); iter != names.end(); ++iter)
|
for (std::list<std::pair< std::string, bool> >::const_iterator iter = names.begin(); iter != names.end(); ++iter)
|
||||||
{ PSendSysMessage("%s - %s", iter->first.c_str(), iter->second ? accepts : not_accept); }
|
PSendSysMessage("%s - %s", iter->first.c_str(), iter->second ? accepts : not_accept);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ SendSysMessage(LANG_GMS_NOT_LOGGED); }
|
SendSysMessage(LANG_GMS_NOT_LOGGED);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -383,8 +383,8 @@ bool ChatHandler::HandleSummonCommand(char* args)
|
||||||
if (!ExtractPlayerTarget(&args, &target, &target_guid, &target_name))
|
if (!ExtractPlayerTarget(&args, &target, &target_guid, &target_name))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Player* _player = m_session->GetPlayer();
|
Player* player = m_session->GetPlayer();
|
||||||
if (target == _player || target_guid == _player->GetObjectGuid())
|
if (target == player || target_guid == player->GetObjectGuid())
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_CANT_TELEPORT_SELF);
|
PSendSysMessage(LANG_CANT_TELEPORT_SELF);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|
@ -405,7 +405,7 @@ bool ChatHandler::HandleSummonCommand(char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map* pMap = m_session->GetPlayer()->GetMap();
|
Map* pMap = player->GetMap();
|
||||||
|
|
||||||
if (pMap->IsBattleGroundOrArena())
|
if (pMap->IsBattleGroundOrArena())
|
||||||
{
|
{
|
||||||
|
|
@ -442,9 +442,9 @@ bool ChatHandler::HandleSummonCommand(char* args)
|
||||||
}
|
}
|
||||||
|
|
||||||
// we are in instance, and can summon only player in our group with us as lead
|
// we are in instance, and can summon only player in our group with us as lead
|
||||||
if (!m_session->GetPlayer()->GetGroup() || !target->GetGroup() ||
|
if (!player->GetGroup() || !target->GetGroup() ||
|
||||||
(target->GetGroup()->GetLeaderGuid() != m_session->GetPlayer()->GetObjectGuid()) ||
|
(target->GetGroup()->GetLeaderGuid() != player->GetObjectGuid()) ||
|
||||||
(m_session->GetPlayer()->GetGroup()->GetLeaderGuid() != m_session->GetPlayer()->GetObjectGuid()))
|
(player->GetGroup()->GetLeaderGuid() != player->GetObjectGuid()))
|
||||||
// the last check is a bit excessive, but let it be, just in case
|
// the last check is a bit excessive, but let it be, just in case
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, nameLink.c_str());
|
PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, nameLink.c_str());
|
||||||
|
|
@ -455,7 +455,7 @@ bool ChatHandler::HandleSummonCommand(char* args)
|
||||||
|
|
||||||
PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), "");
|
PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), "");
|
||||||
if (needReportToTarget(target))
|
if (needReportToTarget(target))
|
||||||
ChatHandler(target).PSendSysMessage(LANG_SUMMONED_BY, playerLink(_player->GetName()).c_str());
|
ChatHandler(target).PSendSysMessage(LANG_SUMMONED_BY, playerLink(player->GetName()).c_str());
|
||||||
|
|
||||||
// stop flight if need
|
// stop flight if need
|
||||||
if (target->IsTaxiFlying())
|
if (target->IsTaxiFlying())
|
||||||
|
|
@ -483,12 +483,12 @@ bool ChatHandler::HandleSummonCommand(char* args)
|
||||||
PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), GetMangosString(LANG_OFFLINE));
|
PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), GetMangosString(LANG_OFFLINE));
|
||||||
|
|
||||||
// in point where GM stay
|
// in point where GM stay
|
||||||
Player::SavePositionInDB(target_guid, m_session->GetPlayer()->GetMapId(),
|
Player::SavePositionInDB(target_guid, player->GetMapId(),
|
||||||
m_session->GetPlayer()->GetPositionX(),
|
player->GetPositionX(),
|
||||||
m_session->GetPlayer()->GetPositionY(),
|
player->GetPositionY(),
|
||||||
m_session->GetPlayer()->GetPositionZ(),
|
player->GetPositionZ(),
|
||||||
m_session->GetPlayer()->GetOrientation(),
|
player->GetOrientation(),
|
||||||
m_session->GetPlayer()->GetZoneId());
|
player->GetZoneId());
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -1984,13 +1984,14 @@ bool ChatHandler::HandleGroupgoCommand(char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map* gmMap = m_session->GetPlayer()->GetMap();
|
Player* player = m_session->GetPlayer();
|
||||||
|
Map* gmMap = player->GetMap();
|
||||||
bool to_instance = gmMap->Instanceable();
|
bool to_instance = gmMap->Instanceable();
|
||||||
|
|
||||||
// we are in instance, and can summon only player in our group with us as lead
|
// we are in instance, and can summon only player in our group with us as lead
|
||||||
if (to_instance && (
|
if (to_instance && (
|
||||||
!m_session->GetPlayer()->GetGroup() || (grp->GetLeaderGuid() != m_session->GetPlayer()->GetObjectGuid()) ||
|
!player->GetGroup() || (grp->GetLeaderGuid() != player->GetObjectGuid()) ||
|
||||||
(m_session->GetPlayer()->GetGroup()->GetLeaderGuid() != m_session->GetPlayer()->GetObjectGuid())))
|
(player->GetGroup()->GetLeaderGuid() != player->GetObjectGuid())))
|
||||||
// the last check is a bit excessive, but let it be, just in case
|
// the last check is a bit excessive, but let it be, just in case
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_CANNOT_SUMMON_TO_INST);
|
SendSysMessage(LANG_CANNOT_SUMMON_TO_INST);
|
||||||
|
|
@ -1998,7 +1999,7 @@ bool ChatHandler::HandleGroupgoCommand(char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
for (GroupReference* itr = grp->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||||
{
|
{
|
||||||
Player* pl = itr->getSource();
|
Player* pl = itr->getSource();
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -2370,7 +2370,8 @@ bool ChatHandler::HandleLearnAllMyClassCommand(char* /*args*/)
|
||||||
|
|
||||||
bool ChatHandler::HandleLearnAllMySpellsCommand(char* /*args*/)
|
bool ChatHandler::HandleLearnAllMySpellsCommand(char* /*args*/)
|
||||||
{
|
{
|
||||||
ChrClassesEntry const* clsEntry = sChrClassesStore.LookupEntry(m_session->GetPlayer()->getClass());
|
Player* player = m_session->GetPlayer();
|
||||||
|
ChrClassesEntry const* clsEntry = sChrClassesStore.LookupEntry(player->getClass());
|
||||||
if (!clsEntry)
|
if (!clsEntry)
|
||||||
return true;
|
return true;
|
||||||
uint32 family = clsEntry->spellfamily;
|
uint32 family = clsEntry->spellfamily;
|
||||||
|
|
@ -2390,7 +2391,7 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(char* /*args*/)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// skip wrong class/race skills
|
// skip wrong class/race skills
|
||||||
if (!m_session->GetPlayer()->IsSpellFitByClassAndRace(spellInfo->Id))
|
if (!player->IsSpellFitByClassAndRace(spellInfo->Id))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// skip other spell families
|
// skip other spell families
|
||||||
|
|
@ -2403,10 +2404,10 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(char* /*args*/)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// skip broken spells
|
// skip broken spells
|
||||||
if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer(), false))
|
if (!SpellMgr::IsSpellValid(spellInfo, player, false))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
m_session->GetPlayer()->learnSpell(spellInfo->Id, false);
|
player->learnSpell(spellInfo->Id, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
SendSysMessage(LANG_COMMAND_LEARN_CLASS_SPELLS);
|
SendSysMessage(LANG_COMMAND_LEARN_CLASS_SPELLS);
|
||||||
|
|
@ -2447,7 +2448,7 @@ bool ChatHandler::HandleLearnAllMyTalentsCommand(char* /*args*/)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellid);
|
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellid);
|
||||||
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer(), false))
|
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, player, false))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// learn highest rank of talent and learn all non-talent spell ranks (recursive by tree)
|
// learn highest rank of talent and learn all non-talent spell ranks (recursive by tree)
|
||||||
|
|
@ -2540,9 +2541,11 @@ bool ChatHandler::HandleLearnAllMyPetTalentsCommand(char* /*args*/)
|
||||||
|
|
||||||
bool ChatHandler::HandleLearnAllLangCommand(char* /*args*/)
|
bool ChatHandler::HandleLearnAllLangCommand(char* /*args*/)
|
||||||
{
|
{
|
||||||
|
Player* player = m_session->GetPlayer();
|
||||||
|
|
||||||
// skipping UNIVERSAL language (0)
|
// skipping UNIVERSAL language (0)
|
||||||
for (int i = 1; i < LANGUAGES_COUNT; ++i)
|
for (int i = 1; i < LANGUAGES_COUNT; ++i)
|
||||||
m_session->GetPlayer()->learnSpell(lang_description[i].spell_id, false);
|
player->learnSpell(lang_description[i].spell_id, false);
|
||||||
|
|
||||||
SendSysMessage(LANG_COMMAND_LEARN_ALL_LANG);
|
SendSysMessage(LANG_COMMAND_LEARN_ALL_LANG);
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -2563,6 +2566,7 @@ bool ChatHandler::HandleLearnAllDefaultCommand(char* args)
|
||||||
|
|
||||||
bool ChatHandler::HandleLearnCommand(char* args)
|
bool ChatHandler::HandleLearnCommand(char* args)
|
||||||
{
|
{
|
||||||
|
Player* player = m_session->GetPlayer();
|
||||||
Player* targetPlayer = getSelectedPlayer();
|
Player* targetPlayer = getSelectedPlayer();
|
||||||
|
|
||||||
if (!targetPlayer)
|
if (!targetPlayer)
|
||||||
|
|
@ -2577,12 +2581,12 @@ bool ChatHandler::HandleLearnCommand(char* args)
|
||||||
if (!spell || !sSpellStore.LookupEntry(spell))
|
if (!spell || !sSpellStore.LookupEntry(spell))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool allRanks = ExtractLiteralArg(&args, "all") != NULL;
|
bool allRanks = ExtractLiteralArg(&args, "all") != nullptr;
|
||||||
if (!allRanks && *args) // can be fail also at syntax error
|
if (!allRanks && *args) // can be fail also at syntax error
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell);
|
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell);
|
||||||
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer()))
|
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, player))
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell);
|
PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|
@ -2591,7 +2595,7 @@ bool ChatHandler::HandleLearnCommand(char* args)
|
||||||
|
|
||||||
if (!allRanks && targetPlayer->HasSpell(spell))
|
if (!allRanks && targetPlayer->HasSpell(spell))
|
||||||
{
|
{
|
||||||
if (targetPlayer == m_session->GetPlayer())
|
if (targetPlayer == player)
|
||||||
SendSysMessage(LANG_YOU_KNOWN_SPELL);
|
SendSysMessage(LANG_YOU_KNOWN_SPELL);
|
||||||
else
|
else
|
||||||
PSendSysMessage(LANG_TARGET_KNOWN_SPELL, GetNameLink(targetPlayer).c_str());
|
PSendSysMessage(LANG_TARGET_KNOWN_SPELL, GetNameLink(targetPlayer).c_str());
|
||||||
|
|
@ -3956,9 +3960,10 @@ bool ChatHandler::HandleGetDistanceCommand(char* args)
|
||||||
|
|
||||||
bool ChatHandler::HandleDieCommand(char* /*args*/)
|
bool ChatHandler::HandleDieCommand(char* /*args*/)
|
||||||
{
|
{
|
||||||
|
Player* player = m_session->GetPlayer();
|
||||||
Unit* target = getSelectedUnit();
|
Unit* target = getSelectedUnit();
|
||||||
|
|
||||||
if (!target || !m_session->GetPlayer()->GetSelectionGuid())
|
if (!target || !player->GetSelectionGuid())
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
|
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|
@ -3973,7 +3978,7 @@ bool ChatHandler::HandleDieCommand(char* /*args*/)
|
||||||
|
|
||||||
if (target->IsAlive())
|
if (target->IsAlive())
|
||||||
{
|
{
|
||||||
m_session->GetPlayer()->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
player->DealDamage(target, target->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -3985,8 +3990,9 @@ bool ChatHandler::HandleDamageCommand(char* args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Unit* target = getSelectedUnit();
|
Unit* target = getSelectedUnit();
|
||||||
|
Player* player = m_session->GetPlayer();
|
||||||
|
|
||||||
if (!target || !m_session->GetPlayer()->GetSelectionGuid())
|
if (!target || !player->GetSelectionGuid())
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
|
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|
@ -4005,12 +4011,12 @@ bool ChatHandler::HandleDamageCommand(char* args)
|
||||||
|
|
||||||
uint32 damage = damage_int;
|
uint32 damage = damage_int;
|
||||||
|
|
||||||
// flat melee damage without resistence/etc reduction
|
// flat melee damage without resistance/etc reduction
|
||||||
if (!*args)
|
if (!*args)
|
||||||
{
|
{
|
||||||
m_session->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
player->DealDamage(target, damage, nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
|
||||||
if (target != m_session->GetPlayer())
|
if (target != player)
|
||||||
m_session->GetPlayer()->SendAttackStateUpdate(HITINFO_NORMALSWING2, target, 1, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_NORMAL, 0);
|
player->SendAttackStateUpdate(HITINFO_NORMALSWING2, target, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_NORMAL, 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4024,7 +4030,7 @@ bool ChatHandler::HandleDamageCommand(char* args)
|
||||||
SpellSchoolMask schoolmask = SpellSchoolMask(1 << school);
|
SpellSchoolMask schoolmask = SpellSchoolMask(1 << school);
|
||||||
|
|
||||||
if (schoolmask & SPELL_SCHOOL_MASK_NORMAL)
|
if (schoolmask & SPELL_SCHOOL_MASK_NORMAL)
|
||||||
damage = m_session->GetPlayer()->CalcArmorReducedDamage(target, damage);
|
damage = player->CalcArmorReducedDamage(target, damage);
|
||||||
|
|
||||||
// melee damage by specific school
|
// melee damage by specific school
|
||||||
if (!*args)
|
if (!*args)
|
||||||
|
|
@ -4032,16 +4038,16 @@ bool ChatHandler::HandleDamageCommand(char* args)
|
||||||
uint32 absorb = 0;
|
uint32 absorb = 0;
|
||||||
uint32 resist = 0;
|
uint32 resist = 0;
|
||||||
|
|
||||||
target->CalculateDamageAbsorbAndResist(m_session->GetPlayer(), schoolmask, SPELL_DIRECT_DAMAGE, damage, &absorb, &resist);
|
target->CalculateDamageAbsorbAndResist(player, schoolmask, SPELL_DIRECT_DAMAGE, damage, &absorb, &resist);
|
||||||
|
|
||||||
if (damage <= absorb + resist)
|
if (damage <= absorb + resist)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
damage -= absorb + resist;
|
damage -= absorb + resist;
|
||||||
|
|
||||||
m_session->GetPlayer()->DealDamageMods(target, damage, &absorb);
|
player->DealDamageMods(target, damage, &absorb);
|
||||||
m_session->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false);
|
player->DealDamage(target, damage, nullptr, DIRECT_DAMAGE, schoolmask, nullptr, false);
|
||||||
m_session->GetPlayer()->SendAttackStateUpdate(HITINFO_NORMALSWING2, target, 1, schoolmask, damage, absorb, resist, VICTIMSTATE_NORMAL, 0);
|
player->SendAttackStateUpdate(HITINFO_NORMALSWING2, target, schoolmask, damage, absorb, resist, VICTIMSTATE_NORMAL, 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4052,7 +4058,7 @@ bool ChatHandler::HandleDamageCommand(char* args)
|
||||||
if (!spellid || !sSpellStore.LookupEntry(spellid))
|
if (!spellid || !sSpellStore.LookupEntry(spellid))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_session->GetPlayer()->SpellNonMeleeDamageLog(target, spellid, damage);
|
player->SpellNonMeleeDamageLog(target, spellid, damage);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -6411,7 +6417,7 @@ bool ChatHandler::HandleCastCommand(char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool triggered = ExtractLiteralArg(&args, "triggered") != NULL;
|
bool triggered = ExtractLiteralArg(&args, "triggered") != nullptr;
|
||||||
if (!triggered && *args) // can be fail also at syntax error
|
if (!triggered && *args) // can be fail also at syntax error
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
@ -7132,8 +7138,10 @@ bool ChatHandler::HandleSendMessageCommand(char* args)
|
||||||
if (!*args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
WorldSession* rPlayerSession = rPlayer->GetSession();
|
||||||
|
|
||||||
///- Check that he is not logging out.
|
///- Check that he is not logging out.
|
||||||
if (rPlayer->GetSession()->isLogingOut())
|
if (rPlayerSession->isLogingOut())
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|
@ -7142,8 +7150,8 @@ bool ChatHandler::HandleSendMessageCommand(char* args)
|
||||||
|
|
||||||
///- Send the message
|
///- Send the message
|
||||||
// Use SendAreaTriggerMessage for fastest delivery.
|
// Use SendAreaTriggerMessage for fastest delivery.
|
||||||
rPlayer->GetSession()->SendAreaTriggerMessage("%s", args);
|
rPlayerSession->SendAreaTriggerMessage("%s", args);
|
||||||
rPlayer->GetSession()->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r");
|
rPlayerSession->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r");
|
||||||
|
|
||||||
// Confirmation message
|
// Confirmation message
|
||||||
std::string nameLink = GetNameLink(rPlayer);
|
std::string nameLink = GetNameLink(rPlayer);
|
||||||
|
|
@ -7301,3 +7309,11 @@ bool ChatHandler::HandleMmapTestArea(char* args)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ChatHandler::HandleServerResetAllRaidCommand(char* args)
|
||||||
|
{
|
||||||
|
PSendSysMessage("Global raid instances reset, all players in raid instances will be teleported to homebind!");
|
||||||
|
sMapPersistentStateMgr.GetScheduler().ResetAllRaid();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@
|
||||||
#include "ObjectMgr.h"
|
#include "ObjectMgr.h"
|
||||||
#include "ObjectGuid.h"
|
#include "ObjectGuid.h"
|
||||||
#include "SpellMgr.h"
|
#include "SpellMgr.h"
|
||||||
#include "PhaseMgr.h"
|
|
||||||
|
|
||||||
bool ChatHandler::HandleDebugSendSpellFailCommand(char* args)
|
bool ChatHandler::HandleDebugSendSpellFailCommand(char* args)
|
||||||
{
|
{
|
||||||
|
|
@ -129,58 +128,60 @@ bool ChatHandler::HandleDebugSendOpcodeCommand(char* /*args*/)
|
||||||
if (!unit || (unit->GetTypeId() != TYPEID_PLAYER))
|
if (!unit || (unit->GetTypeId() != TYPEID_PLAYER))
|
||||||
unit = m_session->GetPlayer();
|
unit = m_session->GetPlayer();
|
||||||
|
|
||||||
std::ifstream ifs("opcode.txt");
|
std::ifstream stream("opcode.txt");
|
||||||
if (ifs.bad())
|
if (!stream.is_open())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32 opcode;
|
uint32 opcode = 0;
|
||||||
ifs >> opcode;
|
if (!(stream >> opcode))
|
||||||
|
{
|
||||||
|
stream.close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
WorldPacket data(Opcodes(opcode), 0);
|
WorldPacket data(Opcodes(opcode), 0);
|
||||||
|
|
||||||
while (!ifs.eof())
|
std::string type;
|
||||||
|
while (stream >> type)
|
||||||
{
|
{
|
||||||
std::string type;
|
if (type.empty())
|
||||||
ifs >> type;
|
|
||||||
|
|
||||||
if (type == "")
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (type == "uint8")
|
if (type == "uint8")
|
||||||
{
|
{
|
||||||
uint16 val1;
|
uint16 value;
|
||||||
ifs >> val1;
|
stream >> value;
|
||||||
data << uint8(val1);
|
data << uint8(value);
|
||||||
}
|
}
|
||||||
else if (type == "uint16")
|
else if (type == "uint16")
|
||||||
{
|
{
|
||||||
uint16 val2;
|
uint16 value;
|
||||||
ifs >> val2;
|
stream >> value;
|
||||||
data << val2;
|
data << value;
|
||||||
}
|
}
|
||||||
else if (type == "uint32")
|
else if (type == "uint32")
|
||||||
{
|
{
|
||||||
uint32 val3;
|
uint32 value;
|
||||||
ifs >> val3;
|
stream >> value;
|
||||||
data << val3;
|
data << value;
|
||||||
}
|
}
|
||||||
else if (type == "uint64")
|
else if (type == "uint64")
|
||||||
{
|
{
|
||||||
uint64 val4;
|
uint64 value;
|
||||||
ifs >> val4;
|
stream >> value;
|
||||||
data << val4;
|
data << value;
|
||||||
}
|
}
|
||||||
else if (type == "float")
|
else if (type == "float")
|
||||||
{
|
{
|
||||||
float val5;
|
float value;
|
||||||
ifs >> val5;
|
stream >> value;
|
||||||
data << val5;
|
data << value;
|
||||||
}
|
}
|
||||||
else if (type == "string")
|
else if (type == "string")
|
||||||
{
|
{
|
||||||
std::string val6;
|
std::string value;
|
||||||
ifs >> val6;
|
stream >> value;
|
||||||
data << val6;
|
data << value;
|
||||||
}
|
}
|
||||||
else if (type == "pguid")
|
else if (type == "pguid")
|
||||||
{
|
{
|
||||||
|
|
@ -192,11 +193,15 @@ bool ChatHandler::HandleDebugSendOpcodeCommand(char* /*args*/)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ifs.close();
|
stream.close();
|
||||||
|
|
||||||
DEBUG_LOG("Sending opcode %u, %s", data.GetOpcode(), data.GetOpcodeName());
|
DEBUG_LOG("Sending opcode %u, %s", data.GetOpcode(), data.GetOpcodeName());
|
||||||
|
|
||||||
data.hexlike();
|
data.hexlike();
|
||||||
((Player*)unit)->GetSession()->SendPacket(&data);
|
((Player*)unit)->GetSession()->SendPacket(&data);
|
||||||
|
|
||||||
PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName());
|
PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -673,32 +678,23 @@ bool ChatHandler::HandleDebugSendSetPhaseShiftCommand(char* args)
|
||||||
if (!*args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
char* t = strtok((char*)args, " ");
|
char* m = strtok((char*)args, " ");
|
||||||
char* p = strtok(NULL, " ");
|
char* p = strtok(NULL, " ");
|
||||||
|
|
||||||
if (!t)
|
uint16 MapId = atoi(m);
|
||||||
return false;
|
uint32 PhaseShift = atoi(p);
|
||||||
|
m_session->SendSetPhaseShift(PhaseShift, MapId);
|
||||||
std::set<uint32> terrainswap;
|
|
||||||
std::set<uint32> phaseId;
|
|
||||||
|
|
||||||
terrainswap.insert((uint32)atoi(t));
|
|
||||||
|
|
||||||
if (p)
|
|
||||||
phaseId.insert((uint32)atoi(p));
|
|
||||||
|
|
||||||
m_session->SendSetPhaseShift(phaseId, terrainswap);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChatHandler::HandleDebugPhaseCommand(char* args)
|
bool ChatHandler::HandleDebugPhaseCommand(char* args)
|
||||||
{
|
{
|
||||||
Player* player = getSelectedPlayer();
|
uint32 emote_id;
|
||||||
if (!player)
|
if (!ExtractUInt32(&args, emote_id))
|
||||||
player = m_session->GetPlayer();
|
{ return false; }
|
||||||
|
|
||||||
player->GetPhaseMgr()->SendDebugReportToPlayer(m_session->GetPlayer());
|
m_session->GetPlayer()->HandleEmoteCommand(emote_id);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// show animation
|
// show animation
|
||||||
|
|
@ -973,29 +969,30 @@ bool ChatHandler::HandlerDebugModValueHelper(Object* target, uint32 field, char*
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32 value = target->GetUInt32Value(field);
|
uint32 value = target->GetUInt32Value(field);
|
||||||
|
const char* guidString = guid.GetString().c_str();
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case 1: // int +
|
case 1: // int +
|
||||||
value = uint32(int32(value) + int32(iValue));
|
value = uint32(int32(value) + int32(iValue));
|
||||||
DEBUG_LOG(GetMangosString(LANG_CHANGE_INT32), guid.GetString().c_str(), field, iValue, value, value);
|
DEBUG_LOG(GetMangosString(LANG_CHANGE_INT32), guidString, field, iValue, value, value);
|
||||||
PSendSysMessage(LANG_CHANGE_INT32_FIELD, guid.GetString().c_str(), field, iValue, value, value);
|
PSendSysMessage(LANG_CHANGE_INT32_FIELD, guidString, field, iValue, value, value);
|
||||||
break;
|
break;
|
||||||
case 2: // |= bit or
|
case 2: // |= bit or
|
||||||
value |= iValue;
|
value |= iValue;
|
||||||
DEBUG_LOG(GetMangosString(LANG_CHANGE_HEX), guid.GetString().c_str(), field, typeStr, iValue, value);
|
DEBUG_LOG(GetMangosString(LANG_CHANGE_HEX), guidString, field, typeStr, iValue, value);
|
||||||
PSendSysMessage(LANG_CHANGE_HEX_FIELD, guid.GetString().c_str(), field, typeStr, iValue, value);
|
PSendSysMessage(LANG_CHANGE_HEX_FIELD, guidString, field, typeStr, iValue, value);
|
||||||
break;
|
break;
|
||||||
case 3: // &= bit and
|
case 3: // &= bit and
|
||||||
value &= iValue;
|
value &= iValue;
|
||||||
DEBUG_LOG(GetMangosString(LANG_CHANGE_HEX), guid.GetString().c_str(), field, typeStr, iValue, value);
|
DEBUG_LOG(GetMangosString(LANG_CHANGE_HEX), guidString, field, typeStr, iValue, value);
|
||||||
PSendSysMessage(LANG_CHANGE_HEX_FIELD, guid.GetString().c_str(), field, typeStr, iValue, value);
|
PSendSysMessage(LANG_CHANGE_HEX_FIELD, guidString, field, typeStr, iValue, value);
|
||||||
break;
|
break;
|
||||||
case 4: // &=~ bit and not
|
case 4: // &=~ bit and not
|
||||||
value &= ~iValue;
|
value &= ~iValue;
|
||||||
DEBUG_LOG(GetMangosString(LANG_CHANGE_HEX), guid.GetString().c_str(), field, typeStr, iValue, value);
|
DEBUG_LOG(GetMangosString(LANG_CHANGE_HEX), guidString, field, typeStr, iValue, value);
|
||||||
PSendSysMessage(LANG_CHANGE_HEX_FIELD, guid.GetString().c_str(), field, typeStr, iValue, value);
|
PSendSysMessage(LANG_CHANGE_HEX_FIELD, guidString, field, typeStr, iValue, value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature& owner)
|
||||||
Movement::MoveSplineInit init(owner);
|
Movement::MoveSplineInit init(owner);
|
||||||
float x, y, z, o;
|
float x, y, z, o;
|
||||||
// at apply we can select more nice return points base at current movegen
|
// at apply we can select more nice return points base at current movegen
|
||||||
if (owner.GetMotionMaster()->empty() || !owner.GetMotionMaster()->top()->GetResetPosition(owner, x, y, z))
|
if (owner.GetMotionMaster()->empty() || !owner.GetMotionMaster()->top()->GetResetPosition(owner, x, y, z, o))
|
||||||
{
|
{
|
||||||
owner.GetRespawnCoord(x, y, z, &o);
|
owner.GetRespawnCoord(x, y, z, &o);
|
||||||
init.SetFacing(o);
|
init.SetFacing(o);
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,8 @@ class MotionMaster : private std::stack<MovementGenerator*>
|
||||||
|
|
||||||
void Initialize();
|
void Initialize();
|
||||||
|
|
||||||
|
MovementGenerator const* GetCurrent() const { return top(); }
|
||||||
|
|
||||||
MovementGenerator* operator->(void) { return top(); }
|
MovementGenerator* operator->(void) { return top(); }
|
||||||
|
|
||||||
using Impl::top;
|
using Impl::top;
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ class MovementGenerator
|
||||||
virtual void unitSpeedChanged() { }
|
virtual void unitSpeedChanged() { }
|
||||||
|
|
||||||
// used by Evade code for select point to evade with expected restart default movement
|
// used by Evade code for select point to evade with expected restart default movement
|
||||||
virtual bool GetResetPosition(Unit&, float& /*x*/, float& /*y*/, float& /*z*/) const { return false; }
|
virtual bool GetResetPosition(Unit&, float& /*x*/, float& /*y*/, float& /*z*/, float& o) const { return false; }
|
||||||
|
|
||||||
// given destination unreachable? due to pathfinsing or other
|
// given destination unreachable? due to pathfinsing or other
|
||||||
virtual bool IsReachable() const { return true; }
|
virtual bool IsReachable() const { return true; }
|
||||||
|
|
@ -70,7 +70,7 @@ class MovementGenerator
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T, class D>
|
template<class T, class D>
|
||||||
class MovementGeneratorMedium : public MovementGenerator
|
class MANGOS_DLL_SPEC MovementGeneratorMedium : public MovementGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void Initialize(Unit& u) override
|
void Initialize(Unit& u) override
|
||||||
|
|
@ -98,10 +98,10 @@ class MovementGeneratorMedium : public MovementGenerator
|
||||||
// u->AssertIsType<T>();
|
// u->AssertIsType<T>();
|
||||||
return (static_cast<D*>(this))->Update(*((T*)&u), time_diff);
|
return (static_cast<D*>(this))->Update(*((T*)&u), time_diff);
|
||||||
}
|
}
|
||||||
bool GetResetPosition(Unit& u, float& x, float& y, float& z) const override
|
bool GetResetPosition(Unit& u, float& x, float& y, float& z, float& o) const override
|
||||||
{
|
{
|
||||||
// u->AssertIsType<T>();
|
// u->AssertIsType<T>();
|
||||||
return (static_cast<D const*>(this))->GetResetPosition(*((T*)&u), x, y, z);
|
return (static_cast<D const*>(this))->GetResetPosition(*((T*)&u), x, y, z, o);
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
// Will not link if not overridden in the generators
|
// Will not link if not overridden in the generators
|
||||||
|
|
@ -112,7 +112,7 @@ class MovementGeneratorMedium : public MovementGenerator
|
||||||
bool Update(T& u, const uint32& time_diff);
|
bool Update(T& u, const uint32& time_diff);
|
||||||
|
|
||||||
// not need always overwrites
|
// not need always overwrites
|
||||||
bool GetResetPosition(T& /*u*/, float& /*x*/, float& /*y*/, float& /*z*/) const { return false; }
|
bool GetResetPosition(T& /*u*/, float& /*x*/, float& /*y*/, float& /*z*/, float& /*o*/) const { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SelectableMovement : public FactoryHolder<MovementGenerator, MovementGeneratorType>
|
struct SelectableMovement : public FactoryHolder<MovementGenerator, MovementGeneratorType>
|
||||||
|
|
|
||||||
|
|
@ -101,10 +101,11 @@ class PathFinder
|
||||||
const dtNavMeshQuery* m_navMeshQuery; // the nav mesh query used to find the path
|
const dtNavMeshQuery* m_navMeshQuery; // the nav mesh query used to find the path
|
||||||
|
|
||||||
dtQueryFilter m_filter; // use single filter for all movements, update it when needed
|
dtQueryFilter m_filter; // use single filter for all movements, update it when needed
|
||||||
|
|
||||||
|
|
||||||
void setStartPosition(const Vector3 &point) { m_startPosition = point; }
|
void setStartPosition(const Vector3& point) { m_startPosition = point; }
|
||||||
void setEndPosition(const Vector3 &point) { m_actualEndPosition = point; m_endPosition = point; }
|
void setEndPosition(const Vector3& point) { m_actualEndPosition = point; m_endPosition = point; }
|
||||||
void setActualEndPosition(const Vector3 &point) { m_actualEndPosition = point; }
|
void setActualEndPosition(const Vector3& point) { m_actualEndPosition = point; }
|
||||||
|
|
||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -317,11 +317,11 @@ void FollowMovementGenerator<T>::Reset(T& owner)
|
||||||
|
|
||||||
// This factor defines how much of the bounding-radius (as measurement of size) will be used for recalculating a new following position
|
// This factor defines how much of the bounding-radius (as measurement of size) will be used for recalculating a new following position
|
||||||
// The smaller, the more micro movement, the bigger, possibly no proper movement updates
|
// The smaller, the more micro movement, the bigger, possibly no proper movement updates
|
||||||
#define FOLLOW_RECALCULATE_FACTOR 0.1f
|
#define FOLLOW_RECALCULATE_FACTOR 1.0f
|
||||||
// This factor defines when the distance of a follower will have impact onto following-position updates
|
// This factor defines when the distance of a follower will have impact onto following-position updates
|
||||||
#define FOLLOW_DIST_GAP_FOR_DIST_FACTOR 3.0f
|
#define FOLLOW_DIST_GAP_FOR_DIST_FACTOR 3.0f
|
||||||
// This factor defines how much of the follow-distance will be used as sloppyness value (if the above distance is exceeded)
|
// This factor defines how much of the follow-distance will be used as sloppyness value (if the above distance is exceeded)
|
||||||
#define FOLLOW_DIST_RECALCULATE_FACTOR 0.1f
|
#define FOLLOW_DIST_RECALCULATE_FACTOR 1.0f
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
float FollowMovementGenerator<T>::GetDynamicTargetDistance(T& owner, bool forRangeCheck) const
|
float FollowMovementGenerator<T>::GetDynamicTargetDistance(T& owner, bool forRangeCheck) const
|
||||||
|
|
|
||||||
|
|
@ -38,40 +38,35 @@
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
//-----------------------------------------------//
|
//-----------------------------------------------//
|
||||||
void WaypointMovementGenerator<Creature>::LoadPath(Creature& creature)
|
void WaypointMovementGenerator<Creature>::LoadPath(Creature& creature, int32 pathId, WaypointPathOrigin wpOrigin, uint32 overwriteEntry)
|
||||||
{
|
{
|
||||||
DETAIL_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "LoadPath: loading waypoint path for %s", creature.GetGuidStr().c_str());
|
DETAIL_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "LoadPath: loading waypoint path for %s", creature.GetGuidStr().c_str());
|
||||||
|
|
||||||
i_path = sWaypointMgr.GetPath(creature.GetGUIDLow());
|
if (!overwriteEntry)
|
||||||
|
overwriteEntry = creature.GetEntry();
|
||||||
|
|
||||||
// We may LoadPath() for several occasions:
|
if (wpOrigin == PATH_NO_PATH && pathId == 0)
|
||||||
|
i_path = sWaypointMgr.GetDefaultPath(overwriteEntry, creature.GetGUIDLow(), &m_PathOrigin);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_PathOrigin = wpOrigin == PATH_NO_PATH ? PATH_FROM_ENTRY : wpOrigin;
|
||||||
|
i_path = sWaypointMgr.GetPathFromOrigin(overwriteEntry, creature.GetGUIDLow(), pathId, m_PathOrigin);
|
||||||
|
}
|
||||||
|
m_pathId = pathId;
|
||||||
|
|
||||||
// 1: When creature.MovementType=2
|
// No movement found for entry nor guid
|
||||||
// 1a) Path is selected by creature.guid == creature_movement.id
|
|
||||||
// 1b) Path for 1a) does not exist and then use path from creature.GetEntry() == creature_movement_template.entry
|
|
||||||
|
|
||||||
// 2: When creature_template.MovementType=2
|
|
||||||
// 2a) Creature is summoned and has creature_template.MovementType=2
|
|
||||||
// Creators need to be sure that creature_movement_template is always valid for summons.
|
|
||||||
// Mob that can be summoned anywhere should not have creature_movement_template for example.
|
|
||||||
|
|
||||||
// No movement found for guid
|
|
||||||
if (!i_path)
|
if (!i_path)
|
||||||
{
|
{
|
||||||
i_path = sWaypointMgr.GetPathTemplate(creature.GetEntry());
|
if (m_PathOrigin == PATH_FROM_EXTERNAL)
|
||||||
|
sLog.outErrorScriptLib("WaypointMovementGenerator::LoadPath: %s doesn't have waypoint path %i", creature.GetGuidStr().c_str(), pathId);
|
||||||
// No movement found for entry
|
else
|
||||||
if (!i_path)
|
sLog.outErrorDb("WaypointMovementGenerator::LoadPath: %s doesn't have waypoint path %i", creature.GetGuidStr().c_str(), pathId);
|
||||||
{
|
return;
|
||||||
sLog.outErrorDb("WaypointMovementGenerator::LoadPath: creature %s (Entry: %u GUID: %u) doesn't have waypoint path",
|
|
||||||
creature.GetName(), creature.GetEntry(), creature.GetGUIDLow());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize the i_currentNode to point to the first node
|
|
||||||
if (i_path->empty())
|
if (i_path->empty())
|
||||||
return;
|
return;
|
||||||
|
// Initialize the i_currentNode to point to the first node
|
||||||
i_currentNode = i_path->begin()->first;
|
i_currentNode = i_path->begin()->first;
|
||||||
m_lastReachedWaypoint = 0;
|
m_lastReachedWaypoint = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -80,10 +75,6 @@ void WaypointMovementGenerator<Creature>::Initialize(Creature& creature)
|
||||||
{
|
{
|
||||||
creature.addUnitState(UNIT_STAT_ROAMING);
|
creature.addUnitState(UNIT_STAT_ROAMING);
|
||||||
creature.clearUnitState(UNIT_STAT_WAYPOINT_PAUSED);
|
creature.clearUnitState(UNIT_STAT_WAYPOINT_PAUSED);
|
||||||
|
|
||||||
LoadPath(creature);
|
|
||||||
|
|
||||||
StartMoveNow(creature);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaypointMovementGenerator<Creature>::Finalize(Creature& creature)
|
void WaypointMovementGenerator<Creature>::Finalize(Creature& creature)
|
||||||
|
|
@ -158,23 +149,16 @@ void WaypointMovementGenerator<Creature>::OnArrived(Creature& creature)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MangosStringLocale const* textData = sObjectMgr.GetMangosStringLocale(textId))
|
if (MangosStringLocale const* textData = sObjectMgr.GetMangosStringLocale(textId))
|
||||||
creature.MonsterText(textData, nullptr);
|
creature.MonsterText(textData, NULL);
|
||||||
else
|
else
|
||||||
sLog.outErrorDb("%s reached waypoint %u, attempted to do text %i, but required text-data could not be found", creature.GetGuidStr().c_str(), i_currentNode, textId);
|
sLog.outErrorDb("%s reached waypoint %u, attempted to do text %i, but required text-data could not be found", creature.GetGuidStr().c_str(), i_currentNode, textId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inform script
|
// Inform script
|
||||||
MovementInform(creature);
|
|
||||||
Stop(node.delay);
|
Stop(node.delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaypointMovementGenerator<Creature>::StartMoveNow(Creature& creature)
|
|
||||||
{
|
|
||||||
i_nextMoveTime.Reset(0);
|
|
||||||
StartMove(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
void WaypointMovementGenerator<Creature>::StartMove(Creature& creature)
|
void WaypointMovementGenerator<Creature>::StartMove(Creature& creature)
|
||||||
{
|
{
|
||||||
if (!i_path || i_path->empty())
|
if (!i_path || i_path->empty())
|
||||||
|
|
@ -254,13 +238,7 @@ bool WaypointMovementGenerator<Creature>::Update(Creature& creature, const uint3
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaypointMovementGenerator<Creature>::MovementInform(Creature& creature)
|
bool WaypointMovementGenerator<Creature>::GetResetPosition(Creature&, float& x, float& y, float& z, float& o) const
|
||||||
{
|
|
||||||
if (creature.AI())
|
|
||||||
creature.AI()->MovementInform(WAYPOINT_MOTION_TYPE, i_currentNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool WaypointMovementGenerator<Creature>::GetResetPosition(Creature&, float& x, float& y, float& z) const
|
|
||||||
{
|
{
|
||||||
// prevent a crash at empty waypoint path.
|
// prevent a crash at empty waypoint path.
|
||||||
if (!i_path || i_path->empty())
|
if (!i_path || i_path->empty())
|
||||||
|
|
@ -271,9 +249,34 @@ bool WaypointMovementGenerator<Creature>::GetResetPosition(Creature&, float& x,
|
||||||
if (!m_lastReachedWaypoint && lastPoint == i_path->end())
|
if (!m_lastReachedWaypoint && lastPoint == i_path->end())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
MANGOS_ASSERT(lastPoint != i_path->end());
|
MANGOS_ASSERT(lastPoint != i_path->end());
|
||||||
|
|
||||||
|
WaypointNode const* curWP = &(lastPoint->second);
|
||||||
|
|
||||||
|
x = curWP->x;
|
||||||
|
y = curWP->y;
|
||||||
|
z = curWP->z;
|
||||||
|
|
||||||
|
if (curWP->orientation != 100)
|
||||||
|
o = curWP->orientation;
|
||||||
|
else // Calculate the resulting angle based on positions between previous and current waypoint
|
||||||
|
{
|
||||||
|
WaypointNode const* prevWP;
|
||||||
|
if (lastPoint != i_path->begin()) // Not the first waypoint
|
||||||
|
{
|
||||||
|
--lastPoint;
|
||||||
|
prevWP = &(lastPoint->second);
|
||||||
|
}
|
||||||
|
else // Take the last waypoint (crbegin()) as previous
|
||||||
|
prevWP = &(i_path->rbegin()->second);
|
||||||
|
|
||||||
|
float dx = x - prevWP->x;
|
||||||
|
float dy = y - prevWP->y;
|
||||||
|
o = atan2(dy, dx); // returns value between -Pi..Pi
|
||||||
|
|
||||||
|
o = (o >= 0) ? o : 2 * M_PI_F + o;
|
||||||
|
}
|
||||||
|
|
||||||
x = lastPoint->second.x; y = lastPoint->second.y; z = lastPoint->second.z;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -418,9 +421,12 @@ void FlightPathMovementGenerator::DoEventIfAny(Player& player, TaxiPathNodeEntry
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FlightPathMovementGenerator::GetResetPosition(Player&, float& x, float& y, float& z) const
|
bool FlightPathMovementGenerator::GetResetPosition(Player&, float& x, float& y, float& z, float& o) const
|
||||||
{
|
{
|
||||||
const TaxiPathNodeEntry& node = (*i_path)[i_currentNode];
|
const TaxiPathNodeEntry& node = (*i_path)[i_currentNode];
|
||||||
x = node.x; y = node.y; z = node.z;
|
x = node.x;
|
||||||
|
y = node.y;
|
||||||
|
z = node.z;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
#define STOP_TIME_FOR_PLAYER (3 * MINUTE * IN_MILLISECONDS) // 3 Minutes
|
#define STOP_TIME_FOR_PLAYER (3 * MINUTE * IN_MILLISECONDS) // 3 Minutes
|
||||||
|
|
||||||
template<class T, class P>
|
template<class T, class P>
|
||||||
class PathMovementBase
|
class MANGOS_DLL_SPEC PathMovementBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PathMovementBase() : i_currentNode(0) {}
|
PathMovementBase() : i_currentNode(0) {}
|
||||||
|
|
@ -66,9 +66,9 @@ template<class T>
|
||||||
class WaypointMovementGenerator;
|
class WaypointMovementGenerator;
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
class WaypointMovementGenerator<Creature>
|
class MANGOS_DLL_SPEC WaypointMovementGenerator<Creature>
|
||||||
: public MovementGeneratorMedium< Creature, WaypointMovementGenerator<Creature> >,
|
: public MovementGeneratorMedium< Creature, WaypointMovementGenerator<Creature> >,
|
||||||
public PathMovementBase<Creature, WaypointPath const*>
|
public PathMovementBase<Creature, WaypointPath const*>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WaypointMovementGenerator(Creature&) : i_nextMoveTime(0), m_isArrivalDone(false), m_lastReachedWaypoint(0) {}
|
WaypointMovementGenerator(Creature&) : i_nextMoveTime(0), m_isArrivalDone(false), m_lastReachedWaypoint(0) {}
|
||||||
|
|
@ -78,21 +78,21 @@ class WaypointMovementGenerator<Creature>
|
||||||
void Finalize(Creature&);
|
void Finalize(Creature&);
|
||||||
void Reset(Creature& u);
|
void Reset(Creature& u);
|
||||||
bool Update(Creature& u, const uint32& diff);
|
bool Update(Creature& u, const uint32& diff);
|
||||||
|
void InitializeWaypointPath(Creature& u, int32 id, WaypointPathOrigin wpSource, uint32 initialDelay, uint32 overwriteEntry);
|
||||||
void MovementInform(Creature&);
|
|
||||||
|
|
||||||
MovementGeneratorType GetMovementGeneratorType() const { return WAYPOINT_MOTION_TYPE; }
|
MovementGeneratorType GetMovementGeneratorType() const { return WAYPOINT_MOTION_TYPE; }
|
||||||
|
|
||||||
// now path movement implmementation
|
bool GetResetPosition(Creature&, float& /*x*/, float& /*y*/, float& /*z*/, float& /*o*/) const;
|
||||||
void LoadPath(Creature& c);
|
uint32 getLastReachedWaypoint() const { return m_lastReachedWaypoint; }
|
||||||
|
void GetPathInformation(int32& pathId, WaypointPathOrigin& wpOrigin) const { pathId = m_pathId; wpOrigin = m_PathOrigin; }
|
||||||
bool GetResetPosition(Creature&, float& x, float& y, float& z) const;
|
void GetPathInformation(std::ostringstream& oss) const;
|
||||||
|
|
||||||
void AddToWaypointPauseTime(int32 waitTimeDiff);
|
void AddToWaypointPauseTime(int32 waitTimeDiff);
|
||||||
|
bool SetNextWaypoint(uint32 pointId);
|
||||||
uint32 getLastReachedWaypoint() const { return m_lastReachedWaypoint; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void LoadPath(Creature& c, int32 id, WaypointPathOrigin wpOrigin, uint32 overwriteEntry);
|
||||||
|
|
||||||
void Stop(int32 time) { i_nextMoveTime.Reset(time); }
|
void Stop(int32 time) { i_nextMoveTime.Reset(time); }
|
||||||
bool Stopped(Creature& u);
|
bool Stopped(Creature& u);
|
||||||
bool CanMove(int32 diff, Creature& u);
|
bool CanMove(int32 diff, Creature& u);
|
||||||
|
|
@ -100,11 +100,12 @@ class WaypointMovementGenerator<Creature>
|
||||||
void OnArrived(Creature&);
|
void OnArrived(Creature&);
|
||||||
void StartMove(Creature&);
|
void StartMove(Creature&);
|
||||||
|
|
||||||
void StartMoveNow(Creature& creature);
|
|
||||||
|
|
||||||
ShortTimeTracker i_nextMoveTime;
|
ShortTimeTracker i_nextMoveTime;
|
||||||
bool m_isArrivalDone;
|
bool m_isArrivalDone;
|
||||||
uint32 m_lastReachedWaypoint;
|
uint32 m_lastReachedWaypoint;
|
||||||
|
|
||||||
|
int32 m_pathId;
|
||||||
|
WaypointPathOrigin m_PathOrigin;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** FlightPathMovementGenerator generates movement of the player for the paths
|
/** FlightPathMovementGenerator generates movement of the player for the paths
|
||||||
|
|
@ -133,7 +134,7 @@ class FlightPathMovementGenerator
|
||||||
void SetCurrentNodeAfterTeleport();
|
void SetCurrentNodeAfterTeleport();
|
||||||
void SkipCurrentNode() { ++i_currentNode; }
|
void SkipCurrentNode() { ++i_currentNode; }
|
||||||
void DoEventIfAny(Player& player, TaxiPathNodeEntry const& node, bool departure);
|
void DoEventIfAny(Player& player, TaxiPathNodeEntry const& node, bool departure);
|
||||||
bool GetResetPosition(Player&, float& x, float& y, float& z) const;
|
bool GetResetPosition(Player&, float& x, float& y, float& z, float& o) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ AggressorAI::IsVisible(Unit* pl) const
|
||||||
void
|
void
|
||||||
AggressorAI::AttackStart(Unit* u)
|
AggressorAI::AttackStart(Unit* u)
|
||||||
{
|
{
|
||||||
if (!u)
|
if (!u || !m_creature->CanAttackByItself())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_creature->Attack(u, true))
|
if (m_creature->Attack(u, true))
|
||||||
|
|
|
||||||
|
|
@ -351,8 +351,6 @@ void ArenaTeam::Disband(WorldSession* session)
|
||||||
|
|
||||||
void ArenaTeam::Roster(WorldSession* session)
|
void ArenaTeam::Roster(WorldSession* session)
|
||||||
{
|
{
|
||||||
Player* pl = NULL;
|
|
||||||
|
|
||||||
uint8 unk308 = 0;
|
uint8 unk308 = 0;
|
||||||
|
|
||||||
WorldPacket data(SMSG_ARENA_TEAM_ROSTER, 100);
|
WorldPacket data(SMSG_ARENA_TEAM_ROSTER, 100);
|
||||||
|
|
@ -363,7 +361,7 @@ void ArenaTeam::Roster(WorldSession* session)
|
||||||
|
|
||||||
for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||||
{
|
{
|
||||||
pl = sObjectMgr.GetPlayer(itr->guid);
|
Player* pl = sObjectMgr.GetPlayer(itr->guid);
|
||||||
|
|
||||||
data << itr->guid; // guid
|
data << itr->guid; // guid
|
||||||
data << uint8((pl ? 1 : 0)); // online flag
|
data << uint8((pl ? 1 : 0)); // online flag
|
||||||
|
|
|
||||||
|
|
@ -353,7 +353,7 @@ void CalendarMgr::RemoveEvent(uint64 eventId, Player* remover)
|
||||||
// Add invit to an event and inform client
|
// Add invit to an event and inform client
|
||||||
// some check done before so it may fail and raison is sent to client
|
// some check done before so it may fail and raison is sent to client
|
||||||
// return value is the CalendarInvite pointer on success
|
// return value is the CalendarInvite pointer on success
|
||||||
CalendarInvite* CalendarMgr::AddInvite(CalendarEvent* event, ObjectGuid const& senderGuid, ObjectGuid const& inviteeGuid, CalendarInviteStatus status, CalendarModerationRank rank, std::string text, time_t statusTime)
|
CalendarInvite* CalendarMgr::AddInvite(CalendarEvent* event, ObjectGuid const& senderGuid, ObjectGuid const& inviteeGuid, CalendarInviteStatus status, CalendarModerationRank rank, const std::string& text, time_t statusTime)
|
||||||
{
|
{
|
||||||
Player* sender = sObjectMgr.GetPlayer(senderGuid);
|
Player* sender = sObjectMgr.GetPlayer(senderGuid);
|
||||||
if (!event || !sender)
|
if (!event || !sender)
|
||||||
|
|
@ -481,7 +481,7 @@ void CalendarMgr::CopyEvent(uint64 eventId, time_t newTime, ObjectGuid const& gu
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (newEvent->IsGuildAnnouncement())
|
if (newEvent->IsGuildAnnouncement())
|
||||||
AddInvite(newEvent, guid, guid, CALENDAR_STATUS_CONFIRMED, CALENDAR_RANK_OWNER, "", time(NULL));
|
AddInvite(newEvent, guid, guid, CALENDAR_STATUS_CONFIRMED, CALENDAR_RANK_OWNER, "", time(nullptr));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// copy all invitees, set new owner as the one who make the copy, set invitees status to invited
|
// copy all invitees, set new owner as the one who make the copy, set invitees status to invited
|
||||||
|
|
@ -490,18 +490,19 @@ void CalendarMgr::CopyEvent(uint64 eventId, time_t newTime, ObjectGuid const& gu
|
||||||
|
|
||||||
while (ci_itr != cInvMap->end())
|
while (ci_itr != cInvMap->end())
|
||||||
{
|
{
|
||||||
if (ci_itr->second->InviteeGuid == guid)
|
const CalendarInvite* invite = ci_itr->second;
|
||||||
|
if (invite->InviteeGuid == guid)
|
||||||
{
|
{
|
||||||
AddInvite(newEvent, guid, ci_itr->second->InviteeGuid, CALENDAR_STATUS_CONFIRMED, CALENDAR_RANK_OWNER, "", time(NULL));
|
AddInvite(newEvent, guid, invite->InviteeGuid, CALENDAR_STATUS_CONFIRMED, CALENDAR_RANK_OWNER, "", time(nullptr));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CalendarModerationRank rank = CALENDAR_RANK_PLAYER;
|
CalendarModerationRank rank = CALENDAR_RANK_PLAYER;
|
||||||
// copy moderator rank
|
// copy moderator rank
|
||||||
if (ci_itr->second->Rank == CALENDAR_RANK_MODERATOR)
|
if (invite->Rank == CALENDAR_RANK_MODERATOR)
|
||||||
rank = CALENDAR_RANK_MODERATOR;
|
rank = CALENDAR_RANK_MODERATOR;
|
||||||
|
|
||||||
AddInvite(newEvent, guid, ci_itr->second->InviteeGuid, CALENDAR_STATUS_INVITED, rank, "", time(NULL));
|
AddInvite(newEvent, guid, invite->InviteeGuid, CALENDAR_STATUS_INVITED, rank, "", time(nullptr));
|
||||||
}
|
}
|
||||||
++ci_itr;
|
++ci_itr;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -234,8 +234,8 @@ class CalendarMgr
|
||||||
|
|
||||||
CalendarEvent* AddEvent(ObjectGuid const& guid, std::string title, std::string description, uint32 type, uint32 repeatable, uint32 maxInvites,
|
CalendarEvent* AddEvent(ObjectGuid const& guid, std::string title, std::string description, uint32 type, uint32 repeatable, uint32 maxInvites,
|
||||||
int32 dungeonId, time_t eventTime, time_t unkTime, uint32 flags);
|
int32 dungeonId, time_t eventTime, time_t unkTime, uint32 flags);
|
||||||
|
|
||||||
CalendarInvite* AddInvite(CalendarEvent* event, ObjectGuid const& senderGuid, ObjectGuid const& inviteeGuid, CalendarInviteStatus status, CalendarModerationRank rank, std::string text, time_t statusTime);
|
CalendarInvite* AddInvite(CalendarEvent* event, ObjectGuid const& senderGuid, ObjectGuid const& inviteeGuid, CalendarInviteStatus status, CalendarModerationRank rank, const std::string& text, time_t statusTime);
|
||||||
|
|
||||||
void RemoveEvent(uint64 eventId, Player* remover);
|
void RemoveEvent(uint64 eventId, Player* remover);
|
||||||
bool RemoveInvite(uint64 eventId, uint64 inviteId, ObjectGuid const& removerGuid);
|
bool RemoveInvite(uint64 eventId, uint64 inviteId, ObjectGuid const& removerGuid);
|
||||||
|
|
|
||||||
|
|
@ -168,8 +168,7 @@ Creature::Creature(CreatureSubtype subtype) : Unit(),
|
||||||
m_corpseDecayTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_aggroDelay(0), m_respawnradius(5.0f),
|
m_corpseDecayTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_aggroDelay(0), m_respawnradius(5.0f),
|
||||||
m_subtype(subtype), m_defaultMovementType(IDLE_MOTION_TYPE), m_equipmentId(0),
|
m_subtype(subtype), m_defaultMovementType(IDLE_MOTION_TYPE), m_equipmentId(0),
|
||||||
m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false),
|
m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false),
|
||||||
m_regenHealth(true), m_AI_locked(false), m_IsDeadByDefault(false),
|
m_AI_locked(false), m_IsDeadByDefault(false), m_temporaryFactionFlags(TEMPFACTION_NONE),
|
||||||
m_temporaryFactionFlags(TEMPFACTION_NONE),
|
|
||||||
m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL), m_originalEntry(0),
|
m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL), m_originalEntry(0),
|
||||||
m_creatureInfo(NULL)
|
m_creatureInfo(NULL)
|
||||||
{
|
{
|
||||||
|
|
@ -252,6 +251,12 @@ void Creature::RemoveCorpse()
|
||||||
if (AI())
|
if (AI())
|
||||||
{ AI()->CorpseRemoved(respawnDelay); }
|
{ AI()->CorpseRemoved(respawnDelay); }
|
||||||
|
|
||||||
|
if (m_isCreatureLinkingTrigger)
|
||||||
|
GetMap()->GetCreatureLinkingHolder()->DoCreatureLinkingEvent(LINKING_EVENT_DESPAWN, this);
|
||||||
|
|
||||||
|
if (InstanceData* mapInstance = GetInstanceData())
|
||||||
|
mapInstance->OnCreatureDespawn(this);
|
||||||
|
|
||||||
// script can set time (in seconds) explicit, override the original
|
// script can set time (in seconds) explicit, override the original
|
||||||
if (respawnDelay)
|
if (respawnDelay)
|
||||||
{ m_respawnTime = time(NULL) + respawnDelay; }
|
{ m_respawnTime = time(NULL) + respawnDelay; }
|
||||||
|
|
@ -335,6 +340,24 @@ bool Creature::InitEntry(uint32 Entry, CreatureData const* data /*=NULL*/, GameE
|
||||||
|
|
||||||
SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender);
|
SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender);
|
||||||
|
|
||||||
|
// set PowerType based on unit class
|
||||||
|
switch (cinfo->UnitClass)
|
||||||
|
{
|
||||||
|
case CLASS_WARRIOR:
|
||||||
|
SetPowerType(POWER_RAGE);
|
||||||
|
break;
|
||||||
|
case CLASS_PALADIN:
|
||||||
|
case CLASS_MAGE:
|
||||||
|
SetPowerType(POWER_MANA);
|
||||||
|
break;
|
||||||
|
case CLASS_ROGUE:
|
||||||
|
SetPowerType(POWER_ENERGY);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
sLog.outErrorDb("Creature (Entry: %u) has unhandled unit class. Power type will not be set!", Entry);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Load creature equipment
|
// Load creature equipment
|
||||||
if (eventData && eventData->equipment_id)
|
if (eventData && eventData->equipment_id)
|
||||||
{
|
{
|
||||||
|
|
@ -663,33 +686,68 @@ void Creature::RegenerateAll(uint32 update_diff)
|
||||||
if (!IsInCombat() || IsPolymorphed())
|
if (!IsInCombat() || IsPolymorphed())
|
||||||
RegenerateHealth();
|
RegenerateHealth();
|
||||||
|
|
||||||
RegenerateMana();
|
RegeneratePower();
|
||||||
|
|
||||||
m_regenTimer = REGEN_TIME_FULL;
|
m_regenTimer = REGEN_TIME_FULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature::RegenerateMana()
|
void Creature::RegeneratePower()
|
||||||
{
|
{
|
||||||
uint32 curValue = GetPower(POWER_MANA);
|
if (!IsRegeneratingPower())
|
||||||
uint32 maxValue = GetMaxPower(POWER_MANA);
|
return;
|
||||||
|
|
||||||
|
Powers powerType = GetPowerType();
|
||||||
|
uint32 curValue = GetPower(powerType);
|
||||||
|
uint32 maxValue = GetMaxPower(powerType);
|
||||||
|
|
||||||
if (curValue >= maxValue)
|
if (curValue >= maxValue)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32 addvalue = 0;
|
float addValue = 0.0f;
|
||||||
|
|
||||||
// Combat and any controlled creature
|
switch (powerType)
|
||||||
if (IsInCombat() || GetCharmerOrOwnerGuid())
|
|
||||||
{
|
{
|
||||||
float ManaIncreaseRate = sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_MANA);
|
case POWER_MANA:
|
||||||
float Spirit = GetStat(STAT_SPIRIT);
|
// Combat and any controlled creature
|
||||||
|
if (IsInCombat() || GetCharmerOrOwnerGuid())
|
||||||
|
{
|
||||||
|
float ManaIncreaseRate = sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_MANA);
|
||||||
|
float Spirit = GetStat(STAT_SPIRIT);
|
||||||
|
|
||||||
addvalue = uint32((Spirit / 5.0f + 17.0f) * ManaIncreaseRate);
|
addValue = uint32(Spirit / 5.0f + 17.0f) * ManaIncreaseRate;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
addValue = maxValue / 3.0f;
|
||||||
|
break;
|
||||||
|
case POWER_ENERGY:
|
||||||
|
// ToDo: for vehicle this is different - NEEDS TO BE FIXED!
|
||||||
|
addValue = 20 * sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_ENERGY);
|
||||||
|
break;
|
||||||
|
case POWER_FOCUS:
|
||||||
|
addValue = 24 * sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_FOCUS);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
addvalue = maxValue / 3;
|
|
||||||
|
|
||||||
ModifyPower(POWER_MANA, addvalue);
|
// Apply modifiers (if any)
|
||||||
|
AuraList const& ModPowerRegenAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN);
|
||||||
|
for (AuraList::const_iterator i = ModPowerRegenAuras.begin(); i != ModPowerRegenAuras.end(); ++i)
|
||||||
|
{
|
||||||
|
Modifier const* modifier = (*i)->GetModifier();
|
||||||
|
if (modifier->m_miscvalue == int32(powerType))
|
||||||
|
addValue += modifier->m_amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
|
||||||
|
for (AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
|
||||||
|
{
|
||||||
|
Modifier const* modifier = (*i)->GetModifier();
|
||||||
|
if (modifier->m_miscvalue == int32(powerType))
|
||||||
|
addValue *= (modifier->m_amount + 100) / 100.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
ModifyPower(powerType, int32(addValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature::RegenerateHealth()
|
void Creature::RegenerateHealth()
|
||||||
|
|
@ -1237,12 +1295,12 @@ void Creature::SelectLevel(const CreatureInfo* cinfo, float percentHealth /*= 10
|
||||||
|
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case POWER_MANA: maxValue = mana; break;
|
case POWER_MANA: maxValue = mana; break;
|
||||||
case POWER_RAGE: maxValue = 0; break;
|
case POWER_RAGE: maxValue = 0; break;
|
||||||
case POWER_FOCUS: maxValue = POWER_FOCUS_DEFAULT; break;
|
case POWER_FOCUS: maxValue = POWER_FOCUS_DEFAULT; break;
|
||||||
case POWER_ENERGY: maxValue = POWER_ENERGY_DEFAULT * cinfo->PowerMultiplier; break;
|
case POWER_ENERGY: maxValue = POWER_ENERGY_DEFAULT * cinfo->PowerMultiplier; break;
|
||||||
case POWER_RUNE: maxValue = 0; break;
|
case POWER_RUNE: maxValue = 0; break;
|
||||||
case POWER_RUNIC_POWER: maxValue = 0; break;
|
case POWER_RUNIC_POWER: maxValue = 0; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 value = maxValue;
|
uint32 value = maxValue;
|
||||||
|
|
@ -1313,22 +1371,22 @@ float Creature::_GetDamageMod(int32 Rank)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float Creature::GetSpellDamageMod(int32 Rank)
|
float Creature::_GetSpellDamageMod(int32 Rank)
|
||||||
{
|
{
|
||||||
switch (Rank) // define rates for each elite rank
|
switch (Rank) // define rates for each elite rank
|
||||||
{
|
{
|
||||||
case CREATURE_ELITE_NORMAL:
|
case CREATURE_ELITE_NORMAL:
|
||||||
return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_NORMAL_SPELLDAMAGE);
|
return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_NORMAL_SPELLDAMAGE);
|
||||||
case CREATURE_ELITE_ELITE:
|
case CREATURE_ELITE_ELITE:
|
||||||
return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE);
|
return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE);
|
||||||
case CREATURE_ELITE_RAREELITE:
|
case CREATURE_ELITE_RAREELITE:
|
||||||
return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE);
|
return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE);
|
||||||
case CREATURE_ELITE_WORLDBOSS:
|
case CREATURE_ELITE_WORLDBOSS:
|
||||||
return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE);
|
return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE);
|
||||||
case CREATURE_ELITE_RARE:
|
case CREATURE_ELITE_RARE:
|
||||||
return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_RARE_SPELLDAMAGE);
|
return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_RARE_SPELLDAMAGE);
|
||||||
default:
|
default:
|
||||||
return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE);
|
return sWorld.getConfig(CONFIG_FLOAT_RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1581,7 +1639,7 @@ void Creature::SetDeathState(DeathState s)
|
||||||
if ((s == JUST_DIED && !m_IsDeadByDefault) || (s == JUST_ALIVED && m_IsDeadByDefault))
|
if ((s == JUST_DIED && !m_IsDeadByDefault) || (s == JUST_ALIVED && m_IsDeadByDefault))
|
||||||
{
|
{
|
||||||
m_corpseDecayTimer = m_corpseDelay * IN_MILLISECONDS; // the max/default time for corpse decay (before creature is looted/AllLootRemovedFromCorpse() is called)
|
m_corpseDecayTimer = m_corpseDelay * IN_MILLISECONDS; // the max/default time for corpse decay (before creature is looted/AllLootRemovedFromCorpse() is called)
|
||||||
m_respawnTime = time(NULL) + m_respawnDelay; // respawn delay (spawntimesecs)
|
m_respawnTime = time(nullptr) + m_respawnDelay; // respawn delay (spawntimesecs)
|
||||||
|
|
||||||
// always save boss respawn time at death to prevent crash cheating
|
// always save boss respawn time at death to prevent crash cheating
|
||||||
if (sWorld.getConfig(CONFIG_BOOL_SAVE_RESPAWN_TIME_IMMEDIATELY) || IsWorldBoss())
|
if (sWorld.getConfig(CONFIG_BOOL_SAVE_RESPAWN_TIME_IMMEDIATELY) || IsWorldBoss())
|
||||||
|
|
@ -1614,7 +1672,7 @@ void Creature::SetDeathState(DeathState s)
|
||||||
Unit::SetDeathState(ALIVE);
|
Unit::SetDeathState(ALIVE);
|
||||||
|
|
||||||
SetHealth(GetMaxHealth());
|
SetHealth(GetMaxHealth());
|
||||||
SetLootRecipient(NULL);
|
SetLootRecipient(nullptr);
|
||||||
if (GetTemporaryFactionFlags() & TEMPFACTION_RESTORE_RESPAWN)
|
if (GetTemporaryFactionFlags() & TEMPFACTION_RESTORE_RESPAWN)
|
||||||
ClearTemporaryFaction();
|
ClearTemporaryFaction();
|
||||||
|
|
||||||
|
|
@ -2523,6 +2581,10 @@ void Creature::SetFactionTemporary(uint32 factionId, uint32 tempFactionFlags)
|
||||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||||
if (m_temporaryFactionFlags & TEMPFACTION_TOGGLE_PASSIVE)
|
if (m_temporaryFactionFlags & TEMPFACTION_TOGGLE_PASSIVE)
|
||||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE);
|
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE);
|
||||||
|
if (m_temporaryFactionFlags & TEMPFACTION_TOGGLE_PACIFIED)
|
||||||
|
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||||
|
if (m_temporaryFactionFlags & TEMPFACTION_TOGGLE_NOT_SELECTABLE)
|
||||||
|
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature::ClearTemporaryFaction()
|
void Creature::ClearTemporaryFaction()
|
||||||
|
|
@ -2535,13 +2597,17 @@ void Creature::ClearTemporaryFaction()
|
||||||
|
|
||||||
// Reset to original faction
|
// Reset to original faction
|
||||||
setFaction(GetCreatureInfo()->FactionAlliance);
|
setFaction(GetCreatureInfo()->FactionAlliance);
|
||||||
// Reset UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_OOC_NOT_ATTACKABLE or UNIT_FLAG_PASSIVE flags
|
// Reset UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_OOC_NOT_ATTACKABLE, UNIT_FLAG_PASSIVE, UNIT_FLAG_PACIFIED or UNIT_FLAG_NOT_SELECTABLE flags
|
||||||
if (m_temporaryFactionFlags & TEMPFACTION_TOGGLE_NON_ATTACKABLE && GetCreatureInfo()->UnitFlags & UNIT_FLAG_NON_ATTACKABLE)
|
if (m_temporaryFactionFlags & TEMPFACTION_TOGGLE_NON_ATTACKABLE && GetCreatureInfo()->UnitFlags & UNIT_FLAG_NON_ATTACKABLE)
|
||||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
if (m_temporaryFactionFlags & TEMPFACTION_TOGGLE_OOC_NOT_ATTACK && GetCreatureInfo()->UnitFlags & UNIT_FLAG_OOC_NOT_ATTACKABLE && !IsInCombat())
|
if (m_temporaryFactionFlags & TEMPFACTION_TOGGLE_OOC_NOT_ATTACK && GetCreatureInfo()->UnitFlags & UNIT_FLAG_OOC_NOT_ATTACKABLE && !IsInCombat())
|
||||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||||
if (m_temporaryFactionFlags & TEMPFACTION_TOGGLE_PASSIVE && GetCreatureInfo()->UnitFlags & UNIT_FLAG_PASSIVE)
|
if (m_temporaryFactionFlags & TEMPFACTION_TOGGLE_PASSIVE && GetCreatureInfo()->UnitFlags & UNIT_FLAG_PASSIVE)
|
||||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE);
|
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE);
|
||||||
|
if (m_temporaryFactionFlags & TEMPFACTION_TOGGLE_PACIFIED && GetCreatureInfo()->UnitFlags & UNIT_FLAG_PACIFIED)
|
||||||
|
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||||
|
if (m_temporaryFactionFlags & TEMPFACTION_TOGGLE_NOT_SELECTABLE && GetCreatureInfo()->UnitFlags & UNIT_FLAG_NOT_SELECTABLE)
|
||||||
|
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||||
|
|
||||||
m_temporaryFactionFlags = TEMPFACTION_NONE;
|
m_temporaryFactionFlags = TEMPFACTION_NONE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -612,6 +612,8 @@ enum TemporaryFactionFlags // Used at real fact
|
||||||
TEMPFACTION_TOGGLE_NON_ATTACKABLE = 0x08, // Remove UNIT_FLAG_NON_ATTACKABLE(0x02) when faction is changed (reapply when temp-faction is removed)
|
TEMPFACTION_TOGGLE_NON_ATTACKABLE = 0x08, // Remove UNIT_FLAG_NON_ATTACKABLE(0x02) when faction is changed (reapply when temp-faction is removed)
|
||||||
TEMPFACTION_TOGGLE_OOC_NOT_ATTACK = 0x10, // Remove UNIT_FLAG_OOC_NOT_ATTACKABLE(0x100) when faction is changed (reapply when temp-faction is removed)
|
TEMPFACTION_TOGGLE_OOC_NOT_ATTACK = 0x10, // Remove UNIT_FLAG_OOC_NOT_ATTACKABLE(0x100) when faction is changed (reapply when temp-faction is removed)
|
||||||
TEMPFACTION_TOGGLE_PASSIVE = 0x20, // Remove UNIT_FLAG_PASSIVE(0x200) when faction is changed (reapply when temp-faction is removed)
|
TEMPFACTION_TOGGLE_PASSIVE = 0x20, // Remove UNIT_FLAG_PASSIVE(0x200) when faction is changed (reapply when temp-faction is removed)
|
||||||
|
TEMPFACTION_TOGGLE_PACIFIED = 0x40, // Remove UNIT_FLAG_PACIFIED(0x20000) when faction is changed (reapply when temp-faction is removed)
|
||||||
|
TEMPFACTION_TOGGLE_NOT_SELECTABLE = 0x80, // Remove UNIT_FLAG_NOT_SELECTABLE(0x2000000) when faction is changed (reapply when temp-faction is removed)
|
||||||
TEMPFACTION_ALL,
|
TEMPFACTION_ALL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -732,7 +734,10 @@ class Creature : public Unit
|
||||||
void UpdateAttackPowerAndDamage(bool ranged = false) override;
|
void UpdateAttackPowerAndDamage(bool ranged = false) override;
|
||||||
void UpdateDamagePhysical(WeaponAttackType attType) override;
|
void UpdateDamagePhysical(WeaponAttackType attType) override;
|
||||||
uint32 GetCurrentEquipmentId() { return m_equipmentId; }
|
uint32 GetCurrentEquipmentId() { return m_equipmentId; }
|
||||||
float GetSpellDamageMod(int32 Rank);
|
|
||||||
|
static float _GetHealthMod(int32 Rank); ///< Get custom factor to scale health (default 1, CONFIG_FLOAT_RATE_CREATURE_*_HP)
|
||||||
|
static float _GetDamageMod(int32 Rank); ///< Get custom factor to scale damage (default 1, CONFIG_FLOAT_RATE_*_DAMAGE)
|
||||||
|
static float _GetSpellDamageMod(int32 Rank); ///< Get custom factor to scale spell damage (default 1, CONFIG_FLOAT_RATE_*_SPELLDAMAGE)
|
||||||
|
|
||||||
VendorItemData const* GetVendorItems() const;
|
VendorItemData const* GetVendorItems() const;
|
||||||
VendorItemData const* GetVendorTemplateItems() const;
|
VendorItemData const* GetVendorTemplateItems() const;
|
||||||
|
|
@ -921,9 +926,6 @@ class Creature : public Unit
|
||||||
|
|
||||||
void _RealtimeSetCreatureInfo();
|
void _RealtimeSetCreatureInfo();
|
||||||
|
|
||||||
static float _GetHealthMod(int32 Rank);
|
|
||||||
static float _GetDamageMod(int32 Rank);
|
|
||||||
|
|
||||||
uint32 m_lootMoney;
|
uint32 m_lootMoney;
|
||||||
ObjectGuid m_lootRecipientGuid; // player who will have rights for looting if m_lootGroupRecipient==0 or group disbanded
|
ObjectGuid m_lootRecipientGuid; // player who will have rights for looting if m_lootGroupRecipient==0 or group disbanded
|
||||||
uint32 m_lootGroupRecipientId; // group who will have rights for looting if set and exist
|
uint32 m_lootGroupRecipientId; // group who will have rights for looting if set and exist
|
||||||
|
|
@ -937,7 +939,7 @@ class Creature : public Unit
|
||||||
float m_respawnradius;
|
float m_respawnradius;
|
||||||
|
|
||||||
CreatureSubtype m_subtype; // set in Creatures subclasses for fast it detect without dynamic_cast use
|
CreatureSubtype m_subtype; // set in Creatures subclasses for fast it detect without dynamic_cast use
|
||||||
void RegenerateMana();
|
void RegeneratePower();
|
||||||
void RegenerateHealth();
|
void RegenerateHealth();
|
||||||
MovementGeneratorType m_defaultMovementType;
|
MovementGeneratorType m_defaultMovementType;
|
||||||
Cell m_currentCell; // store current cell where creature listed
|
Cell m_currentCell; // store current cell where creature listed
|
||||||
|
|
@ -946,7 +948,6 @@ class Creature : public Unit
|
||||||
// below fields has potential for optimization
|
// below fields has potential for optimization
|
||||||
bool m_AlreadyCallAssistance;
|
bool m_AlreadyCallAssistance;
|
||||||
bool m_AlreadySearchedAssistance;
|
bool m_AlreadySearchedAssistance;
|
||||||
bool m_regenHealth;
|
|
||||||
bool m_AI_locked;
|
bool m_AI_locked;
|
||||||
bool m_IsDeadByDefault;
|
bool m_IsDeadByDefault;
|
||||||
uint32 m_temporaryFactionFlags; // used for real faction changes (not auras etc)
|
uint32 m_temporaryFactionFlags; // used for real faction changes (not auras etc)
|
||||||
|
|
|
||||||
|
|
@ -154,12 +154,13 @@ void CreatureAI::SetCombatMovement(bool enable, bool stopOrStartMovement /*=fals
|
||||||
|
|
||||||
void CreatureAI::HandleMovementOnAttackStart(Unit* victim)
|
void CreatureAI::HandleMovementOnAttackStart(Unit* victim)
|
||||||
{
|
{
|
||||||
|
MotionMaster* creatureMotion = m_creature->GetMotionMaster();
|
||||||
if (m_isCombatMovement)
|
if (m_isCombatMovement)
|
||||||
m_creature->GetMotionMaster()->MoveChase(victim, m_attackDistance, m_attackAngle);
|
creatureMotion->MoveChase(victim, m_attackDistance, m_attackAngle);
|
||||||
// TODO - adapt this to only stop OOC-MMGens when MotionMaster rewrite is finished
|
// TODO - adapt this to only stop OOC-MMGens when MotionMaster rewrite is finished
|
||||||
else if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE || m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == RANDOM_MOTION_TYPE)
|
else if (creatureMotion->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE || creatureMotion->GetCurrentMovementGeneratorType() == RANDOM_MOTION_TYPE)
|
||||||
{
|
{
|
||||||
m_creature->GetMotionMaster()->MoveIdle();
|
creatureMotion->MoveIdle();
|
||||||
m_creature->StopMoving();
|
m_creature->StopMoving();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -223,10 +224,20 @@ void CreatureAI::SendAIEventAround(AIEventType eventType, Unit* pInvoker, uint32
|
||||||
{
|
{
|
||||||
std::list<Creature*> receiverList;
|
std::list<Creature*> receiverList;
|
||||||
|
|
||||||
// Use this check here to collect only assitable creatures in case of CALL_ASSISTANCE, else be less strict
|
// Allow sending custom AI events to all units in range
|
||||||
MaNGOS::AnyAssistCreatureInRangeCheck u_check(m_creature, eventType == AI_EVENT_CALL_ASSISTANCE ? pInvoker : NULL, fRadius);
|
if (eventType >= AI_EVENT_CUSTOM_EVENTAI_A && eventType <= AI_EVENT_CUSTOM_EVENTAI_F && eventType != AI_EVENT_GOT_CCED)
|
||||||
MaNGOS::CreatureListSearcher<MaNGOS::AnyAssistCreatureInRangeCheck> searcher(receiverList, u_check);
|
{
|
||||||
Cell::VisitGridObjects(m_creature, searcher, fRadius);
|
MaNGOS::AnyUnitInObjectRangeCheck u_check(m_creature, fRadius);
|
||||||
|
MaNGOS::CreatureListSearcher<MaNGOS::AnyUnitInObjectRangeCheck> searcher(receiverList, u_check);
|
||||||
|
Cell::VisitGridObjects(m_creature, searcher, fRadius);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Use this check here to collect only assitable creatures in case of CALL_ASSISTANCE, else be less strict
|
||||||
|
MaNGOS::AnyAssistCreatureInRangeCheck u_check(m_creature, eventType == AI_EVENT_CALL_ASSISTANCE ? pInvoker : NULL, fRadius);
|
||||||
|
MaNGOS::CreatureListSearcher<MaNGOS::AnyAssistCreatureInRangeCheck> searcher(receiverList, u_check);
|
||||||
|
Cell::VisitGridObjects(m_creature, searcher, fRadius);
|
||||||
|
}
|
||||||
|
|
||||||
if (!receiverList.empty())
|
if (!receiverList.empty())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -85,19 +85,23 @@ enum AIEventType
|
||||||
AI_EVENT_CUSTOM_EVENTAI_A = 5, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
|
AI_EVENT_CUSTOM_EVENTAI_A = 5, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
|
||||||
AI_EVENT_CUSTOM_EVENTAI_B = 6, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
|
AI_EVENT_CUSTOM_EVENTAI_B = 6, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
|
||||||
AI_EVENT_GOT_CCED = 7, // Sender = CCed Npc, Invoker = Caster that CCed
|
AI_EVENT_GOT_CCED = 7, // Sender = CCed Npc, Invoker = Caster that CCed
|
||||||
MAXIMAL_AI_EVENT_EVENTAI = 8,
|
AI_EVENT_CUSTOM_EVENTAI_C = 8, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
|
||||||
|
AI_EVENT_CUSTOM_EVENTAI_D = 9, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
|
||||||
|
AI_EVENT_CUSTOM_EVENTAI_E = 10, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
|
||||||
|
AI_EVENT_CUSTOM_EVENTAI_F = 11, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
|
||||||
|
MAXIMAL_AI_EVENT_EVENTAI = 12,
|
||||||
|
|
||||||
// Internal Use
|
// Internal Use
|
||||||
AI_EVENT_CALL_ASSISTANCE = 10, // Sender = Attacked Npc, Invoker = Enemy
|
AI_EVENT_CALL_ASSISTANCE = 13, // Sender = Attacked Npc, Invoker = Enemy
|
||||||
|
|
||||||
// Predefined for SD3
|
// Predefined for SD2
|
||||||
AI_EVENT_START_ESCORT = 100, // Invoker = Escorting Player
|
AI_EVENT_START_ESCORT = 100, // Invoker = Escorting Player
|
||||||
AI_EVENT_START_ESCORT_B = 101, // Invoker = Escorting Player
|
AI_EVENT_START_ESCORT_B = 101, // Invoker = Escorting Player
|
||||||
AI_EVENT_START_EVENT = 102, // Invoker = EventStarter
|
AI_EVENT_START_EVENT = 102, // Invoker = EventStarter
|
||||||
AI_EVENT_START_EVENT_A = 103, // Invoker = EventStarter
|
AI_EVENT_START_EVENT_A = 103, // Invoker = EventStarter
|
||||||
AI_EVENT_START_EVENT_B = 104, // Invoker = EventStarter
|
AI_EVENT_START_EVENT_B = 104, // Invoker = EventStarter
|
||||||
|
|
||||||
// Some IDs for special cases in SD3
|
// Some IDs for special cases in SD2
|
||||||
AI_EVENT_CUSTOM_A = 1000,
|
AI_EVENT_CUSTOM_A = 1000,
|
||||||
AI_EVENT_CUSTOM_B = 1001,
|
AI_EVENT_CUSTOM_B = 1001,
|
||||||
AI_EVENT_CUSTOM_C = 1002,
|
AI_EVENT_CUSTOM_C = 1002,
|
||||||
|
|
|
||||||
|
|
@ -91,16 +91,21 @@ inline bool IsEventFlagsFitForNormalMap(uint8 eFlags)
|
||||||
CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c),
|
CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c),
|
||||||
m_Phase(0),
|
m_Phase(0),
|
||||||
m_MeleeEnabled(true),
|
m_MeleeEnabled(true),
|
||||||
|
m_DynamicMovement(false),
|
||||||
|
m_HasOOCLoSEvent(false),
|
||||||
m_InvinceabilityHpLevel(0),
|
m_InvinceabilityHpLevel(0),
|
||||||
m_throwAIEventMask(0),
|
m_throwAIEventMask(0),
|
||||||
m_throwAIEventStep(0)
|
m_throwAIEventStep(0),
|
||||||
|
m_LastSpellMaxRange(0)
|
||||||
{
|
{
|
||||||
// Need make copy for filter unneeded steps and safe in case table reload
|
// Need make copy for filter unneeded steps and safe in case table reload
|
||||||
CreatureEventAI_Event_Map::const_iterator creatureEventsItr = sEventAIMgr.GetCreatureEventAIMap().find(m_creature->GetEntry());
|
CreatureEventAI_Event_Map::const_iterator creatureEventsItr = sEventAIMgr.GetCreatureEventAIMap().find(m_creature->GetEntry());
|
||||||
if (creatureEventsItr != sEventAIMgr.GetCreatureEventAIMap().end())
|
if (creatureEventsItr != sEventAIMgr.GetCreatureEventAIMap().end())
|
||||||
{
|
{
|
||||||
uint32 events_count = 0;
|
uint32 events_count = 0;
|
||||||
for (CreatureEventAI_Event_Vec::const_iterator i = creatureEventsItr->second.begin(); i != creatureEventsItr->second.end(); ++i)
|
|
||||||
|
const CreatureEventAI_Event_Vec& creatureEvent = creatureEventsItr->second;
|
||||||
|
for (CreatureEventAI_Event_Vec::const_iterator i = creatureEvent.begin(); i != creatureEvent.end(); ++i)
|
||||||
{
|
{
|
||||||
// Debug check
|
// Debug check
|
||||||
#ifndef MANGOS_DEBUG
|
#ifndef MANGOS_DEBUG
|
||||||
|
|
@ -119,27 +124,33 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c),
|
||||||
}
|
}
|
||||||
// EventMap had events but they were not added because they must be for instance
|
// EventMap had events but they were not added because they must be for instance
|
||||||
if (events_count == 0)
|
if (events_count == 0)
|
||||||
sLog.outErrorEventAI("Creature %u has events but no events added to list because of instance flags.", m_creature->GetEntry());
|
sLog.outErrorEventAI("Creature %u has events but no events added to list because of instance flags (spawned in map %u, difficulty %u).", m_creature->GetEntry(), m_creature->GetMapId(), m_creature->GetMap()->GetDifficulty());
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_CreatureEventAIList.reserve(events_count);
|
m_CreatureEventAIList.reserve(events_count);
|
||||||
for (CreatureEventAI_Event_Vec::const_iterator i = creatureEventsItr->second.begin(); i != creatureEventsItr->second.end(); ++i)
|
for (CreatureEventAI_Event_Vec::const_iterator i = creatureEvent.begin(); i != creatureEvent.end(); ++i)
|
||||||
{
|
{
|
||||||
// Debug check
|
// Debug check
|
||||||
#ifndef MANGOS_DEBUG
|
#ifndef MANGOS_DEBUG
|
||||||
if (i->event_flags & EFLAG_DEBUG_ONLY)
|
if (i->event_flags & EFLAG_DEBUG_ONLY)
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
|
bool storeEvent = false;
|
||||||
if (m_creature->GetMap()->IsDungeon())
|
if (m_creature->GetMap()->IsDungeon())
|
||||||
{
|
{
|
||||||
if ((1 << (m_creature->GetMap()->GetSpawnMode() + 1)) & i->event_flags)
|
if ((1 << (m_creature->GetMap()->GetSpawnMode() + 1)) & i->event_flags)
|
||||||
{
|
storeEvent = true;
|
||||||
// event flagged for instance mode
|
|
||||||
m_CreatureEventAIList.push_back(CreatureEventAIHolder(*i));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (IsEventFlagsFitForNormalMap(i->event_flags))
|
else if (IsEventFlagsFitForNormalMap(i->event_flags))
|
||||||
|
storeEvent = true;
|
||||||
|
|
||||||
|
if (storeEvent)
|
||||||
|
{
|
||||||
m_CreatureEventAIList.push_back(CreatureEventAIHolder(*i));
|
m_CreatureEventAIList.push_back(CreatureEventAIHolder(*i));
|
||||||
|
// Cache for fast use
|
||||||
|
if (i->event_type == EVENT_T_OOC_LOS)
|
||||||
|
m_HasOOCLoSEvent = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1191,7 +1202,7 @@ void CreatureEventAI::EnterCombat(Unit* enemy)
|
||||||
|
|
||||||
void CreatureEventAI::AttackStart(Unit* who)
|
void CreatureEventAI::AttackStart(Unit* who)
|
||||||
{
|
{
|
||||||
if (!who)
|
if (!who || !m_creature->CanAttackByItself())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_creature->Attack(who, m_MeleeEnabled))
|
if (m_creature->Attack(who, m_MeleeEnabled))
|
||||||
|
|
|
||||||
|
|
@ -689,6 +689,7 @@ class CreatureEventAI : public CreatureAI
|
||||||
// Note that Step 100 means that AI_EVENT_GOT_FULL_HEALTH was sent
|
// Note that Step 100 means that AI_EVENT_GOT_FULL_HEALTH was sent
|
||||||
// Steps 0..2 correspond to AI_EVENT_LOST_SOME_HEALTH(90%), AI_EVENT_LOST_HEALTH(50%), AI_EVENT_CRITICAL_HEALTH(10%)
|
// Steps 0..2 correspond to AI_EVENT_LOST_SOME_HEALTH(90%), AI_EVENT_LOST_HEALTH(50%), AI_EVENT_CRITICAL_HEALTH(10%)
|
||||||
uint32 m_throwAIEventStep; // Used for damage taken/ received heal
|
uint32 m_throwAIEventStep; // Used for damage taken/ received heal
|
||||||
|
float m_LastSpellMaxRange; // Maximum spell range that was cast during dynamic movement
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ void GameObject::RemoveFromWorld()
|
||||||
Object::RemoveFromWorld();
|
Object::RemoveFromWorld();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, QuaternionData rotation, uint8 animprogress, GOState go_state)
|
bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, const QuaternionData& rotation, uint8 animprogress, GOState go_state)
|
||||||
{
|
{
|
||||||
MANGOS_ASSERT(map);
|
MANGOS_ASSERT(map);
|
||||||
Relocate(x, y, z, ang);
|
Relocate(x, y, z, ang);
|
||||||
|
|
@ -1134,8 +1134,8 @@ void GameObject::Use(Unit* user)
|
||||||
// Some may have have animation and/or are expected to despawn.
|
// Some may have have animation and/or are expected to despawn.
|
||||||
|
|
||||||
// TODO: Improve this when more information is available, currently these traps are known that must send the anim (Onyxia/ Heigan Fissures/ Trap in DireMaul)
|
// TODO: Improve this when more information is available, currently these traps are known that must send the anim (Onyxia/ Heigan Fissures/ Trap in DireMaul)
|
||||||
if (GetDisplayId() == 4392 || GetDisplayId() == 4472 || GetDisplayId() == 6785 || GetDisplayId() == 3073)
|
if (GetDisplayId() == 4392 || GetDisplayId() == 4472 || GetDisplayId() == 4491 || GetDisplayId() == 6785 || GetDisplayId() == 3073 || GetDisplayId() == 7998)
|
||||||
{ SendGameObjectCustomAnim(GetObjectGuid()); }
|
SendGameObjectCustomAnim(GetObjectGuid());
|
||||||
|
|
||||||
// TODO: Despawning of traps? (Also related to code in ::Update)
|
// TODO: Despawning of traps? (Also related to code in ::Update)
|
||||||
return;
|
return;
|
||||||
|
|
@ -1733,7 +1733,7 @@ void GameObject::SetWorldRotation(float qx, float qy, float qz, float qw)
|
||||||
m_worldRotation.w = rotation.w;
|
m_worldRotation.w = rotation.w;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameObject::SetTransportPathRotation(QuaternionData rotation)
|
void GameObject::SetTransportPathRotation(const QuaternionData& rotation)
|
||||||
{
|
{
|
||||||
SetFloatValue(GAMEOBJECT_PARENTROTATION + 0, rotation.x);
|
SetFloatValue(GAMEOBJECT_PARENTROTATION + 0, rotation.x);
|
||||||
SetFloatValue(GAMEOBJECT_PARENTROTATION + 1, rotation.y);
|
SetFloatValue(GAMEOBJECT_PARENTROTATION + 1, rotation.y);
|
||||||
|
|
|
||||||
|
|
@ -647,9 +647,8 @@ class GameObject : public WorldObject
|
||||||
void AddToWorld() override;
|
void AddToWorld() override;
|
||||||
void RemoveFromWorld() override;
|
void RemoveFromWorld() override;
|
||||||
|
|
||||||
bool Create(uint32 guidlow, uint32 name_id, Map* map, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state);
|
|
||||||
bool Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang,
|
bool Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang,
|
||||||
QuaternionData rotation = QuaternionData(), uint8 animprogress = GO_ANIMPROGRESS_DEFAULT, GOState go_state = GO_STATE_READY);
|
const QuaternionData& rotation = QuaternionData(), uint8 animprogress = GO_ANIMPROGRESS_DEFAULT, GOState go_state = GO_STATE_READY);
|
||||||
void Update(uint32 update_diff, uint32 p_time) override;
|
void Update(uint32 update_diff, uint32 p_time) override;
|
||||||
GameObjectInfo const* GetGOInfo() const;
|
GameObjectInfo const* GetGOInfo() const;
|
||||||
|
|
||||||
|
|
@ -660,7 +659,7 @@ class GameObject : public WorldObject
|
||||||
// z_rot, y_rot, x_rot - rotation angles around z, y and x axes
|
// z_rot, y_rot, x_rot - rotation angles around z, y and x axes
|
||||||
void SetWorldRotationAngles(float z_rot, float y_rot, float x_rot);
|
void SetWorldRotationAngles(float z_rot, float y_rot, float x_rot);
|
||||||
void SetWorldRotation(float qx, float qy, float qz, float qw);
|
void SetWorldRotation(float qx, float qy, float qz, float qw);
|
||||||
void SetTransportPathRotation(QuaternionData rotation); // transforms(rotates) transport's path
|
void SetTransportPathRotation(const QuaternionData& rotation); // transforms(rotates) transport's path
|
||||||
int64 GetPackedWorldRotation() const { return m_packedRotation; }
|
int64 GetPackedWorldRotation() const { return m_packedRotation; }
|
||||||
|
|
||||||
// overwrite WorldObject function for proper name localization
|
// overwrite WorldObject function for proper name localization
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ bool Guild::Create(Player* leader, std::string gname)
|
||||||
|
|
||||||
m_LeaderGuid = leader->GetObjectGuid();
|
m_LeaderGuid = leader->GetObjectGuid();
|
||||||
m_Name = gname;
|
m_Name = gname;
|
||||||
GINFO = "";
|
GINFO.clear();
|
||||||
MOTD = "No message set.";
|
MOTD = "No message set.";
|
||||||
m_GuildBankMoney = 0;
|
m_GuildBankMoney = 0;
|
||||||
m_Id = sObjectMgr.GenerateGuildId();
|
m_Id = sObjectMgr.GenerateGuildId();
|
||||||
|
|
@ -319,8 +319,11 @@ bool Guild::CheckGuildStructure()
|
||||||
|
|
||||||
// Allow only 1 guildmaster, set other to officer
|
// Allow only 1 guildmaster, set other to officer
|
||||||
for (MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)
|
for (MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)
|
||||||
if (itr->second.RankId == GR_GUILDMASTER && m_LeaderGuid != itr->second.guid)
|
{
|
||||||
itr->second.ChangeRank(GR_OFFICER);
|
MemberSlot& member = itr->second;
|
||||||
|
if (member.RankId == GR_GUILDMASTER && m_LeaderGuid != member.guid)
|
||||||
|
member.ChangeRank(GR_OFFICER);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -580,18 +583,22 @@ bool Guild::ChangeMemberRank(ObjectGuid guid, uint8 newRank)
|
||||||
|
|
||||||
void Guild::BroadcastToGuild(WorldSession* session, const std::string& msg, uint32 language)
|
void Guild::BroadcastToGuild(WorldSession* session, const std::string& msg, uint32 language)
|
||||||
{
|
{
|
||||||
if (session && session->GetPlayer() && HasRankRight(session->GetPlayer()->GetRank(), GR_RIGHT_GCHATSPEAK))
|
if (!session)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player* player = session->GetPlayer();
|
||||||
|
if (!player || !HasRankRight(player->GetRank(), GR_RIGHT_GCHATSPEAK))
|
||||||
|
return;
|
||||||
|
|
||||||
|
WorldPacket data;
|
||||||
|
ChatHandler::BuildChatPacket(data, CHAT_MSG_GUILD, msg.c_str(), Language(language), player->GetChatTag(), player->GetObjectGuid(), player->GetName());
|
||||||
|
|
||||||
|
for (MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr)
|
||||||
{
|
{
|
||||||
WorldPacket data;
|
Player* pl = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, itr->first));
|
||||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_GUILD, msg.c_str(), Language(language), session->GetPlayer()->GetChatTag(), session->GetPlayer()->GetObjectGuid(), session->GetPlayer()->GetName());
|
|
||||||
|
|
||||||
for (MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr)
|
if (pl && pl->GetSession() && HasRankRight(pl->GetRank(), GR_RIGHT_GCHATLISTEN) && !pl->GetSocial()->HasIgnore(player->GetObjectGuid()))
|
||||||
{
|
pl->GetSession()->SendPacket(&data);
|
||||||
Player* pl = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, itr->first));
|
|
||||||
|
|
||||||
if (pl && pl->GetSession() && HasRankRight(pl->GetRank(), GR_RIGHT_GCHATLISTEN) && !pl->GetSocial()->HasIgnore(session->GetPlayer()->GetObjectGuid()))
|
|
||||||
pl->GetSession()->SendPacket(&data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -690,12 +697,12 @@ void Guild::MassInviteToEvent(WorldSession* session, uint32 minLevel, uint32 max
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MemberSlot const* member = &itr->second;
|
MemberSlot const& member = itr->second;
|
||||||
uint32 level = Player::GetLevelFromDB(member->guid);
|
uint32 level = Player::GetLevelFromDB(member.guid);
|
||||||
|
|
||||||
if (member->guid != session->GetPlayer()->GetObjectGuid() && level >= minLevel && level <= maxLevel && member->RankId <= minRank)
|
if (member.guid != session->GetPlayer()->GetObjectGuid() && level >= minLevel && level <= maxLevel && member.RankId <= minRank)
|
||||||
{
|
{
|
||||||
data << member->guid.WriteAsPacked();
|
data << member.guid.WriteAsPacked();
|
||||||
data << uint8(level);
|
data << uint8(level);
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
|
|
@ -1521,21 +1528,22 @@ uint32 Guild::GetMemberSlotWithdrawRem(uint32 LowGuid, uint8 TabId)
|
||||||
if (itr == members.end())
|
if (itr == members.end())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (itr->second.RankId == GR_GUILDMASTER)
|
MemberSlot& member = itr->second;
|
||||||
|
if (member.RankId == GR_GUILDMASTER)
|
||||||
return WITHDRAW_SLOT_UNLIMITED;
|
return WITHDRAW_SLOT_UNLIMITED;
|
||||||
|
|
||||||
if ((GetBankRights(itr->second.RankId, TabId) & GUILD_BANK_RIGHT_VIEW_TAB) != GUILD_BANK_RIGHT_VIEW_TAB)
|
if ((GetBankRights(member.RankId, TabId) & GUILD_BANK_RIGHT_VIEW_TAB) != GUILD_BANK_RIGHT_VIEW_TAB)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
uint32 curTime = uint32(time(NULL) / MINUTE);
|
uint32 curTime = uint32(time(nullptr) / MINUTE);
|
||||||
if (curTime - itr->second.BankResetTimeTab[TabId] >= 24 * HOUR / MINUTE)
|
if (curTime - member.BankResetTimeTab[TabId] >= 24 * HOUR / MINUTE)
|
||||||
{
|
{
|
||||||
itr->second.BankResetTimeTab[TabId] = curTime;
|
member.BankResetTimeTab[TabId] = curTime;
|
||||||
itr->second.BankRemSlotsTab[TabId] = GetBankSlotPerDay(itr->second.RankId, TabId);
|
member.BankRemSlotsTab[TabId] = GetBankSlotPerDay(member.RankId, TabId);
|
||||||
CharacterDatabase.PExecute("UPDATE guild_member SET BankResetTimeTab%u='%u', BankRemSlotsTab%u='%u' WHERE guildid='%u' AND guid='%u'",
|
CharacterDatabase.PExecute("UPDATE guild_member SET BankResetTimeTab%u='%u', BankRemSlotsTab%u='%u' WHERE guildid='%u' AND guid='%u'",
|
||||||
uint32(TabId), itr->second.BankResetTimeTab[TabId], uint32(TabId), itr->second.BankRemSlotsTab[TabId], m_Id, LowGuid);
|
uint32(TabId), member.BankResetTimeTab[TabId], uint32(TabId), member.BankRemSlotsTab[TabId], m_Id, LowGuid);
|
||||||
}
|
}
|
||||||
return itr->second.BankRemSlotsTab[TabId];
|
return member.BankRemSlotsTab[TabId];
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 Guild::GetMemberMoneyWithdrawRem(uint32 LowGuid)
|
uint64 Guild::GetMemberMoneyWithdrawRem(uint32 LowGuid)
|
||||||
|
|
@ -1544,19 +1552,20 @@ uint64 Guild::GetMemberMoneyWithdrawRem(uint32 LowGuid)
|
||||||
if (itr == members.end())
|
if (itr == members.end())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (itr->second.RankId == GR_GUILDMASTER)
|
MemberSlot& member = itr->second;
|
||||||
|
if (member.RankId == GR_GUILDMASTER)
|
||||||
return WITHDRAW_MONEY_UNLIMITED;
|
return WITHDRAW_MONEY_UNLIMITED;
|
||||||
|
|
||||||
uint32 curTime = uint32(time(NULL) / MINUTE); // minutes
|
uint32 curTime = uint32(time(nullptr) / MINUTE); // minutes
|
||||||
// 24 hours
|
// 24 hours
|
||||||
if (curTime > itr->second.BankResetTimeMoney + 24 * HOUR / MINUTE)
|
if (curTime > member.BankResetTimeMoney + 24 * HOUR / MINUTE)
|
||||||
{
|
{
|
||||||
itr->second.BankResetTimeMoney = curTime;
|
member.BankResetTimeMoney = curTime;
|
||||||
itr->second.BankRemMoney = GetBankMoneyPerDay(itr->second.RankId);
|
member.BankRemMoney = GetBankMoneyPerDay(member.RankId);
|
||||||
CharacterDatabase.PExecute("UPDATE guild_member SET BankResetTimeMoney='%u', BankRemMoney='%u' WHERE guildid='%u' AND guid='%u'",
|
CharacterDatabase.PExecute("UPDATE guild_member SET BankResetTimeMoney='%u', BankRemMoney='%u' WHERE guildid='%u' AND guid='%u'",
|
||||||
itr->second.BankResetTimeMoney, itr->second.BankRemMoney, m_Id, LowGuid);
|
member.BankResetTimeMoney, member.BankRemMoney, m_Id, LowGuid);
|
||||||
}
|
}
|
||||||
return itr->second.BankRemMoney;
|
return member.BankRemMoney;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Guild::SetBankMoneyPerDay(uint32 rankId, uint32 money)
|
void Guild::SetBankMoneyPerDay(uint32 rankId, uint32 money)
|
||||||
|
|
@ -1570,8 +1579,11 @@ void Guild::SetBankMoneyPerDay(uint32 rankId, uint32 money)
|
||||||
m_Ranks[rankId].BankMoneyPerDay = money;
|
m_Ranks[rankId].BankMoneyPerDay = money;
|
||||||
|
|
||||||
for (MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)
|
for (MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)
|
||||||
if (itr->second.RankId == rankId)
|
{
|
||||||
itr->second.BankResetTimeMoney = 0;
|
MemberSlot& member = itr->second;
|
||||||
|
if (member.RankId == rankId)
|
||||||
|
member.BankResetTimeMoney = 0;
|
||||||
|
}
|
||||||
|
|
||||||
CharacterDatabase.PExecute("UPDATE guild_rank SET BankMoneyPerDay='%u' WHERE rid='%u' AND guildid='%u'", money, rankId, m_Id);
|
CharacterDatabase.PExecute("UPDATE guild_rank SET BankMoneyPerDay='%u' WHERE rid='%u' AND guildid='%u'", money, rankId, m_Id);
|
||||||
CharacterDatabase.PExecute("UPDATE guild_member SET BankResetTimeMoney='0' WHERE guildid='%u' AND rank='%u'", m_Id, rankId);
|
CharacterDatabase.PExecute("UPDATE guild_member SET BankResetTimeMoney='0' WHERE guildid='%u' AND rank='%u'", m_Id, rankId);
|
||||||
|
|
@ -2401,10 +2413,9 @@ void Guild::MoveFromBankToChar(Player* pl, uint8 BankTab, uint8 BankTabSlot, uin
|
||||||
{
|
{
|
||||||
pl->MoveItemFromInventory(PlayerBag, PlayerSlot, true);
|
pl->MoveItemFromInventory(PlayerBag, PlayerSlot, true);
|
||||||
pItemChar->DeleteFromInventoryDB();
|
pItemChar->DeleteFromInventoryDB();
|
||||||
|
StoreItem(BankTab, gDest, pItemChar);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pItemChar)
|
|
||||||
StoreItem(BankTab, gDest, pItemChar);
|
|
||||||
pl->MoveItemToInventory(iDest, pItemBank, true);
|
pl->MoveItemToInventory(iDest, pItemBank, true);
|
||||||
pl->SaveInventoryAndGoldToDB();
|
pl->SaveInventoryAndGoldToDB();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,8 @@ uint32 GetItemEnchantMod(int32 entry)
|
||||||
double dRoll = rand_chance();
|
double dRoll = rand_chance();
|
||||||
float fCount = 0;
|
float fCount = 0;
|
||||||
|
|
||||||
for (EnchStoreList::const_iterator ench_iter = tab->second.begin(); ench_iter != tab->second.end(); ++ench_iter)
|
const EnchStoreList& enchantList = tab->second;
|
||||||
|
for (EnchStoreList::const_iterator ench_iter = enchantList.begin(); ench_iter != enchantList.end(); ++ench_iter)
|
||||||
{
|
{
|
||||||
fCount += ench_iter->chance;
|
fCount += ench_iter->chance;
|
||||||
|
|
||||||
|
|
@ -141,7 +142,7 @@ uint32 GetItemEnchantMod(int32 entry)
|
||||||
dRoll = (irand(0, (int)floor(fCount * 100) + 1)) / 100;
|
dRoll = (irand(0, (int)floor(fCount * 100) + 1)) / 100;
|
||||||
fCount = 0;
|
fCount = 0;
|
||||||
|
|
||||||
for (EnchStoreList::const_iterator ench_iter = tab->second.begin(); ench_iter != tab->second.end(); ++ench_iter)
|
for (EnchStoreList::const_iterator ench_iter = enchantList.begin(); ench_iter != enchantList.end(); ++ench_iter)
|
||||||
{
|
{
|
||||||
fCount += ench_iter->chance;
|
fCount += ench_iter->chance;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1592,7 +1592,7 @@ namespace MaNGOS
|
||||||
: i_object(obj), i_msgtype(msgtype), i_textData(textData), i_language(language), i_target(target) {}
|
: i_object(obj), i_msgtype(msgtype), i_textData(textData), i_language(language), i_target(target) {}
|
||||||
void operator()(WorldPacket& data, int32 loc_idx)
|
void operator()(WorldPacket& data, int32 loc_idx)
|
||||||
{
|
{
|
||||||
char const* text = nullptr;
|
char const* text = NULL;
|
||||||
if ((int32)i_textData->Content.size() > loc_idx + 1 && !i_textData->Content[loc_idx + 1].empty())
|
if ((int32)i_textData->Content.size() > loc_idx + 1 && !i_textData->Content[loc_idx + 1].empty())
|
||||||
text = i_textData->Content[loc_idx + 1].c_str();
|
text = i_textData->Content[loc_idx + 1].c_str();
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -39,13 +39,15 @@
|
||||||
#define CONTACT_DISTANCE 0.5f
|
#define CONTACT_DISTANCE 0.5f
|
||||||
#define INTERACTION_DISTANCE 5.0f
|
#define INTERACTION_DISTANCE 5.0f
|
||||||
#define ATTACK_DISTANCE 5.0f
|
#define ATTACK_DISTANCE 5.0f
|
||||||
#define MAX_VISIBILITY_DISTANCE 333.0f // max distance for visible object show, limited in 333 yards
|
#define INSPECT_DISTANCE 28.0f
|
||||||
#define DEFAULT_VISIBILITY_DISTANCE 90.0f // default visible distance, 90 yards on continents
|
#define TRADE_DISTANCE 11.11f
|
||||||
#define DEFAULT_VISIBILITY_INSTANCE 120.0f // default visible distance in instances, 120 yards
|
#define MAX_VISIBILITY_DISTANCE 333.0f // max distance for visible object show, limited in 333 yards
|
||||||
#define DEFAULT_VISIBILITY_BGARENAS 180.0f // default visible distance in BG/Arenas, 180 yards
|
#define DEFAULT_VISIBILITY_DISTANCE 90.0f // default visible distance, 90 yards on continents
|
||||||
|
#define DEFAULT_VISIBILITY_INSTANCE 120.0f // default visible distance in instances, 120 yards
|
||||||
|
#define DEFAULT_VISIBILITY_BGARENAS 180.0f // default visible distance in BG/Arenas, 180 yards
|
||||||
|
|
||||||
#define DEFAULT_WORLD_OBJECT_SIZE 0.388999998569489f // currently used (correctly?) for any non Unit world objects. This is actually the bounding_radius, like player/creature from creature_model_data
|
#define DEFAULT_WORLD_OBJECT_SIZE 0.388999998569489f // currently used (correctly?) for any non Unit world objects. This is actually the bounding_radius, like player/creature from creature_model_data
|
||||||
#define DEFAULT_OBJECT_SCALE 1.0f // player/item Scale as default, npc/go from database, pets from dbc
|
#define DEFAULT_OBJECT_SCALE 1.0f // player/item scale as default, npc/go from database, pets from dbc
|
||||||
|
|
||||||
#define MAX_STEALTH_DETECT_RANGE 45.0f
|
#define MAX_STEALTH_DETECT_RANGE 45.0f
|
||||||
|
|
||||||
|
|
@ -601,8 +603,8 @@ class WorldObject : public Object
|
||||||
virtual void SendMessageToSetInRange(WorldPacket* data, float dist, bool self) const;
|
virtual void SendMessageToSetInRange(WorldPacket* data, float dist, bool self) const;
|
||||||
void SendMessageToSetExcept(WorldPacket* data, Player const* skipped_receiver) const;
|
void SendMessageToSetExcept(WorldPacket* data, Player const* skipped_receiver) const;
|
||||||
|
|
||||||
void MonsterSay(const char* text, uint32 language, Unit const* target = nullptr) const;
|
void MonsterSay(const char* text, uint32 language, Unit const* target = NULL) const;
|
||||||
void MonsterYell(const char* text, uint32 language, Unit const* target = nullptr) const;
|
void MonsterYell(const char* text, uint32 language, Unit const* target = NULL) const;
|
||||||
void MonsterTextEmote(const char* text, Unit const* target, bool IsBossEmote = false) const;
|
void MonsterTextEmote(const char* text, Unit const* target, bool IsBossEmote = false) const;
|
||||||
void MonsterWhisper(const char* text, Unit const* target, bool IsBossWhisper = false) const;
|
void MonsterWhisper(const char* text, Unit const* target, bool IsBossWhisper = false) const;
|
||||||
void MonsterText(MangosStringLocale const* textData, Unit const* target) const;
|
void MonsterText(MangosStringLocale const* textData, Unit const* target) const;
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,9 @@
|
||||||
#include "InstanceData.h"
|
#include "InstanceData.h"
|
||||||
#include "DB2Structure.h"
|
#include "DB2Structure.h"
|
||||||
#include "DB2Stores.h"
|
#include "DB2Stores.h"
|
||||||
#include "PhaseMgr.h"
|
#include "GridNotifiers.h"
|
||||||
|
#include "GridNotifiersImpl.h"
|
||||||
|
#include "CellImpl.h"
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
|
|
@ -192,15 +194,6 @@ ObjectMgr::~ObjectMgr()
|
||||||
|
|
||||||
for (CacheTrainerSpellMap::iterator itr = m_mCacheTrainerSpellMap.begin(); itr != m_mCacheTrainerSpellMap.end(); ++itr)
|
for (CacheTrainerSpellMap::iterator itr = m_mCacheTrainerSpellMap.begin(); itr != m_mCacheTrainerSpellMap.end(); ++itr)
|
||||||
itr->second.Clear();
|
itr->second.Clear();
|
||||||
|
|
||||||
for (PhaseDefinitionStore::iterator itr = _PhaseDefinitionStore.begin(); itr != _PhaseDefinitionStore.end(); ++itr)
|
|
||||||
{
|
|
||||||
for (PhaseDefinitionContainer::iterator itr2 = itr->second.begin(); itr2 != itr->second.end(); ++itr2)
|
|
||||||
delete *itr2;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (SpellPhaseStore::iterator itr = _SpellPhaseStore.begin(); itr != _SpellPhaseStore.end(); ++itr)
|
|
||||||
delete itr->second;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Group* ObjectMgr::GetGroupById(uint32 id) const
|
Group* ObjectMgr::GetGroupById(uint32 id) const
|
||||||
|
|
@ -984,14 +977,14 @@ void ObjectMgr::LoadCreatureClassLvlStats()
|
||||||
CreatureClassLvlStats const* ObjectMgr::GetCreatureClassLvlStats(uint32 level, uint32 unitClass, int32 expansion) const
|
CreatureClassLvlStats const* ObjectMgr::GetCreatureClassLvlStats(uint32 level, uint32 unitClass, int32 expansion) const
|
||||||
{
|
{
|
||||||
if (expansion < 0)
|
if (expansion < 0)
|
||||||
return nullptr;
|
return NULL;
|
||||||
|
|
||||||
CreatureClassLvlStats const* cCLS = &m_creatureClassLvlStats[level][classToIndex[unitClass]][expansion];
|
CreatureClassLvlStats const* cCLS = &m_creatureClassLvlStats[level][classToIndex[unitClass]][expansion];
|
||||||
|
|
||||||
if (cCLS->BaseHealth != 0 && cCLS->BaseDamage > 0.1f)
|
if (cCLS->BaseHealth != 0 && cCLS->BaseDamage > 0.1f)
|
||||||
return cCLS;
|
return cCLS;
|
||||||
|
|
||||||
return nullptr;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectMgr::LoadEquipmentTemplates()
|
void ObjectMgr::LoadEquipmentTemplates()
|
||||||
|
|
@ -5091,19 +5084,17 @@ void ObjectMgr::LoadGossipText()
|
||||||
BarGoLink bar(1);
|
BarGoLink bar(1);
|
||||||
bar.step();
|
bar.step();
|
||||||
|
|
||||||
sLog.outString();
|
|
||||||
sLog.outString(">> Loaded %u npc texts", count);
|
sLog.outString(">> Loaded %u npc texts", count);
|
||||||
|
sLog.outString();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cic;
|
|
||||||
|
|
||||||
BarGoLink bar(result->GetRowCount());
|
BarGoLink bar(result->GetRowCount());
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
++count;
|
++count;
|
||||||
cic = 0;
|
int cic = 0;
|
||||||
|
|
||||||
Field* fields = result->Fetch();
|
Field* fields = result->Fetch();
|
||||||
|
|
||||||
|
|
@ -5135,8 +5126,8 @@ void ObjectMgr::LoadGossipText()
|
||||||
}
|
}
|
||||||
while (result->NextRow());
|
while (result->NextRow());
|
||||||
|
|
||||||
sLog.outString();
|
|
||||||
sLog.outString(">> Loaded %u npc texts", count);
|
sLog.outString(">> Loaded %u npc texts", count);
|
||||||
|
sLog.outString();
|
||||||
delete result;
|
delete result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7354,11 +7345,15 @@ void ObjectMgr::LoadNPCSpellClickSpells()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpellEntry const* spellinfo = sSpellStore.LookupEntry(info.spellId);
|
// spell can be 0 for special or custom cases
|
||||||
if (!spellinfo)
|
if (info.spellId)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Table npc_spellclick_spells references unknown spellid %u. Skipping entry.", info.spellId);
|
SpellEntry const* spellinfo = sSpellStore.LookupEntry(info.spellId);
|
||||||
continue;
|
if (!spellinfo)
|
||||||
|
{
|
||||||
|
sLog.outErrorDb("Table npc_spellclick_spells references unknown spellid %u. Skipping entry.", info.spellId);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.conditionId && !sConditionStorage.LookupEntry<PlayerCondition const*>(info.conditionId))
|
if (info.conditionId && !sConditionStorage.LookupEntry<PlayerCondition const*>(info.conditionId))
|
||||||
|
|
@ -7704,7 +7699,7 @@ static LanguageType GetRealmLanguageType(bool create)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isValidString(std::wstring wstr, uint32 strictMask, bool numericOrSpace, bool create = false)
|
bool isValidString(const std::wstring& wstr, uint32 strictMask, bool numericOrSpace, bool create = false)
|
||||||
{
|
{
|
||||||
if (strictMask == 0) // any language, ignore realm
|
if (strictMask == 0) // any language, ignore realm
|
||||||
{
|
{
|
||||||
|
|
@ -8159,8 +8154,7 @@ bool ObjectMgr::IsPlayerMeetToCondition(uint16 conditionId, Player const* pPlaye
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
bool ObjectMgr::CheckDeclinedNames(const std::wstring& mainpart, DeclinedName const& names)
|
||||||
bool ObjectMgr::CheckDeclinedNames(std::wstring mainpart, DeclinedName const& names)
|
|
||||||
{
|
{
|
||||||
for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
|
for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
|
||||||
{
|
{
|
||||||
|
|
@ -8490,6 +8484,16 @@ bool PlayerCondition::Meets(Player const* player, Map const* map, WorldObject co
|
||||||
case 3: // Creature source is dead
|
case 3: // Creature source is dead
|
||||||
return !source || source->GetTypeId() != TYPEID_UNIT || !((Unit*)source)->IsAlive();
|
return !source || source->GetTypeId() != TYPEID_UNIT || !((Unit*)source)->IsAlive();
|
||||||
}
|
}
|
||||||
|
case CONDITION_CREATURE_IN_RANGE:
|
||||||
|
{
|
||||||
|
Creature* creature = NULL;
|
||||||
|
|
||||||
|
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*player, m_value1, true, false, m_value2, true);
|
||||||
|
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(creature, creature_check);
|
||||||
|
Cell::VisitGridObjects(player, searcher, m_value2);
|
||||||
|
|
||||||
|
return creature;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -8945,6 +8949,19 @@ bool PlayerCondition::IsValid(uint16 entry, ConditionType condition, uint32 valu
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case CONDITION_CREATURE_IN_RANGE:
|
||||||
|
{
|
||||||
|
if (!sCreatureStorage.LookupEntry<CreatureInfo> (value1))
|
||||||
|
{
|
||||||
|
sLog.outErrorDb("Creature in range condition (entry %u, type %u) has an invalid value in value1. (Creature %u does not exist in the database), skipping.", entry, condition, value1);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (value2 <= 0)
|
||||||
|
{
|
||||||
|
sLog.outErrorDb("Creature in range condition (entry %u, type %u) has an invalid value in value2. (Range %u must be greater than 0), skipping.", entry, condition, value2);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
case CONDITION_NONE:
|
case CONDITION_NONE:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -10422,117 +10439,6 @@ bool DoDisplayText(WorldObject* source, int32 entry, Unit const* target /*=NULL*
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectMgr::LoadPhaseDefinitions()
|
|
||||||
{
|
|
||||||
for (PhaseDefinitionStore::iterator itr = _PhaseDefinitionStore.begin(); itr != _PhaseDefinitionStore.end(); ++itr)
|
|
||||||
{
|
|
||||||
for (PhaseDefinitionContainer::iterator itr2 = itr->second.begin(); itr2 != itr->second.end(); ++itr2)
|
|
||||||
delete *itr2;
|
|
||||||
}
|
|
||||||
|
|
||||||
_PhaseDefinitionStore.clear();
|
|
||||||
|
|
||||||
// 0 1 2 3 4 5 6
|
|
||||||
QueryResult* result = WorldDatabase.Query("SELECT zoneId, entry, phasemask, phaseId, terrainswapmap, flags, condition_id FROM `phase_definitions` ORDER BY `entry` ASC");
|
|
||||||
|
|
||||||
if (!result)
|
|
||||||
{
|
|
||||||
sLog.outString(">> Loaded 0 phasing definitions. DB table `phase_definitions` is empty.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32 count = 0;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
Field* fields = result->Fetch();
|
|
||||||
|
|
||||||
PhaseDefinition* phaseDefinition = new PhaseDefinition();
|
|
||||||
|
|
||||||
phaseDefinition->zoneId = fields[0].GetUInt32();
|
|
||||||
phaseDefinition->entry = fields[1].GetUInt32();
|
|
||||||
phaseDefinition->phasemask = fields[2].GetUInt32();
|
|
||||||
phaseDefinition->phaseId = fields[3].GetUInt32();
|
|
||||||
phaseDefinition->terrainswapmap = fields[4].GetUInt32();
|
|
||||||
phaseDefinition->flags = fields[5].GetUInt32();
|
|
||||||
phaseDefinition->conditionId = fields[6].GetUInt16();
|
|
||||||
|
|
||||||
// Checks
|
|
||||||
if ((phaseDefinition->flags & PHASE_FLAG_OVERWRITE_EXISTING) && (phaseDefinition->flags & PHASE_FLAG_NEGATE_PHASE))
|
|
||||||
{
|
|
||||||
sLog.outError("Flags defined in phase_definitions in zoneId %d and entry %u does contain PHASE_FLAG_OVERWRITE_EXISTING and PHASE_FLAG_NEGATE_PHASE. Setting flags to PHASE_FLAG_OVERWRITE_EXISTING", phaseDefinition->zoneId, phaseDefinition->entry);
|
|
||||||
phaseDefinition->flags &= ~PHASE_FLAG_NEGATE_PHASE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!sConditionStorage.LookupEntry<PlayerCondition>(phaseDefinition->conditionId))
|
|
||||||
{
|
|
||||||
sLog.outError("Condition id defined in phase_definitions in zoneId %d and entry %u does not exists. Skipping condition.", phaseDefinition->zoneId, phaseDefinition->entry);
|
|
||||||
phaseDefinition->conditionId = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
_PhaseDefinitionStore[phaseDefinition->zoneId].push_back(phaseDefinition);
|
|
||||||
|
|
||||||
++count;
|
|
||||||
}
|
|
||||||
while (result->NextRow());
|
|
||||||
|
|
||||||
delete result;
|
|
||||||
|
|
||||||
sLog.outString(">> Loaded %u phasing definitions.", count);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectMgr::LoadSpellPhaseInfo()
|
|
||||||
{
|
|
||||||
for (SpellPhaseStore::iterator itr = _SpellPhaseStore.begin(); itr != _SpellPhaseStore.end(); ++itr)
|
|
||||||
delete itr->second;
|
|
||||||
|
|
||||||
_SpellPhaseStore.clear();
|
|
||||||
|
|
||||||
// 0 1 2
|
|
||||||
QueryResult* result = WorldDatabase.Query("SELECT id, phasemask, terrainswapmap FROM `spell_phase`");
|
|
||||||
|
|
||||||
if (!result)
|
|
||||||
{
|
|
||||||
sLog.outString(">> Loaded 0 spell dbc infos. DB table `spell_phase` is empty.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32 count = 0;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
Field* fields = result->Fetch();
|
|
||||||
|
|
||||||
SpellPhaseInfo* spellPhaseInfo = new SpellPhaseInfo();
|
|
||||||
spellPhaseInfo->spellId = fields[0].GetUInt32();
|
|
||||||
|
|
||||||
SpellEntry const* spell = sSpellStore.LookupEntry(spellPhaseInfo->spellId);
|
|
||||||
if (!spell)
|
|
||||||
{
|
|
||||||
sLog.outError("Spell %u defined in `spell_phase` does not exists, skipped.", spellPhaseInfo->spellId);
|
|
||||||
delete spellPhaseInfo;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!IsSpellHaveAura(spell, SPELL_AURA_PHASE) && !IsSpellHaveAura(spell, SPELL_AURA_PHASE_2))
|
|
||||||
{
|
|
||||||
sLog.outError("Spell %u defined in `spell_phase` does not have aura effect type SPELL_AURA_PHASE or SPELL_AURA_PHASE_2, useless value.", spellPhaseInfo->spellId);
|
|
||||||
delete spellPhaseInfo;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
spellPhaseInfo->phasemask = fields[1].GetUInt32();
|
|
||||||
spellPhaseInfo->terrainswapmap = fields[2].GetUInt32();
|
|
||||||
|
|
||||||
_SpellPhaseStore[spellPhaseInfo->spellId] = spellPhaseInfo;
|
|
||||||
|
|
||||||
++count;
|
|
||||||
}
|
|
||||||
while (result->NextRow());
|
|
||||||
|
|
||||||
delete result;
|
|
||||||
|
|
||||||
sLog.outString(">> Loaded %u spell phase dbc infos.", count);
|
|
||||||
}
|
|
||||||
|
|
||||||
CreatureDataPair const* FindCreatureData::GetResult() const
|
CreatureDataPair const* FindCreatureData::GetResult() const
|
||||||
{
|
{
|
||||||
if (i_spawnedData)
|
if (i_spawnedData)
|
||||||
|
|
|
||||||
|
|
@ -448,6 +448,7 @@ enum ConditionType
|
||||||
CONDITION_GENDER = 35, // 0=male, 1=female, 2=none (see enum Gender)
|
CONDITION_GENDER = 35, // 0=male, 1=female, 2=none (see enum Gender)
|
||||||
CONDITION_DEAD_OR_AWAY = 36, // value1: 0=player dead, 1=player is dead (with group dead), 2=player in instance are dead, 3=creature is dead
|
CONDITION_DEAD_OR_AWAY = 36, // value1: 0=player dead, 1=player is dead (with group dead), 2=player in instance are dead, 3=creature is dead
|
||||||
// value2: if != 0 only consider players in range of this value
|
// value2: if != 0 only consider players in range of this value
|
||||||
|
CONDITION_CREATURE_IN_RANGE = 37, // value1: creature entry; value2: range; returns only alive creatures
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ConditionSource // From where was the condition called?
|
enum ConditionSource // From where was the condition called?
|
||||||
|
|
@ -462,7 +463,6 @@ enum ConditionSource // From where was th
|
||||||
CONDITION_FROM_SPELL_AREA = 7, // Used to check a condition from spell_area table
|
CONDITION_FROM_SPELL_AREA = 7, // Used to check a condition from spell_area table
|
||||||
CONDITION_FROM_SPELLCLICK = 8, // Used to check a condition from npc_spellclick_spells table
|
CONDITION_FROM_SPELLCLICK = 8, // Used to check a condition from npc_spellclick_spells table
|
||||||
CONDITION_FROM_DBSCRIPTS = 9, // Used to check a condition from DB Scripts Engine
|
CONDITION_FROM_DBSCRIPTS = 9, // Used to check a condition from DB Scripts Engine
|
||||||
CONDITION_FROM_PHASEMGR = 10, // Used to check a condition from phase manager
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class PlayerCondition
|
class PlayerCondition
|
||||||
|
|
@ -1041,7 +1041,7 @@ class ObjectMgr
|
||||||
static PetNameInvalidReason CheckPetName(const std::string& name);
|
static PetNameInvalidReason CheckPetName(const std::string& name);
|
||||||
static bool IsValidCharterName(const std::string& name);
|
static bool IsValidCharterName(const std::string& name);
|
||||||
|
|
||||||
static bool CheckDeclinedNames(std::wstring mainpart, DeclinedName const& names);
|
static bool CheckDeclinedNames(const std::wstring& mainpart, DeclinedName const& names);
|
||||||
|
|
||||||
int GetIndexForLocale(LocaleConstant loc);
|
int GetIndexForLocale(LocaleConstant loc);
|
||||||
LocaleConstant GetLocaleForIndex(int i);
|
LocaleConstant GetLocaleForIndex(int i);
|
||||||
|
|
@ -1192,11 +1192,11 @@ class ObjectMgr
|
||||||
|
|
||||||
uint32 GetModelForRace(uint32 sourceModelId, uint32 racemask);
|
uint32 GetModelForRace(uint32 sourceModelId, uint32 racemask);
|
||||||
/**
|
/**
|
||||||
* \brief: Data returned is used to compute health, mana, armor, damage of creatures. May be nullptr.
|
* \brief: Data returned is used to compute health, mana, armor, damage of creatures. May be NULL.
|
||||||
* \param uint32 level creature level
|
* \param uint32 level creature level
|
||||||
* \param uint32 unitClass creature class, related to CLASSMASK_ALL_CREATURES
|
* \param uint32 unitClass creature class, related to CLASSMASK_ALL_CREATURES
|
||||||
* \param uint32 expansion creature expansion (we could have creature exp = 0 for wotlk as well as exp = 1 or exp = 2)
|
* \param uint32 expansion creature expansion (we could have creature exp = 0 for wotlk as well as exp = 1 or exp = 2)
|
||||||
* \return: CreatureClassLvlStats const* or nullptr
|
* \return: CreatureClassLvlStats const* or NULL
|
||||||
*
|
*
|
||||||
* Description: GetCreatureClassLvlStats give fast access to creature stats data.
|
* Description: GetCreatureClassLvlStats give fast access to creature stats data.
|
||||||
* FullName: ObjectMgr::GetCreatureClassLvlStats
|
* FullName: ObjectMgr::GetCreatureClassLvlStats
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
|
||||||
m_charmInfo->SetReactState(ReactStates(fields[6].GetUInt8()));
|
m_charmInfo->SetReactState(ReactStates(fields[6].GetUInt8()));
|
||||||
|
|
||||||
uint32 savedhealth = fields[10].GetUInt32();
|
uint32 savedhealth = fields[10].GetUInt32();
|
||||||
uint32 savedmana = fields[11].GetUInt32();
|
uint32 savedpower = fields[11].GetUInt32();
|
||||||
|
|
||||||
// set current pet as current
|
// set current pet as current
|
||||||
// 0=current
|
// 0=current
|
||||||
|
|
@ -274,17 +274,20 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
|
||||||
{
|
{
|
||||||
LearnPetPassives();
|
LearnPetPassives();
|
||||||
CastPetAuras(current);
|
CastPetAuras(current);
|
||||||
|
CastOwnerTalentAuras();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Powers powerType = GetPowerType();
|
||||||
|
|
||||||
if (getPetType() == SUMMON_PET && !current) // all (?) summon pets come with full health when called, but not when they are current
|
if (getPetType() == SUMMON_PET && !current) // all (?) summon pets come with full health when called, but not when they are current
|
||||||
{
|
{
|
||||||
SetHealth(GetMaxHealth());
|
SetHealth(GetMaxHealth());
|
||||||
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
|
SetPower(powerType, GetMaxPower(powerType));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetHealth(savedhealth > GetMaxHealth() ? GetMaxHealth() : savedhealth);
|
SetHealth(savedhealth > GetMaxHealth() ? GetMaxHealth() : savedhealth);
|
||||||
SetPower(POWER_MANA, savedmana > GetMaxPower(POWER_MANA) ? GetMaxPower(POWER_MANA) : savedmana);
|
SetPower(powerType, savedpower > GetMaxPower(powerType) ? GetMaxPower(powerType) : savedpower);
|
||||||
}
|
}
|
||||||
|
|
||||||
AIM_Initialize();
|
AIM_Initialize();
|
||||||
|
|
@ -369,7 +372,7 @@ void Pet::SavePetToDB(PetSaveMode mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 curhealth = GetHealth();
|
uint32 curhealth = GetHealth();
|
||||||
uint32 curmana = GetPower(POWER_MANA);
|
uint32 curpower = GetPower(GetPowerType());
|
||||||
|
|
||||||
// stable and not in slot saves
|
// stable and not in slot saves
|
||||||
if (mode != PET_SAVE_AS_CURRENT)
|
if (mode != PET_SAVE_AS_CURRENT)
|
||||||
|
|
@ -423,7 +426,7 @@ void Pet::SavePetToDB(PetSaveMode mode)
|
||||||
savePet.addString(m_name);
|
savePet.addString(m_name);
|
||||||
savePet.addUInt32(uint32(HasByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED) ? 0 : 1));
|
savePet.addUInt32(uint32(HasByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED) ? 0 : 1));
|
||||||
savePet.addUInt32((curhealth < 1 ? 1 : curhealth));
|
savePet.addUInt32((curhealth < 1 ? 1 : curhealth));
|
||||||
savePet.addUInt32(curmana);
|
savePet.addUInt32(curpower);
|
||||||
|
|
||||||
std::ostringstream ss;
|
std::ostringstream ss;
|
||||||
for (uint32 i = ACTION_BAR_INDEX_START; i < ACTION_BAR_INDEX_END; ++i)
|
for (uint32 i = ACTION_BAR_INDEX_START; i < ACTION_BAR_INDEX_END; ++i)
|
||||||
|
|
@ -565,20 +568,10 @@ void Pet::RegenerateAll(uint32 update_diff)
|
||||||
// regenerate focus for hunter pets or energy for deathknight's ghoul
|
// regenerate focus for hunter pets or energy for deathknight's ghoul
|
||||||
if (m_regenTimer <= update_diff)
|
if (m_regenTimer <= update_diff)
|
||||||
{
|
{
|
||||||
switch (GetPowerType())
|
|
||||||
{
|
|
||||||
case POWER_FOCUS:
|
|
||||||
case POWER_ENERGY:
|
|
||||||
Regenerate(GetPowerType());
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!IsInCombat() || IsPolymorphed())
|
if (!IsInCombat() || IsPolymorphed())
|
||||||
RegenerateHealth();
|
RegenerateHealth();
|
||||||
|
|
||||||
RegenerateMana();
|
RegeneratePower();
|
||||||
|
|
||||||
m_regenTimer = 4000;
|
m_regenTimer = 4000;
|
||||||
}
|
}
|
||||||
|
|
@ -586,43 +579,6 @@ void Pet::RegenerateAll(uint32 update_diff)
|
||||||
m_regenTimer -= update_diff;
|
m_regenTimer -= update_diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pet::Regenerate(Powers power)
|
|
||||||
{
|
|
||||||
uint32 curValue = GetPower(power);
|
|
||||||
uint32 maxValue = GetMaxPower(power);
|
|
||||||
|
|
||||||
if (curValue >= maxValue)
|
|
||||||
return;
|
|
||||||
|
|
||||||
float addvalue = 0.0f;
|
|
||||||
|
|
||||||
switch (power)
|
|
||||||
{
|
|
||||||
case POWER_FOCUS:
|
|
||||||
{
|
|
||||||
// For hunter pets.
|
|
||||||
addvalue = 24 * sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_FOCUS);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case POWER_ENERGY:
|
|
||||||
{
|
|
||||||
// For deathknight's ghoul.
|
|
||||||
addvalue = 20;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply modifiers (if any).
|
|
||||||
AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
|
|
||||||
for (AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
|
|
||||||
if ((*i)->GetModifier()->m_miscvalue == int32(power))
|
|
||||||
addvalue *= ((*i)->GetModifier()->m_amount + 100) / 100.0f;
|
|
||||||
|
|
||||||
ModifyPower(power, (int32)addvalue);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Pet::CanTakeMoreActiveSpells(uint32 spellid)
|
bool Pet::CanTakeMoreActiveSpells(uint32 spellid)
|
||||||
{
|
{
|
||||||
uint8 activecount = 1;
|
uint8 activecount = 1;
|
||||||
|
|
@ -1060,7 +1016,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner)
|
||||||
UpdateAllStats();
|
UpdateAllStats();
|
||||||
|
|
||||||
SetHealth(GetMaxHealth());
|
SetHealth(GetMaxHealth());
|
||||||
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
|
SetPower(GetPowerType(), GetMaxPower(GetPowerType()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -1912,6 +1868,7 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PetSpellMap::iterator itr = m_spells.find(spellid);
|
PetSpellMap::iterator itr = m_spells.find(spellid);
|
||||||
|
PetSpell& petSpell = itr->second;
|
||||||
|
|
||||||
uint32 i;
|
uint32 i;
|
||||||
|
|
||||||
|
|
@ -1924,11 +1881,11 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
|
||||||
{
|
{
|
||||||
m_autospells.push_back(spellid);
|
m_autospells.push_back(spellid);
|
||||||
|
|
||||||
if (itr->second.active != ACT_ENABLED)
|
if (petSpell.active != ACT_ENABLED)
|
||||||
{
|
{
|
||||||
itr->second.active = ACT_ENABLED;
|
petSpell.active = ACT_ENABLED;
|
||||||
if (itr->second.state != PETSPELL_NEW)
|
if (petSpell.state != PETSPELL_NEW)
|
||||||
itr->second.state = PETSPELL_CHANGED;
|
petSpell.state = PETSPELL_CHANGED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1941,11 +1898,11 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
|
||||||
if (i < m_autospells.size())
|
if (i < m_autospells.size())
|
||||||
{
|
{
|
||||||
m_autospells.erase(itr2);
|
m_autospells.erase(itr2);
|
||||||
if (itr->second.active != ACT_DISABLED)
|
if (petSpell.active != ACT_DISABLED)
|
||||||
{
|
{
|
||||||
itr->second.active = ACT_DISABLED;
|
petSpell.active = ACT_DISABLED;
|
||||||
if (itr->second.state != PETSPELL_NEW)
|
if (petSpell.state != PETSPELL_NEW)
|
||||||
itr->second.state = PETSPELL_CHANGED;
|
petSpell.state = PETSPELL_CHANGED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2042,6 +1999,44 @@ void Pet::CastPetAuras(bool current)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Pet::CastOwnerTalentAuras()
|
||||||
|
{
|
||||||
|
if (!GetOwner() || GetOwner()->GetTypeId() != TYPEID_PLAYER)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player* pOwner = static_cast<Player*>(GetOwner());
|
||||||
|
|
||||||
|
// Handle Ferocious Inspiration Talent
|
||||||
|
if (pOwner && pOwner->getClass() == CLASS_HUNTER)
|
||||||
|
{
|
||||||
|
// clear any existing Ferocious Inspiration auras
|
||||||
|
RemoveAurasDueToSpell(75593);
|
||||||
|
RemoveAurasDueToSpell(75446);
|
||||||
|
RemoveAurasDueToSpell(75447);
|
||||||
|
|
||||||
|
if (IsAlive())
|
||||||
|
{
|
||||||
|
const SpellEntry* seTalent = pOwner->GetKnownTalentRankById(1800); // Ferocious Inspiration
|
||||||
|
|
||||||
|
if (seTalent)
|
||||||
|
{
|
||||||
|
switch (seTalent->Id)
|
||||||
|
{
|
||||||
|
case 34455: // Ferocious Inspiration Rank 1
|
||||||
|
CastSpell(this, 75593, true); // Ferocious Inspiration 1%
|
||||||
|
break;
|
||||||
|
case 34459: // Ferocious Inspiration Rank 2
|
||||||
|
CastSpell(this, 75446, true); // Ferocious Inspiration 2%
|
||||||
|
break;
|
||||||
|
case 34460: // Ferocious Inspiration Rank 3
|
||||||
|
CastSpell(this, 75447, true); // Ferocious Inspiration 3%
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // End Ferocious Inspiration Talent
|
||||||
|
}
|
||||||
|
|
||||||
void Pet::CastPetAura(PetAura const* aura)
|
void Pet::CastPetAura(PetAura const* aura)
|
||||||
{
|
{
|
||||||
uint32 auraId = aura->GetAura(GetEntry());
|
uint32 auraId = aura->GetAura(GetEntry());
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,6 @@ class Pet : public Creature
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegenerateAll(uint32 update_diff) override; // overwrite Creature::RegenerateAll
|
void RegenerateAll(uint32 update_diff) override; // overwrite Creature::RegenerateAll
|
||||||
void Regenerate(Powers power);
|
|
||||||
void GivePetXP(uint32 xp);
|
void GivePetXP(uint32 xp);
|
||||||
void GivePetLevel(uint32 level);
|
void GivePetLevel(uint32 level);
|
||||||
void SynchronizeLevelWithOwner();
|
void SynchronizeLevelWithOwner();
|
||||||
|
|
@ -198,6 +197,11 @@ class Pet : public Creature
|
||||||
void UpdateMaxPower(Powers power) override;
|
void UpdateMaxPower(Powers power) override;
|
||||||
void UpdateAttackPowerAndDamage(bool ranged = false) override;
|
void UpdateAttackPowerAndDamage(bool ranged = false) override;
|
||||||
void UpdateDamagePhysical(WeaponAttackType attType) override;
|
void UpdateDamagePhysical(WeaponAttackType attType) override;
|
||||||
|
uint32 GetCurrentEquipmentId() const { return m_equipmentId; }
|
||||||
|
|
||||||
|
static float _GetHealthMod(int32 Rank); ///< Get custom factor to scale health (default 1, CONFIG_FLOAT_RATE_CREATURE_*_HP)
|
||||||
|
static float _GetDamageMod(int32 Rank); ///< Get custom factor to scale damage (default 1, CONFIG_FLOAT_RATE_*_DAMAGE)
|
||||||
|
static float _GetSpellDamageMod(int32 Rank); ///< Get custom factor to scale spell damage (default 1, CONFIG_FLOAT_RATE_*_SPELLDAMAGE)
|
||||||
|
|
||||||
bool CanTakeMoreActiveSpells(uint32 SpellIconID);
|
bool CanTakeMoreActiveSpells(uint32 SpellIconID);
|
||||||
void ToggleAutocast(uint32 spellid, bool apply);
|
void ToggleAutocast(uint32 spellid, bool apply);
|
||||||
|
|
@ -209,6 +213,7 @@ class Pet : public Creature
|
||||||
|
|
||||||
void LearnPetPassives();
|
void LearnPetPassives();
|
||||||
void CastPetAuras(bool current);
|
void CastPetAuras(bool current);
|
||||||
|
void CastOwnerTalentAuras();
|
||||||
void CastPetAura(PetAura const* aura);
|
void CastPetAura(PetAura const* aura);
|
||||||
|
|
||||||
void _LoadSpellCooldowns();
|
void _LoadSpellCooldowns();
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,6 @@
|
||||||
#include "SQLStorages.h"
|
#include "SQLStorages.h"
|
||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
#include "Calendar.h"
|
#include "Calendar.h"
|
||||||
#include "PhaseMgr.h"
|
|
||||||
#ifdef ENABLE_ELUNA
|
#ifdef ENABLE_ELUNA
|
||||||
#include "LuaEngine.h"
|
#include "LuaEngine.h"
|
||||||
#endif /*ENABLE_ELUNA*/
|
#endif /*ENABLE_ELUNA*/
|
||||||
|
|
@ -568,8 +567,6 @@ Player::Player(WorldSession* session): Unit(), m_mover(this), m_camera(this), m_
|
||||||
m_cachedGS = 0;
|
m_cachedGS = 0;
|
||||||
|
|
||||||
m_slot = 255;
|
m_slot = 255;
|
||||||
|
|
||||||
phaseMgr = new PhaseMgr(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Player::~Player()
|
Player::~Player()
|
||||||
|
|
@ -610,8 +607,6 @@ Player::~Player()
|
||||||
|
|
||||||
delete m_declinedname;
|
delete m_declinedname;
|
||||||
delete m_runes;
|
delete m_runes;
|
||||||
|
|
||||||
delete phaseMgr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::CleanupsBeforeDelete()
|
void Player::CleanupsBeforeDelete()
|
||||||
|
|
@ -853,6 +848,9 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c
|
||||||
}
|
}
|
||||||
// all item positions resolved
|
// all item positions resolved
|
||||||
|
|
||||||
|
if (info->phaseMap != 0)
|
||||||
|
CharacterDatabase.PExecute("REPLACE INTO `character_phase_data` (`guid`, `map`) VALUES (%u, %u)", guidlow, info->phaseMap);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -958,7 +956,11 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
|
||||||
data << uint32(resist);
|
data << uint32(resist);
|
||||||
SendMessageToSet(&data, true);
|
SendMessageToSet(&data, true);
|
||||||
|
|
||||||
uint32 final_damage = DealDamage(this, damage, NULL, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
DamageEffectType damageType = SELF_DAMAGE;
|
||||||
|
if (type == DAMAGE_FALL && getClass() == CLASS_ROGUE)
|
||||||
|
damageType = SELF_DAMAGE_ROGUE_FALL;
|
||||||
|
|
||||||
|
uint32 final_damage = DealDamage(this, damage, NULL, damageType, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||||
|
|
||||||
if (!IsAlive())
|
if (!IsAlive())
|
||||||
{
|
{
|
||||||
|
|
@ -1390,8 +1392,8 @@ void Player::Update(uint32 update_diff, uint32 p_time)
|
||||||
HandleSobering();
|
HandleSobering();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not auto-free ghost from body in instances
|
// Not auto-free ghost from body in instances; also check for resurrection prevention
|
||||||
if (m_deathTimer > 0 && !GetMap()->Instanceable())
|
if (m_deathTimer > 0 && !GetMap()->Instanceable() && !HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
|
||||||
{
|
{
|
||||||
if (p_time >= m_deathTimer)
|
if (p_time >= m_deathTimer)
|
||||||
{
|
{
|
||||||
|
|
@ -2448,7 +2450,15 @@ void Player::SetGameMaster(bool on)
|
||||||
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM);
|
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM);
|
||||||
|
|
||||||
// restore phase
|
// restore phase
|
||||||
SetPhaseMask(phaseMgr->GetCurrentPhasemask(), false);
|
AuraList const& phases = GetAurasByType(SPELL_AURA_PHASE);
|
||||||
|
AuraList const& phases2 = GetAurasByType(SPELL_AURA_PHASE_2);
|
||||||
|
|
||||||
|
if (!phases.empty())
|
||||||
|
SetPhaseMask(phases.front()->GetMiscValue(), false);
|
||||||
|
else if (!phases2.empty())
|
||||||
|
SetPhaseMask(phases2.front()->GetMiscValue(), false);
|
||||||
|
else
|
||||||
|
SetPhaseMask(PHASEMASK_NORMAL, false);
|
||||||
|
|
||||||
CallForAllControlledUnits(SetGameMasterOffHelper(getFaction()), CONTROLLED_PET | CONTROLLED_TOTEMS | CONTROLLED_GUARDIANS | CONTROLLED_CHARM);
|
CallForAllControlledUnits(SetGameMasterOffHelper(getFaction()), CONTROLLED_PET | CONTROLLED_TOTEMS | CONTROLLED_GUARDIANS | CONTROLLED_CHARM);
|
||||||
|
|
||||||
|
|
@ -2460,9 +2470,6 @@ void Player::SetGameMaster(bool on)
|
||||||
UpdateArea(m_areaUpdateId);
|
UpdateArea(m_areaUpdateId);
|
||||||
|
|
||||||
getHostileRefManager().setOnlineOfflineState(true);
|
getHostileRefManager().setOnlineOfflineState(true);
|
||||||
|
|
||||||
phaseMgr->AddUpdateFlag(PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED);
|
|
||||||
phaseMgr->Update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_camera.UpdateVisibilityForOwner();
|
m_camera.UpdateVisibilityForOwner();
|
||||||
|
|
@ -2691,11 +2698,6 @@ void Player::GiveLevel(uint32 level)
|
||||||
MailDraft(mailReward->mailTemplateId).SendMailTo(this, MailSender(MAIL_CREATURE, mailReward->senderEntry));
|
MailDraft(mailReward->mailTemplateId).SendMailTo(this, MailSender(MAIL_CREATURE, mailReward->senderEntry));
|
||||||
|
|
||||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL);
|
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL);
|
||||||
|
|
||||||
PhaseUpdateData phaseUdateData;
|
|
||||||
phaseUdateData.AddConditionType(CONDITION_LEVEL);
|
|
||||||
|
|
||||||
phaseMgr->NotifyConditionChanged(phaseUdateData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::UpdateFreeTalentPoints(bool resetIfNeed)
|
void Player::UpdateFreeTalentPoints(bool resetIfNeed)
|
||||||
|
|
@ -3080,7 +3082,6 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
|
||||||
|
|
||||||
PlayerSpellState state = learning ? PLAYERSPELL_NEW : PLAYERSPELL_UNCHANGED;
|
PlayerSpellState state = learning ? PLAYERSPELL_NEW : PLAYERSPELL_UNCHANGED;
|
||||||
|
|
||||||
bool dependent_set = false;
|
|
||||||
bool disabled_case = false;
|
bool disabled_case = false;
|
||||||
bool superceded_old = false;
|
bool superceded_old = false;
|
||||||
|
|
||||||
|
|
@ -3088,6 +3089,8 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
|
||||||
if (itr != m_spells.end())
|
if (itr != m_spells.end())
|
||||||
{
|
{
|
||||||
uint32 next_active_spell_id = 0;
|
uint32 next_active_spell_id = 0;
|
||||||
|
bool dependent_set = false;
|
||||||
|
|
||||||
// fix activate state for non-stackable low rank (and find next spell for !active case)
|
// fix activate state for non-stackable low rank (and find next spell for !active case)
|
||||||
if (sSpellMgr.IsRankedSpellNonStackableInSpellBook(spellInfo))
|
if (sSpellMgr.IsRankedSpellNonStackableInSpellBook(spellInfo))
|
||||||
{
|
{
|
||||||
|
|
@ -4688,7 +4691,7 @@ void Player::KillPlayer()
|
||||||
// SetFlag( UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_IN_PVP );
|
// SetFlag( UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_IN_PVP );
|
||||||
|
|
||||||
SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
|
SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
|
||||||
ApplyModByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(GetMapId())->Instanceable());
|
ApplyModByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(GetMapId())->Instanceable() && !HasAuraType(SPELL_AURA_PREVENT_RESURRECTION));
|
||||||
|
|
||||||
// 6 minutes until repop at graveyard
|
// 6 minutes until repop at graveyard
|
||||||
m_deathTimer = 6 * MINUTE * IN_MILLISECONDS;
|
m_deathTimer = 6 * MINUTE * IN_MILLISECONDS;
|
||||||
|
|
@ -6884,11 +6887,7 @@ void Player::UpdateArea(uint32 newArea)
|
||||||
SetFFAPvP(false);
|
SetFFAPvP(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
phaseMgr->AddUpdateFlag(PHASE_UPDATE_FLAG_AREA_UPDATE);
|
|
||||||
|
|
||||||
UpdateAreaDependentAuras();
|
UpdateAreaDependentAuras();
|
||||||
|
|
||||||
phaseMgr->RemoveUpdateFlag(PHASE_UPDATE_FLAG_AREA_UPDATE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Player::CanUseCapturePoint()
|
bool Player::CanUseCapturePoint()
|
||||||
|
|
@ -8498,7 +8497,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
|
||||||
// 0 - Battle for Wintergrasp in progress, 1 - otherwise
|
// 0 - Battle for Wintergrasp in progress, 1 - otherwise
|
||||||
FillInitialWorldState(data, count, 0xED9, 1);
|
FillInitialWorldState(data, count, 0xED9, 1);
|
||||||
// Time when next Battle for Wintergrasp starts
|
// Time when next Battle for Wintergrasp starts
|
||||||
FillInitialWorldState(data, count, 0x1102, uint32(time(nullptr) + 9000));
|
FillInitialWorldState(data, count, 0x1102, uint32(time(NULL) + 9000));
|
||||||
|
|
||||||
switch (zoneid)
|
switch (zoneid)
|
||||||
{
|
{
|
||||||
|
|
@ -8844,10 +8843,10 @@ InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const
|
||||||
return EQUIP_ERR_OK;
|
return EQUIP_ERR_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Bag* pBag;
|
|
||||||
for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||||
{
|
{
|
||||||
pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i);
|
Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i);
|
||||||
if (pBag)
|
if (pBag)
|
||||||
{
|
{
|
||||||
for (uint32 j = 0; j < pBag->GetBagSize(); ++j)
|
for (uint32 j = 0; j < pBag->GetBagSize(); ++j)
|
||||||
|
|
@ -13211,7 +13210,7 @@ void Player::SendPreparedQuest(ObjectGuid guid)
|
||||||
{
|
{
|
||||||
qe._Delay = 0; // TEXTEMOTE_MESSAGE; // zyg: player emote
|
qe._Delay = 0; // TEXTEMOTE_MESSAGE; // zyg: player emote
|
||||||
qe._Emote = 0; // TEXTEMOTE_HELLO; // zyg: NPC emote
|
qe._Emote = 0; // TEXTEMOTE_HELLO; // zyg: NPC emote
|
||||||
title = "";
|
title.clear();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -14423,11 +14422,6 @@ void Player::SetQuestStatus(uint32 quest_id, QuestStatus status)
|
||||||
q_status.uState = QUEST_CHANGED;
|
q_status.uState = QUEST_CHANGED;
|
||||||
}
|
}
|
||||||
|
|
||||||
PhaseUpdateData phaseUdateData;
|
|
||||||
phaseUdateData.AddQuestUpdate(quest_id);
|
|
||||||
|
|
||||||
phaseMgr->NotifyConditionChanged(phaseUdateData);
|
|
||||||
|
|
||||||
UpdateForQuestWorldObjects();
|
UpdateForQuestWorldObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -18965,18 +18959,14 @@ void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
|
||||||
WorldPacket data(SMSG_SPELL_COOLDOWN, 8 + 1 + m_spells.size() * 8);
|
WorldPacket data(SMSG_SPELL_COOLDOWN, 8 + 1 + m_spells.size() * 8);
|
||||||
data << GetObjectGuid();
|
data << GetObjectGuid();
|
||||||
data << uint8(0x0); // flags (0x1, 0x2)
|
data << uint8(0x0); // flags (0x1, 0x2)
|
||||||
time_t curTime = time(NULL);
|
time_t curTime = time(nullptr);
|
||||||
for (PlayerSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
|
for (PlayerSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
|
||||||
{
|
{
|
||||||
if (itr->second.state == PLAYERSPELL_REMOVED)
|
if (itr->second.state == PLAYERSPELL_REMOVED)
|
||||||
continue;
|
continue;
|
||||||
uint32 unSpellId = itr->first;
|
uint32 unSpellId = itr->first;
|
||||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(unSpellId);
|
SpellEntry const* spellInfo = sSpellStore.LookupEntry(unSpellId);
|
||||||
if (!spellInfo)
|
MANGOS_ASSERT(spellInfo);
|
||||||
{
|
|
||||||
MANGOS_ASSERT(spellInfo);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Not send cooldown for this spells
|
// Not send cooldown for this spells
|
||||||
if (spellInfo->HasAttribute(SPELL_ATTR_DISABLED_WHILE_ACTIVE))
|
if (spellInfo->HasAttribute(SPELL_ATTR_DISABLED_WHILE_ACTIVE))
|
||||||
|
|
@ -22103,6 +22093,25 @@ void Player::_LoadSkills(QueryResult* result)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 Player::GetPhaseMaskForSpawn() const
|
||||||
|
{
|
||||||
|
uint32 phase = PHASEMASK_NORMAL;
|
||||||
|
if (!isGameMaster())
|
||||||
|
phase = GetPhaseMask();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AuraList const& phases = GetAurasByType(SPELL_AURA_PHASE);
|
||||||
|
if (!phases.empty())
|
||||||
|
phase = phases.front()->GetMiscValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
// some aura phases include 1 normal map in addition to phase itself
|
||||||
|
if (uint32 n_phase = phase & ~PHASEMASK_NORMAL)
|
||||||
|
return n_phase;
|
||||||
|
|
||||||
|
return PHASEMASK_NORMAL;
|
||||||
|
}
|
||||||
|
|
||||||
InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limit_count) const
|
InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limit_count) const
|
||||||
{
|
{
|
||||||
ItemPrototype const* pProto = pItem->GetProto();
|
ItemPrototype const* pProto = pItem->GetProto();
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,6 @@ class PlayerSocial;
|
||||||
class DungeonPersistentState;
|
class DungeonPersistentState;
|
||||||
class Spell;
|
class Spell;
|
||||||
class Item;
|
class Item;
|
||||||
class PhaseMgr;
|
|
||||||
|
|
||||||
struct AreaTrigger;
|
struct AreaTrigger;
|
||||||
|
|
||||||
|
|
@ -1209,7 +1208,7 @@ class Player : public Unit
|
||||||
|
|
||||||
void RemovePet(PetSaveMode mode);
|
void RemovePet(PetSaveMode mode);
|
||||||
|
|
||||||
PhaseMgr* GetPhaseMgr() { return phaseMgr; }
|
uint32 GetPhaseMaskForSpawn() const; // used for proper set phase for DB at GM-mode creature/GO spawn
|
||||||
|
|
||||||
void Say(const std::string& text, const uint32 language);
|
void Say(const std::string& text, const uint32 language);
|
||||||
void Yell(const std::string& text, const uint32 language);
|
void Yell(const std::string& text, const uint32 language);
|
||||||
|
|
@ -2854,8 +2853,6 @@ class Player : public Unit
|
||||||
uint32 m_timeSyncServer;
|
uint32 m_timeSyncServer;
|
||||||
|
|
||||||
uint32 m_cachedGS;
|
uint32 m_cachedGS;
|
||||||
|
|
||||||
PhaseMgr* phaseMgr;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddItemsSetItem(Player* player, Item* item);
|
void AddItemsSetItem(Player* player, Item* item);
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ ReactorAI::MoveInLineOfSight(Unit*)
|
||||||
void
|
void
|
||||||
ReactorAI::AttackStart(Unit* p)
|
ReactorAI::AttackStart(Unit* p)
|
||||||
{
|
{
|
||||||
if (!p)
|
if (!p || !m_creature->CanAttackByItself())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_creature->Attack(p, true))
|
if (m_creature->Attack(p, true))
|
||||||
|
|
|
||||||
|
|
@ -142,13 +142,14 @@ void ReputationMgr::SendState(FactionState const* faction, bool anyRankIncreased
|
||||||
|
|
||||||
for (FactionStateList::iterator itr = m_factions.begin(); itr != m_factions.end(); ++itr)
|
for (FactionStateList::iterator itr = m_factions.begin(); itr != m_factions.end(); ++itr)
|
||||||
{
|
{
|
||||||
if (itr->second.needSend)
|
FactionState& subFaction = itr->second;
|
||||||
|
if (subFaction.needSend)
|
||||||
{
|
{
|
||||||
itr->second.needSend = false;
|
subFaction.needSend = false;
|
||||||
if (itr->second.ReputationListID != faction->ReputationListID)
|
if (subFaction.ReputationListID != faction->ReputationListID)
|
||||||
{
|
{
|
||||||
data << uint32(itr->second.ReputationListID);
|
data << uint32(subFaction.ReputationListID);
|
||||||
data << uint32(itr->second.Standing);
|
data << uint32(subFaction.Standing);
|
||||||
|
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
|
|
@ -317,36 +318,39 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in
|
||||||
FactionStateList::iterator itr = m_factions.find(factionEntry->reputationListID);
|
FactionStateList::iterator itr = m_factions.find(factionEntry->reputationListID);
|
||||||
if (itr != m_factions.end())
|
if (itr != m_factions.end())
|
||||||
{
|
{
|
||||||
|
FactionState& faction = itr->second;
|
||||||
int32 BaseRep = GetBaseReputation(factionEntry);
|
int32 BaseRep = GetBaseReputation(factionEntry);
|
||||||
|
|
||||||
if (incremental)
|
if (incremental)
|
||||||
standing += itr->second.Standing + BaseRep;
|
standing += faction.Standing + BaseRep;
|
||||||
|
|
||||||
if (standing > Reputation_Cap)
|
if (standing > Reputation_Cap)
|
||||||
standing = Reputation_Cap;
|
standing = Reputation_Cap;
|
||||||
else if (standing < Reputation_Bottom)
|
else if (standing < Reputation_Bottom)
|
||||||
standing = Reputation_Bottom;
|
standing = Reputation_Bottom;
|
||||||
|
|
||||||
ReputationRank old_rank = ReputationToRank(itr->second.Standing + BaseRep);
|
ReputationRank old_rank = ReputationToRank(faction.Standing + BaseRep);
|
||||||
ReputationRank new_rank = ReputationToRank(standing);
|
ReputationRank new_rank = ReputationToRank(standing);
|
||||||
|
|
||||||
itr->second.Standing = standing - BaseRep;
|
faction.Standing = standing - BaseRep;
|
||||||
itr->second.needSend = true;
|
faction.needSend = true;
|
||||||
itr->second.needSave = true;
|
faction.needSave = true;
|
||||||
|
|
||||||
SetVisible(&itr->second);
|
SetVisible(&faction);
|
||||||
|
|
||||||
if (new_rank <= REP_HOSTILE)
|
if (new_rank <= REP_HOSTILE)
|
||||||
SetAtWar(&itr->second, true);
|
SetAtWar(&faction, true);
|
||||||
|
|
||||||
UpdateRankCounters(old_rank, new_rank);
|
UpdateRankCounters(old_rank, new_rank);
|
||||||
|
|
||||||
m_player->ReputationChanged(factionEntry);
|
m_player->ReputationChanged(factionEntry);
|
||||||
m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS, factionEntry->ID);
|
|
||||||
m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->ID);
|
AchievementMgr& achievementManager = m_player->GetAchievementMgr();
|
||||||
m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, factionEntry->ID);
|
achievementManager.UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS, factionEntry->ID);
|
||||||
m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION, factionEntry->ID);
|
achievementManager.UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->ID);
|
||||||
m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION, factionEntry->ID);
|
achievementManager.UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, factionEntry->ID);
|
||||||
|
achievementManager.UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION, factionEntry->ID);
|
||||||
|
achievementManager.UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION, factionEntry->ID);
|
||||||
|
|
||||||
if (new_rank > old_rank)
|
if (new_rank > old_rank)
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -532,11 +536,12 @@ void ReputationMgr::SaveToDB()
|
||||||
|
|
||||||
for (FactionStateList::iterator itr = m_factions.begin(); itr != m_factions.end(); ++itr)
|
for (FactionStateList::iterator itr = m_factions.begin(); itr != m_factions.end(); ++itr)
|
||||||
{
|
{
|
||||||
if (itr->second.needSave)
|
FactionState& faction = itr->second;
|
||||||
|
if (faction.needSave)
|
||||||
{
|
{
|
||||||
stmtDel.PExecute(m_player->GetGUIDLow(), itr->second.ID);
|
stmtDel.PExecute(m_player->GetGUIDLow(), faction.ID);
|
||||||
stmtIns.PExecute(m_player->GetGUIDLow(), itr->second.ID, itr->second.Standing, itr->second.Flags);
|
stmtIns.PExecute(m_player->GetGUIDLow(), faction.ID, faction.Standing, faction.Flags);
|
||||||
itr->second.needSave = false;
|
faction.needSave = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -138,19 +138,20 @@ void PlayerSocial::SendSocialList()
|
||||||
|
|
||||||
for (PlayerSocialMap::iterator itr = m_playerSocialMap.begin(); itr != m_playerSocialMap.end(); ++itr)
|
for (PlayerSocialMap::iterator itr = m_playerSocialMap.begin(); itr != m_playerSocialMap.end(); ++itr)
|
||||||
{
|
{
|
||||||
sSocialMgr.GetFriendInfo(plr, itr->first, itr->second);
|
FriendInfo& friendInfo = itr->second;
|
||||||
|
sSocialMgr.GetFriendInfo(plr, itr->first, friendInfo);
|
||||||
|
|
||||||
data << ObjectGuid(HIGHGUID_PLAYER, itr->first); // player guid
|
data << ObjectGuid(HIGHGUID_PLAYER, itr->first); // player guid
|
||||||
data << uint32(itr->second.Flags); // player flag (0x1-friend?, 0x2-ignored?, 0x4-muted?)
|
data << uint32(friendInfo.Flags); // player flag (0x1-friend?, 0x2-ignored?, 0x4-muted?)
|
||||||
data << itr->second.Note; // string note
|
data << friendInfo.Note; // string note
|
||||||
if (itr->second.Flags & SOCIAL_FLAG_FRIEND) // if IsFriend()
|
if (friendInfo.Flags & SOCIAL_FLAG_FRIEND) // if IsFriend()
|
||||||
{
|
{
|
||||||
data << uint8(itr->second.Status); // online/offline/etc?
|
data << uint8(friendInfo.Status); // online/offline/etc?
|
||||||
if (itr->second.Status) // if online
|
if (friendInfo.Status) // if online
|
||||||
{
|
{
|
||||||
data << uint32(itr->second.Area); // player area
|
data << uint32(friendInfo.Area); // player area
|
||||||
data << uint32(itr->second.Level); // player level
|
data << uint32(friendInfo.Level); // player level
|
||||||
data << uint32(itr->second.Class); // player class
|
data << uint32(friendInfo.Class); // player class
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -776,6 +776,8 @@ bool IsPositiveEffect(SpellEntry const* spellproto, SpellEffectIndex effIndex)
|
||||||
// some explicitly required script effect sets
|
// some explicitly required script effect sets
|
||||||
switch (spellproto->Id)
|
switch (spellproto->Id)
|
||||||
{
|
{
|
||||||
|
case 42436: // Drink!
|
||||||
|
case 42492: // Cast Energized
|
||||||
case 46650: // Open Brutallus Back Door
|
case 46650: // Open Brutallus Back Door
|
||||||
case 62488: // Activate Construct
|
case 62488: // Activate Construct
|
||||||
case 64503: // Water
|
case 64503: // Water
|
||||||
|
|
@ -903,6 +905,7 @@ bool IsPositiveEffect(SpellEntry const* spellproto, SpellEffectIndex effIndex)
|
||||||
case SPELL_AURA_PERIODIC_LEECH:
|
case SPELL_AURA_PERIODIC_LEECH:
|
||||||
case SPELL_AURA_MOD_STALKED:
|
case SPELL_AURA_MOD_STALKED:
|
||||||
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
|
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
|
||||||
|
case SPELL_AURA_PREVENT_RESURRECTION:
|
||||||
return false;
|
return false;
|
||||||
case SPELL_AURA_PERIODIC_DAMAGE: // used in positive spells also.
|
case SPELL_AURA_PERIODIC_DAMAGE: // used in positive spells also.
|
||||||
// part of negative spell if casted at self (prevent cancel)
|
// part of negative spell if casted at self (prevent cancel)
|
||||||
|
|
@ -2231,6 +2234,25 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
|
||||||
if ((spellInfo_1->Id == 62559 && spellInfo_2->Id == 62538) ||
|
if ((spellInfo_1->Id == 62559 && spellInfo_2->Id == 62538) ||
|
||||||
(spellInfo_2->Id == 62559 && spellInfo_1->Id == 62538))
|
(spellInfo_2->Id == 62559 && spellInfo_1->Id == 62538))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Phase 2 Transform and Shadowy Barrier
|
||||||
|
if ((spellInfo_1->Id == 65157 && spellInfo_2->Id == 64775) ||
|
||||||
|
(spellInfo_2->Id == 65157 && spellInfo_1->Id == 64775))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Empowered (dummy) and Empowered
|
||||||
|
if ((spellInfo_1->Id == 64161 && spellInfo_2->Id == 65294) ||
|
||||||
|
(spellInfo_2->Id == 64161 && spellInfo_1->Id == 65294))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Spectral Realm (reaction) and Spectral Realm (invisibility)
|
||||||
|
if ((spellInfo_1->Id == 44852 && spellInfo_2->Id == 46021) ||
|
||||||
|
(spellInfo_2->Id == 44852 && spellInfo_1->Id == 46021))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Halls of Reflection Clone
|
||||||
|
if (spellInfo_1->SpellIconID == 692 && spellInfo_2->SpellIconID == 692)
|
||||||
|
return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SPELLFAMILY_MAGE:
|
case SPELLFAMILY_MAGE:
|
||||||
|
|
@ -3489,7 +3511,11 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||||
spellEffect->EffectImplicitTargetA == TARGET_AREAEFFECT_GO_AROUND_SOURCE ||
|
spellEffect->EffectImplicitTargetA == TARGET_AREAEFFECT_GO_AROUND_SOURCE ||
|
||||||
spellEffect->EffectImplicitTargetB == TARGET_AREAEFFECT_GO_AROUND_SOURCE ||
|
spellEffect->EffectImplicitTargetB == TARGET_AREAEFFECT_GO_AROUND_SOURCE ||
|
||||||
spellEffect->EffectImplicitTargetA == TARGET_AREAEFFECT_GO_AROUND_DEST ||
|
spellEffect->EffectImplicitTargetA == TARGET_AREAEFFECT_GO_AROUND_DEST ||
|
||||||
spellEffect->EffectImplicitTargetB == TARGET_AREAEFFECT_GO_AROUND_DEST)
|
spellEffect->EffectImplicitTargetB == TARGET_AREAEFFECT_GO_AROUND_DEST ||
|
||||||
|
spellEffect->EffectImplicitTargetA == TARGET_NARROW_FRONTAL_CONE ||
|
||||||
|
spellEffect->EffectImplicitTargetB == TARGET_NARROW_FRONTAL_CONE ||
|
||||||
|
spellEffect->EffectImplicitTargetA == TARGET_NARROW_FRONTAL_CONE_2 ||
|
||||||
|
spellEffect->EffectImplicitTargetB == TARGET_NARROW_FRONTAL_CONE_2)
|
||||||
{
|
{
|
||||||
targetfound = true;
|
targetfound = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -1128,8 +1128,8 @@ class SpellMgr
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 IsHighRankOfSpell(uint32 spell1, uint32 spell2) const
|
bool IsHighRankOfSpell(uint32 spell1, uint32 spell2) const
|
||||||
{
|
{
|
||||||
SpellChainMap::const_iterator itr = mSpellChains.find(spell1);
|
SpellChainMap::const_iterator itr = mSpellChains.find(spell1);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -217,3 +217,11 @@ void TemporarySummon::UnSummon()
|
||||||
void TemporarySummon::SaveToDB()
|
void TemporarySummon::SaveToDB()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TemporarySummonWaypoint::TemporarySummonWaypoint(ObjectGuid summoner, uint32 waypoint_id, int32 path_id, uint32 pathOrigin) :
|
||||||
|
TemporarySummon(summoner),
|
||||||
|
m_waypoint_id(waypoint_id),
|
||||||
|
m_path_id(path_id),
|
||||||
|
m_pathOrigin(pathOrigin)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,4 +55,20 @@ class TemporarySummon : public Creature
|
||||||
uint32 m_lifetime;
|
uint32 m_lifetime;
|
||||||
ObjectGuid m_summoner;
|
ObjectGuid m_summoner;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class TemporarySummonWaypoint : public TemporarySummon
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit TemporarySummonWaypoint(ObjectGuid summoner, uint32 waypoint_id, int32 path_id, uint32 pathOrigin);
|
||||||
|
|
||||||
|
uint32 GetWaypointId() const { return m_waypoint_id; }
|
||||||
|
int32 GetPathId() const { return m_path_id; }
|
||||||
|
uint32 GetPathOrigin() const { return m_pathOrigin; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
uint32 m_waypoint_id;
|
||||||
|
int32 m_path_id;
|
||||||
|
uint32 m_pathOrigin;
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -189,8 +189,13 @@ void Totem::SetTypeBySummonSpell(SpellEntry const* spellProto)
|
||||||
|
|
||||||
bool Totem::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index, bool castOnSelf) const
|
bool Totem::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index, bool castOnSelf) const
|
||||||
{
|
{
|
||||||
|
// Totem may affected by some specific spells
|
||||||
|
// Mana Spring, Healing stream, Mana tide
|
||||||
|
// Flags : 0x00000002000 | 0x00000004000 | 0x00004000000 -> 0x00004006000
|
||||||
|
if (spellInfo->GetSpellFamilyName() == SPELLFAMILY_SHAMAN && spellInfo->IsFitToFamilyMask(UI64LIT(0x00004006000)))
|
||||||
|
return false;
|
||||||
SpellEffectEntry const* spellEffect = spellInfo->GetSpellEffect(index);
|
SpellEffectEntry const* spellEffect = spellInfo->GetSpellEffect(index);
|
||||||
if(spellEffect)
|
if (spellEffect)
|
||||||
{
|
{
|
||||||
// TODO: possibly all negative auras immune?
|
// TODO: possibly all negative auras immune?
|
||||||
switch(spellEffect->Effect)
|
switch(spellEffect->Effect)
|
||||||
|
|
|
||||||
|
|
@ -883,14 +883,12 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||||
// remove affects from attacker at any non-DoT damage (including 0 damage)
|
// remove affects from attacker at any non-DoT damage (including 0 damage)
|
||||||
if (damagetype != DOT)
|
if (damagetype != DOT)
|
||||||
{
|
{
|
||||||
RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
if (damagetype != SELF_DAMAGE_ROGUE_FALL)
|
||||||
|
RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||||
RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
|
RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
|
||||||
|
|
||||||
if (pVictim != this)
|
|
||||||
RemoveSpellsCausingAura(SPELL_AURA_MOD_INVISIBILITY);
|
|
||||||
|
|
||||||
if (pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->IsStandState() && !pVictim->hasUnitState(UNIT_STAT_STUNNED))
|
if (pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->IsStandState() && !pVictim->hasUnitState(UNIT_STAT_STUNNED))
|
||||||
{ pVictim->SetStandState(UNIT_STAND_STATE_STAND); }
|
pVictim->SetStandState(UNIT_STAND_STATE_STAND);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!damage)
|
if (!damage)
|
||||||
|
|
@ -952,7 +950,7 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||||
|
|
||||||
((Creature*)pVictim)->SetLootRecipient(this);
|
((Creature*)pVictim)->SetLootRecipient(this);
|
||||||
|
|
||||||
JustKilledCreature((Creature*)pVictim, nullptr);
|
JustKilledCreature((Creature*)pVictim, NULL);
|
||||||
pVictim->SetHealth(0);
|
pVictim->SetHealth(0);
|
||||||
|
|
||||||
return damage;
|
return damage;
|
||||||
|
|
@ -978,7 +976,7 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||||
{
|
{
|
||||||
SpellEntry const* shareSpell = (*itr)->GetSpellProto();
|
SpellEntry const* shareSpell = (*itr)->GetSpellProto();
|
||||||
uint32 shareDamage = uint32(damage*(*itr)->GetModifier()->m_amount / 100.0f);
|
uint32 shareDamage = uint32(damage*(*itr)->GetModifier()->m_amount / 100.0f);
|
||||||
DealDamageMods(shareTarget, shareDamage, nullptr);
|
DealDamageMods(shareTarget, shareDamage, NULL);
|
||||||
DealDamage(shareTarget, shareDamage, 0, damagetype, GetSpellSchoolMask(shareSpell), shareSpell, false);
|
DealDamage(shareTarget, shareDamage, 0, damagetype, GetSpellSchoolMask(shareSpell), shareSpell, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4335,7 +4333,7 @@ bool Unit::AddSpellAuraHolder(SpellAuraHolder* holder)
|
||||||
|
|
||||||
switch (aurNameReal)
|
switch (aurNameReal)
|
||||||
{
|
{
|
||||||
// DoT/HoT/etc
|
// DoT/HoT/etc
|
||||||
case SPELL_AURA_DUMMY: // allow stack
|
case SPELL_AURA_DUMMY: // allow stack
|
||||||
case SPELL_AURA_PERIODIC_DAMAGE:
|
case SPELL_AURA_PERIODIC_DAMAGE:
|
||||||
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
|
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
|
||||||
|
|
@ -4346,7 +4344,7 @@ bool Unit::AddSpellAuraHolder(SpellAuraHolder* holder)
|
||||||
case SPELL_AURA_OBS_MOD_MANA:
|
case SPELL_AURA_OBS_MOD_MANA:
|
||||||
case SPELL_AURA_POWER_BURN_MANA:
|
case SPELL_AURA_POWER_BURN_MANA:
|
||||||
case SPELL_AURA_CONTROL_VEHICLE:
|
case SPELL_AURA_CONTROL_VEHICLE:
|
||||||
case SPELL_AURA_284: // SPELL_AURA_LINKED_AURA, unknown how it is handled, but let it stack like vehicle control aura
|
case SPELL_AURA_TRIGGER_LINKED_AURA:
|
||||||
case SPELL_AURA_PERIODIC_DUMMY:
|
case SPELL_AURA_PERIODIC_DUMMY:
|
||||||
break;
|
break;
|
||||||
case SPELL_AURA_PERIODIC_ENERGIZE: // all or self or clear non-stackable
|
case SPELL_AURA_PERIODIC_ENERGIZE: // all or self or clear non-stackable
|
||||||
|
|
@ -4367,7 +4365,7 @@ bool Unit::AddSpellAuraHolder(SpellAuraHolder* holder)
|
||||||
if (!IsPassiveSpell(aurSpellInfo) || !IsPassiveSpellStackableWithRanks(aurSpellInfo))
|
if (!IsPassiveSpell(aurSpellInfo) || !IsPassiveSpellStackableWithRanks(aurSpellInfo))
|
||||||
{
|
{
|
||||||
// Hack exceptions for Vehicle/Linked auras
|
// Hack exceptions for Vehicle/Linked auras
|
||||||
if (!IsSpellHaveAura(aurSpellInfo, SPELL_AURA_CONTROL_VEHICLE) && !IsSpellHaveAura(aurSpellInfo, SPELL_AURA_284) &&
|
if (!IsSpellHaveAura(aurSpellInfo, SPELL_AURA_CONTROL_VEHICLE) && !IsSpellHaveAura(aurSpellInfo, SPELL_AURA_TRIGGER_LINKED_AURA) &&
|
||||||
!RemoveNoStackAurasDueToAuraHolder(holder))
|
!RemoveNoStackAurasDueToAuraHolder(holder))
|
||||||
{
|
{
|
||||||
delete holder;
|
delete holder;
|
||||||
|
|
@ -5750,8 +5748,10 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, SpellSchoolMask d
|
||||||
|
|
||||||
void Unit::SetPowerType(Powers new_powertype)
|
void Unit::SetPowerType(Powers new_powertype)
|
||||||
{
|
{
|
||||||
|
// set power type
|
||||||
SetByteValue(UNIT_FIELD_BYTES_0, 3, new_powertype);
|
SetByteValue(UNIT_FIELD_BYTES_0, 3, new_powertype);
|
||||||
|
|
||||||
|
// group updates
|
||||||
if (GetTypeId() == TYPEID_PLAYER)
|
if (GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
if (((Player*)this)->GetGroup())
|
if (((Player*)this)->GetGroup())
|
||||||
|
|
@ -5768,22 +5768,38 @@ void Unit::SetPowerType(Powers new_powertype)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (new_powertype)
|
// special cases for power type switching (druid and pets only)
|
||||||
|
if (GetTypeId() == TYPEID_PLAYER || (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->IsPet()))
|
||||||
{
|
{
|
||||||
default:
|
uint32 maxValue = GetCreatePowers(new_powertype);
|
||||||
case POWER_MANA:
|
uint32 curValue = maxValue;
|
||||||
break;
|
|
||||||
case POWER_RAGE:
|
// special cases with current power = 0
|
||||||
SetMaxPower(POWER_RAGE, GetCreatePowers(POWER_RAGE));
|
switch (new_powertype)
|
||||||
SetPower(POWER_RAGE, 0);
|
{
|
||||||
break;
|
case POWER_RAGE:
|
||||||
case POWER_FOCUS:
|
case POWER_RUNE:
|
||||||
SetMaxPower(POWER_FOCUS, GetCreatePowers(POWER_FOCUS));
|
case POWER_RUNIC_POWER:
|
||||||
SetPower(POWER_FOCUS, GetCreatePowers(POWER_FOCUS));
|
curValue = 0;
|
||||||
break;
|
break;
|
||||||
case POWER_ENERGY:
|
default:
|
||||||
SetMaxPower(POWER_ENERGY, GetCreatePowers(POWER_ENERGY));
|
break;
|
||||||
break;
|
}
|
||||||
|
|
||||||
|
// set power (except for mana)
|
||||||
|
if (new_powertype != POWER_MANA)
|
||||||
|
{
|
||||||
|
SetMaxPower(new_powertype, maxValue);
|
||||||
|
SetPower(new_powertype, curValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
// send power type update to client
|
||||||
|
WorldPacket data(SMSG_POWER_UPDATE);
|
||||||
|
data << GetPackGUID();
|
||||||
|
data << uint32(1); // power count
|
||||||
|
data << uint8(new_powertype);
|
||||||
|
data << uint32(curValue);
|
||||||
|
SendMessageToSet(&data, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -6717,7 +6733,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* pVictim, SpellEntry const* spellProto, u
|
||||||
|
|
||||||
// Creature damage
|
// Creature damage
|
||||||
if (GetTypeId() == TYPEID_UNIT && !((Creature*)this)->IsPet())
|
if (GetTypeId() == TYPEID_UNIT && !((Creature*)this)->IsPet())
|
||||||
DoneTotalMod *= ((Creature*)this)->GetSpellDamageMod(((Creature*)this)->GetCreatureInfo()->Rank);
|
DoneTotalMod *= ((Creature*)this)->_GetSpellDamageMod(((Creature*)this)->GetCreatureInfo()->Rank);
|
||||||
|
|
||||||
AuraList const& mModDamagePercentDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
|
AuraList const& mModDamagePercentDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
|
||||||
for (AuraList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
|
for (AuraList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
|
||||||
|
|
@ -9269,6 +9285,10 @@ void Unit::SetDeathState(DeathState s)
|
||||||
if (IsVehicle())
|
if (IsVehicle())
|
||||||
m_vehicleInfo->RemoveAccessoriesFromMap();
|
m_vehicleInfo->RemoveAccessoriesFromMap();
|
||||||
|
|
||||||
|
// Unboard from transport
|
||||||
|
if (GetTransportInfo() && ((Unit*)GetTransportInfo()->GetTransport())->IsVehicle())
|
||||||
|
((Unit*)GetTransportInfo()->GetTransport())->RemoveSpellsCausingAura(SPELL_AURA_CONTROL_VEHICLE, GetObjectGuid());
|
||||||
|
|
||||||
ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
|
ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
|
||||||
ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
|
ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
|
||||||
// remove aurastates allowing special moves
|
// remove aurastates allowing special moves
|
||||||
|
|
@ -10417,14 +10437,14 @@ uint32 Unit::GetCreatePowers(Powers power) const
|
||||||
{
|
{
|
||||||
case POWER_HEALTH: return 0; // is it really should be here?
|
case POWER_HEALTH: return 0; // is it really should be here?
|
||||||
case POWER_MANA: return GetCreateMana();
|
case POWER_MANA: return GetCreateMana();
|
||||||
case POWER_RAGE: return 1000;
|
case POWER_RAGE: return POWER_RAGE_DEFAULT;
|
||||||
case POWER_FOCUS:
|
case POWER_FOCUS:
|
||||||
if(GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_HUNTER)
|
if(GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_HUNTER)
|
||||||
return 100;
|
return POWER_FOCUS_DEFAULT;
|
||||||
return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->IsPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : 100);
|
return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->IsPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : POWER_FOCUS_DEFAULT);
|
||||||
case POWER_ENERGY: return 100;
|
case POWER_ENERGY: return POWER_ENERGY_DEFAULT;
|
||||||
case POWER_RUNE: return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_DEATH_KNIGHT ? 8 : 0;
|
case POWER_RUNE: return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_DEATH_KNIGHT ? POWER_RUNE_DEFAULT : 0;
|
||||||
case POWER_RUNIC_POWER: return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_DEATH_KNIGHT ? 1000 : 0;
|
case POWER_RUNIC_POWER: return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_DEATH_KNIGHT ? POWER_RUNIC_POWER_DEFAULT : 0;
|
||||||
case POWER_SOUL_SHARDS: return 0;
|
case POWER_SOUL_SHARDS: return 0;
|
||||||
case POWER_ECLIPSE: return 0; // TODO: fix me
|
case POWER_ECLIPSE: return 0; // TODO: fix me
|
||||||
case POWER_HOLY_POWER: return 0;
|
case POWER_HOLY_POWER: return 0;
|
||||||
|
|
@ -10438,9 +10458,9 @@ uint32 Unit::GetCreateMaxPowers(Powers power) const
|
||||||
switch (power)
|
switch (power)
|
||||||
{
|
{
|
||||||
case POWER_HOLY_POWER:
|
case POWER_HOLY_POWER:
|
||||||
return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_PALADIN ? 3 : 0;
|
return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_PALADIN ? POWER_HOLY_POWER_DEFAULT : 0;
|
||||||
case POWER_SOUL_SHARDS:
|
case POWER_SOUL_SHARDS:
|
||||||
return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_WARLOCK ? 3 : 0;
|
return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_WARLOCK ? POWER_SOUL_SHARDS_DEFAULT : 0;
|
||||||
default:
|
default:
|
||||||
return GetCreatePowers(power);
|
return GetCreatePowers(power);
|
||||||
}
|
}
|
||||||
|
|
@ -10593,7 +10613,6 @@ void CharmInfo::InitCharmCreateSpells()
|
||||||
bool onlyselfcast = true;
|
bool onlyselfcast = true;
|
||||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
|
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
|
||||||
|
|
||||||
if (!spellInfo) onlyselfcast = false;
|
|
||||||
for (uint32 i = 0; i < 3 && onlyselfcast; ++i) // nonexistent spell will not make any problems as onlyselfcast would be false -> break right away
|
for (uint32 i = 0; i < 3 && onlyselfcast; ++i) // nonexistent spell will not make any problems as onlyselfcast would be false -> break right away
|
||||||
{
|
{
|
||||||
SpellEffectEntry const* spellEffect = spellInfo->GetSpellEffect(SpellEffectIndex(i));
|
SpellEffectEntry const* spellEffect = spellInfo->GetSpellEffect(SpellEffectIndex(i));
|
||||||
|
|
@ -10843,7 +10862,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag,
|
||||||
if (itr->second->IsDeleted())
|
if (itr->second->IsDeleted())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SpellProcEventEntry const* spellProcEvent = nullptr;
|
SpellProcEventEntry const* spellProcEvent = NULL;
|
||||||
// check if that aura is triggered by proc event (then it will be managed by proc handler)
|
// check if that aura is triggered by proc event (then it will be managed by proc handler)
|
||||||
if (!IsTriggeredAtSpellProcEvent(pTarget, itr->second, procSpell, procFlag, procExtra, attType, isVictim, spellProcEvent))
|
if (!IsTriggeredAtSpellProcEvent(pTarget, itr->second, procSpell, procFlag, procExtra, attType, isVictim, spellProcEvent))
|
||||||
{
|
{
|
||||||
|
|
@ -11031,8 +11050,7 @@ void Unit::StopMoving(bool forceSendStop /*=false*/)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Movement::MoveSplineInit init(*this);
|
Movement::MoveSplineInit init(*this);
|
||||||
init.SetFacing(GetOrientation());
|
init.Stop();
|
||||||
init.Launch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::InterruptMoving(bool forceSendStop /*=false*/)
|
void Unit::InterruptMoving(bool forceSendStop /*=false*/)
|
||||||
|
|
@ -11644,6 +11662,24 @@ void Unit::SetFFAPvP(bool state)
|
||||||
CallForAllControlledUnits(SetFFAPvPHelper(state), CONTROLLED_PET | CONTROLLED_TOTEMS | CONTROLLED_GUARDIANS | CONTROLLED_CHARM);
|
CallForAllControlledUnits(SetFFAPvPHelper(state), CONTROLLED_PET | CONTROLLED_TOTEMS | CONTROLLED_GUARDIANS | CONTROLLED_CHARM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Unit::RestoreOriginalFaction()
|
||||||
|
{
|
||||||
|
if (GetTypeId() == TYPEID_PLAYER)
|
||||||
|
((Player*)this)->setFactionForRace(getRace());
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Creature* creature = (Creature*)this;
|
||||||
|
|
||||||
|
if (creature->IsPet() || creature->IsTotem())
|
||||||
|
{
|
||||||
|
if (Unit* owner = GetOwner())
|
||||||
|
setFaction(owner->getFaction());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
setFaction(creature->GetCreatureInfo()->FactionAlliance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Unit::KnockBackFrom(Unit* target, float horizontalSpeed, float verticalSpeed)
|
void Unit::KnockBackFrom(Unit* target, float horizontalSpeed, float verticalSpeed)
|
||||||
{
|
{
|
||||||
float angle = this == target ? GetOrientation() + M_PI_F : target->GetAngle(this);
|
float angle = this == target ? GetOrientation() + M_PI_F : target->GetAngle(this);
|
||||||
|
|
|
||||||
|
|
@ -753,6 +753,7 @@ class MovementInfo
|
||||||
MovementFlags GetMovementFlags() const { return MovementFlags(moveFlags); }
|
MovementFlags GetMovementFlags() const { return MovementFlags(moveFlags); }
|
||||||
void SetMovementFlags(MovementFlags f) { moveFlags = f; }
|
void SetMovementFlags(MovementFlags f) { moveFlags = f; }
|
||||||
MovementFlags2 GetMovementFlags2() const { return MovementFlags2(moveFlags2); }
|
MovementFlags2 GetMovementFlags2() const { return MovementFlags2(moveFlags2); }
|
||||||
|
void AddMovementFlags2(MovementFlags2 f) { moveFlags2 |= f; }
|
||||||
|
|
||||||
// Position manipulations
|
// Position manipulations
|
||||||
Position const* GetPos() const { return &pos; }
|
Position const* GetPos() const { return &pos; }
|
||||||
|
|
@ -1256,13 +1257,13 @@ enum IgnoreUnitState
|
||||||
// Power type values defines
|
// Power type values defines
|
||||||
enum PowerDefaults
|
enum PowerDefaults
|
||||||
{
|
{
|
||||||
POWER_RAGE_DEFAULT = 1000,
|
POWER_RAGE_DEFAULT = 1000,
|
||||||
POWER_FOCUS_DEFAULT = 100,
|
POWER_FOCUS_DEFAULT = 100,
|
||||||
POWER_ENERGY_DEFAULT = 100,
|
POWER_ENERGY_DEFAULT = 100,
|
||||||
POWER_RUNE_DEFAULT = 8,
|
POWER_RUNE_DEFAULT = 8,
|
||||||
POWER_RUNIC_POWER_DEFAULT = 1000,
|
POWER_RUNIC_POWER_DEFAULT = 1000,
|
||||||
POWER_HOLY_POWER_DEFAULT = 3,
|
POWER_HOLY_POWER_DEFAULT = 3,
|
||||||
POWER_SOUL_SHARDS_DEFAULT = 3,
|
POWER_SOUL_SHARDS_DEFAULT = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SpellProcEventEntry; // used only privately
|
struct SpellProcEventEntry; // used only privately
|
||||||
|
|
@ -1861,6 +1862,10 @@ class Unit : public WorldObject
|
||||||
*/
|
*/
|
||||||
void setFaction(uint32 faction) { SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, faction); }
|
void setFaction(uint32 faction) { SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, faction); }
|
||||||
FactionTemplateEntry const* getFactionTemplateEntry() const;
|
FactionTemplateEntry const* getFactionTemplateEntry() const;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void RestoreOriginalFaction();
|
||||||
/**
|
/**
|
||||||
* Are we hostile towards the given Unit?
|
* Are we hostile towards the given Unit?
|
||||||
* @param unit the unit we want to check against
|
* @param unit the unit we want to check against
|
||||||
|
|
@ -3384,6 +3389,7 @@ class Unit : public WorldObject
|
||||||
SpellAuraProcResult HandleManaShieldAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
SpellAuraProcResult HandleManaShieldAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
||||||
SpellAuraProcResult HandleModResistanceAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
SpellAuraProcResult HandleModResistanceAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
||||||
SpellAuraProcResult HandleRemoveByDamageChanceProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
SpellAuraProcResult HandleRemoveByDamageChanceProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
||||||
|
SpellAuraProcResult HandleInvisibilityAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
||||||
SpellAuraProcResult HandleNULLProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* /*triggeredByAura*/, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/)
|
SpellAuraProcResult HandleNULLProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* /*triggeredByAura*/, SpellEntry const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/)
|
||||||
{
|
{
|
||||||
// no proc handler for this aura type
|
// no proc handler for this aura type
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ VehicleInfo::VehicleInfo(Unit* owner, VehicleEntry const* vehicleEntry, uint32 o
|
||||||
if (IsUsableSeatForCreature(seatEntry->m_flags))
|
if (IsUsableSeatForCreature(seatEntry->m_flags))
|
||||||
m_creatureSeats |= 1 << i;
|
m_creatureSeats |= 1 << i;
|
||||||
|
|
||||||
if (IsUsableSeatForPlayer(seatEntry->m_flags))
|
if (IsUsableSeatForPlayer(seatEntry->m_flags, seatEntry->m_flagsB))
|
||||||
m_playerSeats |= 1 << i;
|
m_playerSeats |= 1 << i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -146,6 +146,32 @@ void VehicleInfo::Initialize()
|
||||||
summoned->CastCustomSpell((Unit*)m_owner, SPELL_RIDE_VEHICLE_HARDCODED, &basepoint0, NULL, NULL, true);
|
summoned->CastCustomSpell((Unit*)m_owner, SPELL_RIDE_VEHICLE_HARDCODED, &basepoint0, NULL, NULL, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Initialize movement limitations
|
||||||
|
uint32 vehicleFlags = GetVehicleEntry()->m_flags;
|
||||||
|
Unit* pVehicle = (Unit*)m_owner;
|
||||||
|
|
||||||
|
if (vehicleFlags & VEHICLE_FLAG_NO_STRAFE)
|
||||||
|
pVehicle->m_movementInfo.AddMovementFlags2(MOVEFLAG2_NO_STRAFE);
|
||||||
|
if (vehicleFlags & VEHICLE_FLAG_NO_JUMPING)
|
||||||
|
pVehicle->m_movementInfo.AddMovementFlags2(MOVEFLAG2_NO_JUMPING);
|
||||||
|
if (vehicleFlags & VEHICLE_FLAG_FULLSPEEDTURNING)
|
||||||
|
pVehicle->m_movementInfo.AddMovementFlags2(MOVEFLAG2_FULLSPEEDTURNING);
|
||||||
|
if (vehicleFlags & VEHICLE_FLAG_ALLOW_PITCHING)
|
||||||
|
pVehicle->m_movementInfo.AddMovementFlags2(MOVEFLAG2_ALLOW_PITCHING);
|
||||||
|
if (vehicleFlags & VEHICLE_FLAG_FULLSPEEDPITCHING)
|
||||||
|
pVehicle->m_movementInfo.AddMovementFlags2(MOVEFLAG2_FULLSPEEDPITCHING);
|
||||||
|
|
||||||
|
if (vehicleFlags & VEHICLE_FLAG_FIXED_POSITION)
|
||||||
|
pVehicle->SetRoot(true);
|
||||||
|
|
||||||
|
// Initialize power type based on DBC values (creatures only)
|
||||||
|
if (pVehicle->GetTypeId() == TYPEID_UNIT)
|
||||||
|
{
|
||||||
|
if (PowerDisplayEntry const* powerEntry = sPowerDisplayStore.LookupEntry(GetVehicleEntry()->m_powerDisplayID))
|
||||||
|
pVehicle->SetPowerType(Powers(powerEntry->power));
|
||||||
|
}
|
||||||
|
|
||||||
m_isInitialized = true;
|
m_isInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -304,6 +330,7 @@ void VehicleInfo::UnBoard(Unit* passenger, bool changeVehicle)
|
||||||
{
|
{
|
||||||
Player* pPlayer = (Player*)passenger;
|
Player* pPlayer = (Player*)passenger;
|
||||||
pPlayer->ResummonPetTemporaryUnSummonedIfAny();
|
pPlayer->ResummonPetTemporaryUnSummonedIfAny();
|
||||||
|
pPlayer->SetFallInformation(0, pPlayer->GetPositionZ());
|
||||||
|
|
||||||
// SMSG_PET_DISMISS_SOUND (?)
|
// SMSG_PET_DISMISS_SOUND (?)
|
||||||
}
|
}
|
||||||
|
|
@ -473,9 +500,13 @@ uint8 VehicleInfo::GetTakenSeatsMask() const
|
||||||
return takenSeatsMask;
|
return takenSeatsMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VehicleInfo:: IsUsableSeatForPlayer(uint32 seatFlags) const
|
bool VehicleInfo::IsUsableSeatForPlayer(uint32 seatFlags, uint32 seatFlagsB) const
|
||||||
{
|
{
|
||||||
return seatFlags & SEAT_FLAG_USABLE;
|
return seatFlags & SEAT_FLAG_CAN_EXIT ||
|
||||||
|
seatFlags & SEAT_FLAG_UNCONTROLLED ||
|
||||||
|
seatFlagsB &
|
||||||
|
(SEAT_FLAG_B_USABLE_FORCED | SEAT_FLAG_B_USABLE_FORCED_2 |
|
||||||
|
SEAT_FLAG_B_USABLE_FORCED_3 | SEAT_FLAG_B_USABLE_FORCED_4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add control and such modifiers to a passenger if required
|
/// Add control and such modifiers to a passenger if required
|
||||||
|
|
@ -483,10 +514,17 @@ void VehicleInfo::ApplySeatMods(Unit* passenger, uint32 seatFlags)
|
||||||
{
|
{
|
||||||
Unit* pVehicle = (Unit*)m_owner; // Vehicles are alawys Unit
|
Unit* pVehicle = (Unit*)m_owner; // Vehicles are alawys Unit
|
||||||
|
|
||||||
|
if (seatFlags & SEAT_FLAG_NOT_SELECTABLE)
|
||||||
|
passenger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||||
|
|
||||||
if (passenger->GetTypeId() == TYPEID_PLAYER)
|
if (passenger->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
Player* pPlayer = (Player*)passenger;
|
Player* pPlayer = (Player*)passenger;
|
||||||
|
|
||||||
|
// group update
|
||||||
|
if (pPlayer->GetGroup())
|
||||||
|
pPlayer->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_VEHICLE_SEAT);
|
||||||
|
|
||||||
if (seatFlags & SEAT_FLAG_CAN_CONTROL)
|
if (seatFlags & SEAT_FLAG_CAN_CONTROL)
|
||||||
{
|
{
|
||||||
pPlayer->GetCamera().SetView(pVehicle);
|
pPlayer->GetCamera().SetView(pVehicle);
|
||||||
|
|
@ -511,10 +549,13 @@ void VehicleInfo::ApplySeatMods(Unit* passenger, uint32 seatFlags)
|
||||||
{
|
{
|
||||||
((Creature*)pVehicle)->SetWalk(true, true);
|
((Creature*)pVehicle)->SetWalk(true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set vehicle faction as per the controller faction
|
||||||
|
((Creature*)pVehicle)->SetFactionTemporary(pPlayer->getFaction(), TEMPFACTION_NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (seatFlags & (SEAT_FLAG_USABLE | SEAT_FLAG_CAN_CAST))
|
if (seatFlags & SEAT_FLAG_CAN_CAST)
|
||||||
{
|
{
|
||||||
CharmInfo* charmInfo = pVehicle->InitCharmInfo(pVehicle);
|
CharmInfo* charmInfo = pVehicle->InitCharmInfo(pVehicle);
|
||||||
charmInfo->InitVehicleCreateSpells();
|
charmInfo->InitVehicleCreateSpells();
|
||||||
|
|
@ -543,35 +584,47 @@ void VehicleInfo::RemoveSeatMods(Unit* passenger, uint32 seatFlags)
|
||||||
{
|
{
|
||||||
Unit* pVehicle = (Unit*)m_owner;
|
Unit* pVehicle = (Unit*)m_owner;
|
||||||
|
|
||||||
|
if (seatFlags & SEAT_FLAG_NOT_SELECTABLE)
|
||||||
|
passenger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||||
|
|
||||||
if (passenger->GetTypeId() == TYPEID_PLAYER)
|
if (passenger->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
Player* pPlayer = (Player*)passenger;
|
Player* pPlayer = (Player*)passenger;
|
||||||
|
|
||||||
|
// group update
|
||||||
|
if (pPlayer->GetGroup())
|
||||||
|
pPlayer->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_VEHICLE_SEAT);
|
||||||
|
|
||||||
if (seatFlags & SEAT_FLAG_CAN_CONTROL)
|
if (seatFlags & SEAT_FLAG_CAN_CONTROL)
|
||||||
{
|
{
|
||||||
pPlayer->SetCharm(NULL);
|
pPlayer->SetCharm(nullptr);
|
||||||
pVehicle->SetCharmerGuid(ObjectGuid());
|
pVehicle->SetCharmerGuid(ObjectGuid());
|
||||||
|
|
||||||
pPlayer->SetClientControl(pVehicle, 0);
|
pPlayer->SetClientControl(pVehicle, 0);
|
||||||
pPlayer->SetMover(NULL);
|
pPlayer->SetMover(nullptr);
|
||||||
|
|
||||||
pVehicle->clearUnitState(UNIT_STAT_CONTROLLED);
|
pVehicle->clearUnitState(UNIT_STAT_CONTROLLED);
|
||||||
pVehicle->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
|
pVehicle->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
|
||||||
|
|
||||||
// must be called after movement control unapplying
|
// must be called after movement control unapplying
|
||||||
pPlayer->GetCamera().ResetView();
|
pPlayer->GetCamera().ResetView();
|
||||||
|
|
||||||
|
// reset vehicle faction
|
||||||
|
if (pVehicle->GetTypeId() == TYPEID_UNIT)
|
||||||
|
((Creature*)pVehicle)->ClearTemporaryFaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (seatFlags & (SEAT_FLAG_USABLE | SEAT_FLAG_CAN_CAST))
|
if (seatFlags & SEAT_FLAG_CAN_CAST)
|
||||||
pPlayer->RemovePetActionBar();
|
pPlayer->RemovePetActionBar();
|
||||||
}
|
}
|
||||||
else if (passenger->GetTypeId() == TYPEID_UNIT)
|
else if (passenger->GetTypeId() == TYPEID_UNIT)
|
||||||
{
|
{
|
||||||
if (seatFlags & SEAT_FLAG_CAN_CONTROL)
|
if (seatFlags & SEAT_FLAG_CAN_CONTROL)
|
||||||
{
|
{
|
||||||
passenger->SetCharm(NULL);
|
passenger->SetCharm(nullptr);
|
||||||
pVehicle->SetCharmerGuid(ObjectGuid());
|
pVehicle->SetCharmerGuid(ObjectGuid());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reinitialize movement
|
// Reinitialize movement
|
||||||
((Creature*)passenger)->AI()->SetCombatMovement(true, true);
|
((Creature*)passenger)->AI()->SetCombatMovement(true, true);
|
||||||
if (!passenger->getVictim())
|
if (!passenger->getVictim())
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,7 @@ class VehicleInfo : public TransportBase
|
||||||
~VehicleInfo();
|
~VehicleInfo();
|
||||||
|
|
||||||
VehicleEntry const* GetVehicleEntry() const { return m_vehicleEntry; }
|
VehicleEntry const* GetVehicleEntry() const { return m_vehicleEntry; }
|
||||||
|
VehicleSeatEntry const* GetSeatEntry(uint8 seat) const;
|
||||||
|
|
||||||
void Board(Unit* passenger, uint8 seat); // Board a passenger to a vehicle
|
void Board(Unit* passenger, uint8 seat); // Board a passenger to a vehicle
|
||||||
void SwitchSeat(Unit* passenger, uint8 seat); // Used to switch seats of a passenger
|
void SwitchSeat(Unit* passenger, uint8 seat); // Used to switch seats of a passenger
|
||||||
|
|
@ -89,7 +90,6 @@ class VehicleInfo : public TransportBase
|
||||||
void CalculateBoardingPositionOf(float gx, float gy, float gz, float go, float& lx, float& ly, float& lz, float& lo) const;
|
void CalculateBoardingPositionOf(float gx, float gy, float gz, float go, float& lx, float& ly, float& lz, float& lo) const;
|
||||||
|
|
||||||
// Seat information
|
// Seat information
|
||||||
VehicleSeatEntry const* GetSeatEntry(uint8 seat) const;
|
|
||||||
bool GetUsableSeatFor(Unit* passenger, uint8& seat) const;
|
bool GetUsableSeatFor(Unit* passenger, uint8& seat) const;
|
||||||
bool IsSeatAvailableFor(Unit* passenger, uint8 seat) const;
|
bool IsSeatAvailableFor(Unit* passenger, uint8 seat) const;
|
||||||
|
|
||||||
|
|
@ -97,8 +97,8 @@ class VehicleInfo : public TransportBase
|
||||||
uint8 GetEmptySeatsMask() const { return ~GetTakenSeatsMask(); }
|
uint8 GetEmptySeatsMask() const { return ~GetTakenSeatsMask(); }
|
||||||
uint8 GetEmptySeats() const { return m_vehicleSeats.size() - m_passengers.size(); }
|
uint8 GetEmptySeats() const { return m_vehicleSeats.size() - m_passengers.size(); }
|
||||||
|
|
||||||
bool IsUsableSeatForPlayer(uint32 seatFlags) const;
|
bool IsUsableSeatForPlayer(uint32 seatFlags, uint32 seatFlagsB) const;
|
||||||
bool IsUsableSeatForCreature(uint32 seatFlags) const { return true; } // special flag?, !IsUsableSeatForPlayer(seatFlags)?
|
bool IsUsableSeatForCreature(uint32 /*seatFlags*/) const { return true; } // special flag?, !IsUsableSeatForPlayer(seatFlags)?
|
||||||
|
|
||||||
// Apply/ Remove Controlling of the vehicle
|
// Apply/ Remove Controlling of the vehicle
|
||||||
void ApplySeatMods(Unit* passenger, uint32 seatFlags);
|
void ApplySeatMods(Unit* passenger, uint32 seatFlags);
|
||||||
|
|
|
||||||
|
|
@ -154,24 +154,24 @@ void OutdoorPvPEP::HandleObjectiveComplete(uint32 eventId, const std::list<Playe
|
||||||
|
|
||||||
switch (eventId)
|
switch (eventId)
|
||||||
{
|
{
|
||||||
case EVENT_CROWNGUARD_PROGRESS_ALLIANCE:
|
case EVENT_CROWNGUARD_PROGRESS_ALLIANCE:
|
||||||
case EVENT_CROWNGUARD_PROGRESS_HORDE:
|
case EVENT_CROWNGUARD_PROGRESS_HORDE:
|
||||||
credit = NPC_CROWNGUARD_TOWER_QUEST_DOODAD;
|
credit = NPC_CROWNGUARD_TOWER_QUEST_DOODAD;
|
||||||
break;
|
break;
|
||||||
case EVENT_EASTWALL_PROGRESS_ALLIANCE:
|
case EVENT_EASTWALL_PROGRESS_ALLIANCE:
|
||||||
case EVENT_EASTWALL_PROGRESS_HORDE:
|
case EVENT_EASTWALL_PROGRESS_HORDE:
|
||||||
credit = NPC_EASTWALL_TOWER_QUEST_DOODAD;
|
credit = NPC_EASTWALL_TOWER_QUEST_DOODAD;
|
||||||
break;
|
break;
|
||||||
case EVENT_NORTHPASS_PROGRESS_ALLIANCE:
|
case EVENT_NORTHPASS_PROGRESS_ALLIANCE:
|
||||||
case EVENT_NORTHPASS_PROGRESS_HORDE:
|
case EVENT_NORTHPASS_PROGRESS_HORDE:
|
||||||
credit = NPC_NORTHPASS_TOWER_QUEST_DOODAD;
|
credit = NPC_NORTHPASS_TOWER_QUEST_DOODAD;
|
||||||
break;
|
break;
|
||||||
case EVENT_PLAGUEWOOD_PROGRESS_ALLIANCE:
|
case EVENT_PLAGUEWOOD_PROGRESS_ALLIANCE:
|
||||||
case EVENT_PLAGUEWOOD_PROGRESS_HORDE:
|
case EVENT_PLAGUEWOOD_PROGRESS_HORDE:
|
||||||
credit = NPC_PLAGUEWOOD_TOWER_QUEST_DOODAD;
|
credit = NPC_PLAGUEWOOD_TOWER_QUEST_DOODAD;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::list<Player*>::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
for (std::list<Player*>::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ void OutdoorPvPHP::HandleObjectiveComplete(uint32 eventId, const std::list<Playe
|
||||||
if ((*itr) && (*itr)->GetTeam() == team)
|
if ((*itr) && (*itr)->GetTeam() == team)
|
||||||
{
|
{
|
||||||
(*itr)->KilledMonsterCredit(credit);
|
(*itr)->KilledMonsterCredit(credit);
|
||||||
(*itr)->RewardHonor(nullptr, 1, HONOR_REWARD_HELLFIRE);
|
(*itr)->RewardHonor(NULL, 1, HONOR_REWARD_HELLFIRE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -537,7 +537,8 @@ void OutdoorPvPNA::RespawnSoldier()
|
||||||
if (Player* player = sObjectMgr.GetPlayer(itr->first))
|
if (Player* player = sObjectMgr.GetPlayer(itr->first))
|
||||||
{
|
{
|
||||||
// summon a soldier replacement in the order they were set in the deque. delete the element after summon
|
// summon a soldier replacement in the order they were set in the deque. delete the element after summon
|
||||||
player->SummonCreature(m_zoneOwner == ALLIANCE ? NPC_ALLIANCE_HANAANI_GUARD : NPC_HORDE_HALAANI_GUARD, m_deadSoldiers.front().x, m_deadSoldiers.front().y, m_deadSoldiers.front().z, m_deadSoldiers.front().o, TEMPSUMMON_DEAD_DESPAWN, 0, true);
|
const HalaaSoldiersSpawns& location = m_deadSoldiers.front();
|
||||||
|
player->SummonCreature(m_zoneOwner == ALLIANCE ? NPC_ALLIANCE_HANAANI_GUARD : NPC_HORDE_HALAANI_GUARD, location.x, location.y, location.z, location.o, TEMPSUMMON_DEAD_DESPAWN, 0, true);
|
||||||
m_deadSoldiers.pop();
|
m_deadSoldiers.pop();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -593,6 +593,7 @@ enum VehicleFlags
|
||||||
VEHICLE_FLAG_UNK12 = 0x00080000,
|
VEHICLE_FLAG_UNK12 = 0x00080000,
|
||||||
VEHICLE_FLAG_UNK13 = 0x00100000,
|
VEHICLE_FLAG_UNK13 = 0x00100000,
|
||||||
VEHICLE_FLAG_UNK14 = 0x00200000,
|
VEHICLE_FLAG_UNK14 = 0x00200000,
|
||||||
|
VEHICLE_FLAG_FIXED_POSITION = 0x00200000, // Used for vehicles that have a fixed position, such as cannons
|
||||||
VEHICLE_FLAG_DISABLE_SWITCH = 0x00400000, // Can't change seats, VEHICLE_ID = 335 chopper
|
VEHICLE_FLAG_DISABLE_SWITCH = 0x00400000, // Can't change seats, VEHICLE_ID = 335 chopper
|
||||||
VEHICLE_FLAG_UNK15 = 0x00800000,
|
VEHICLE_FLAG_UNK15 = 0x00800000,
|
||||||
VEHICLE_FLAG_UNK16 = 0x01000000,
|
VEHICLE_FLAG_UNK16 = 0x01000000,
|
||||||
|
|
@ -620,19 +621,19 @@ enum VehicleSeatFlags
|
||||||
SEAT_FLAG_UNK10 = 0x00000400, // "AllowsTurning"
|
SEAT_FLAG_UNK10 = 0x00000400, // "AllowsTurning"
|
||||||
SEAT_FLAG_CAN_CONTROL = 0x00000800, // Lua_UnitInVehicleControlSeat
|
SEAT_FLAG_CAN_CONTROL = 0x00000800, // Lua_UnitInVehicleControlSeat
|
||||||
SEAT_FLAG_UNK11 = 0x00001000, // "Can Cast Mount Spell"
|
SEAT_FLAG_UNK11 = 0x00001000, // "Can Cast Mount Spell"
|
||||||
SEAT_FLAG_UNK12 = 0x00002000, // "Uncontrolled"
|
SEAT_FLAG_UNCONTROLLED = 0x00002000, // "Uncontrolled"
|
||||||
SEAT_FLAG_CAN_ATTACK = 0x00004000, // Can attack, cast spells and use items from vehicle?
|
SEAT_FLAG_CAN_ATTACK = 0x00004000, // Can attack, cast spells and use items from vehicle?
|
||||||
SEAT_FLAG_UNK13 = 0x00008000, // "ShouldUseVehicleSeatExitAnimationOnForcedExit"
|
SEAT_FLAG_UNK13 = 0x00008000, // "ShouldUseVehicleSeatExitAnimationOnForcedExit"
|
||||||
SEAT_FLAG_UNK14 = 0x00010000,
|
SEAT_FLAG_UNK14 = 0x00010000,
|
||||||
SEAT_FLAG_UNK15 = 0x00020000,
|
SEAT_FLAG_UNK15 = 0x00020000,
|
||||||
SEAT_FLAG_UNK16 = 0x00040000, // "HasVehicleExitAnimForVoluntaryExit"
|
SEAT_FLAG_UNK16 = 0x00040000, // "HasVehicleExitAnimForVoluntaryExit"
|
||||||
SEAT_FLAG_UNK17 = 0x00080000, // "HasVehicleExitAnimForForcedExit"
|
SEAT_FLAG_UNK17 = 0x00080000, // "HasVehicleExitAnimForForcedExit"
|
||||||
SEAT_FLAG_UNK18 = 0x00100000,
|
SEAT_FLAG_NOT_SELECTABLE = 0x00100000,
|
||||||
SEAT_FLAG_UNK19 = 0x00200000,
|
SEAT_FLAG_UNK19 = 0x00200000,
|
||||||
SEAT_FLAG_UNK20 = 0x00400000, // "RecHasVehicleEnterAnim"
|
SEAT_FLAG_UNK20 = 0x00400000, // "RecHasVehicleEnterAnim"
|
||||||
SEAT_FLAG_UNK21 = 0x00800000, // Lua_IsUsingVehicleControls
|
SEAT_FLAG_UNK21 = 0x00800000, // Lua_IsUsingVehicleControls
|
||||||
SEAT_FLAG_UNK22 = 0x01000000, // "EnableVehicleZoom"
|
SEAT_FLAG_UNK22 = 0x01000000, // "EnableVehicleZoom"
|
||||||
SEAT_FLAG_USABLE = 0x02000000, // Lua_CanExitVehicle
|
SEAT_FLAG_CAN_EXIT = 0x02000000, // Lua_CanExitVehicle
|
||||||
SEAT_FLAG_CAN_SWITCH = 0x04000000, // Lua_CanSwitchVehicleSeats
|
SEAT_FLAG_CAN_SWITCH = 0x04000000, // Lua_CanSwitchVehicleSeats
|
||||||
SEAT_FLAG_UNK23 = 0x08000000, // "HasStartWaitingForVehicleTransitionAnimEnter"
|
SEAT_FLAG_UNK23 = 0x08000000, // "HasStartWaitingForVehicleTransitionAnimEnter"
|
||||||
SEAT_FLAG_UNK24 = 0x10000000, // "HasStartWaitingForVehicleTransitionAnimExit"
|
SEAT_FLAG_UNK24 = 0x10000000, // "HasStartWaitingForVehicleTransitionAnimExit"
|
||||||
|
|
@ -641,4 +642,16 @@ enum VehicleSeatFlags
|
||||||
SEAT_FLAG_UNK26 = 0x80000000, // "AllowsInteraction"
|
SEAT_FLAG_UNK26 = 0x80000000, // "AllowsInteraction"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum VehicleSeatFlagsB
|
||||||
|
{
|
||||||
|
SEAT_FLAG_B_USABLE_FORCED = 0x00000002,
|
||||||
|
SEAT_FLAG_B_TARGETS_IN_RAIDUI = 0x00000008, // Lua_UnitTargetsVehicleInRaidUI
|
||||||
|
SEAT_FLAG_B_EJECTABLE = 0x00000020, // Ejectable
|
||||||
|
SEAT_FLAG_B_USABLE_FORCED_2 = 0x00000040,
|
||||||
|
SEAT_FLAG_B_USABLE_FORCED_3 = 0x00000100,
|
||||||
|
SEAT_FLAG_B_USABLE_FORCED_4 = 0x02000000,
|
||||||
|
SEAT_FLAG_B_CAN_SWITCH = 0x04000000,
|
||||||
|
SEAT_FLAG_B_PLAYERFRAME_UI = 0x80000000 // Lua_UnitHasVehiclePlayerFrameUI
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,7 @@ DBCStorage <QuestSortEntry> sQuestSortStore(QuestSortEntryfmt);
|
||||||
DBCStorage <QuestXPLevel> sQuestXPLevelStore(QuestXPLevelfmt);
|
DBCStorage <QuestXPLevel> sQuestXPLevelStore(QuestXPLevelfmt);
|
||||||
|
|
||||||
DBCStorage <PhaseEntry> sPhaseStore(Phasefmt);
|
DBCStorage <PhaseEntry> sPhaseStore(Phasefmt);
|
||||||
|
DBCStorage <PowerDisplayEntry> sPowerDisplayStore(PowerDisplayfmt);
|
||||||
DBCStorage <PvPDifficultyEntry> sPvPDifficultyStore(PvPDifficultyfmt);
|
DBCStorage <PvPDifficultyEntry> sPvPDifficultyStore(PvPDifficultyfmt);
|
||||||
|
|
||||||
DBCStorage <RandomPropertiesPointsEntry> sRandomPropertiesPointsStore(RandomPropertiesPointsfmt);
|
DBCStorage <RandomPropertiesPointsEntry> sRandomPropertiesPointsStore(RandomPropertiesPointsfmt);
|
||||||
|
|
@ -599,6 +600,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sQuestSortStore, dbcPath, "QuestSort.dbc");
|
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sQuestSortStore, dbcPath, "QuestSort.dbc");
|
||||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sQuestXPLevelStore, dbcPath, "QuestXP.dbc");
|
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sQuestXPLevelStore, dbcPath, "QuestXP.dbc");
|
||||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sPhaseStore, dbcPath,"Phase.dbc");
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sPhaseStore, dbcPath,"Phase.dbc");
|
||||||
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sPowerDisplayStore, dbcPath,"PowerDisplay.dbc");
|
||||||
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sPvPDifficultyStore, dbcPath, "PvpDifficulty.dbc");
|
LoadDBC(availableDbcLocales, bar, bad_dbc_files, sPvPDifficultyStore, dbcPath, "PvpDifficulty.dbc");
|
||||||
for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
|
for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
|
||||||
if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
|
if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
|
||||||
|
|
|
||||||
|
|
@ -206,6 +206,7 @@ extern DBCStorage <QuestFactionRewardEntry> sQuestFactionRewardStore;
|
||||||
extern DBCStorage <QuestSortEntry> sQuestSortStore;
|
extern DBCStorage <QuestSortEntry> sQuestSortStore;
|
||||||
extern DBCStorage <QuestXPLevel> sQuestXPLevelStore;
|
extern DBCStorage <QuestXPLevel> sQuestXPLevelStore;
|
||||||
extern DBCStorage <PhaseEntry> sPhaseStore;
|
extern DBCStorage <PhaseEntry> sPhaseStore;
|
||||||
|
extern DBCStorage <PowerDisplayEntry> sPowerDisplayStore;
|
||||||
// extern DBCStorage <PvPDifficultyEntry> sPvPDifficultyStore; -- use GetBattlegroundSlotByLevel for access
|
// extern DBCStorage <PvPDifficultyEntry> sPvPDifficultyStore; -- use GetBattlegroundSlotByLevel for access
|
||||||
extern DBCStorage <RandomPropertiesPointsEntry> sRandomPropertiesPointsStore;
|
extern DBCStorage <RandomPropertiesPointsEntry> sRandomPropertiesPointsStore;
|
||||||
extern DBCStorage <ScalingStatDistributionEntry> sScalingStatDistributionStore;
|
extern DBCStorage <ScalingStatDistributionEntry> sScalingStatDistributionStore;
|
||||||
|
|
|
||||||
|
|
@ -1456,6 +1456,16 @@ struct PhaseEntry
|
||||||
uint32 Flags; // 2 - 0x0, 0x4, 0x8
|
uint32 Flags; // 2 - 0x0, 0x4, 0x8
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct PowerDisplayEntry
|
||||||
|
{
|
||||||
|
uint32 id; // 0 m_ID
|
||||||
|
uint32 power; // 1 m_power
|
||||||
|
// uint32 unk1 // 2
|
||||||
|
// float unk2 // 3
|
||||||
|
// float unk3 // 4
|
||||||
|
// float unk4 // 5
|
||||||
|
};
|
||||||
|
|
||||||
struct PvPDifficultyEntry
|
struct PvPDifficultyEntry
|
||||||
{
|
{
|
||||||
//uint32 id; // 0 m_ID
|
//uint32 id; // 0 m_ID
|
||||||
|
|
@ -1807,32 +1817,31 @@ struct SpellCooldownsEntry
|
||||||
// SpellEffect.dbc
|
// SpellEffect.dbc
|
||||||
struct SpellEffectEntry
|
struct SpellEffectEntry
|
||||||
{
|
{
|
||||||
//uint32 Id; // 0 m_ID
|
//uint32 Id; // 0 m_ID
|
||||||
uint32 Effect; // 73-75 m_effect
|
uint32 Effect; // 1 m_effect
|
||||||
float EffectMultipleValue; // 106-108 m_effectAmplitude
|
float EffectMultipleValue; // 2 m_effectAmplitude
|
||||||
uint32 EffectApplyAuraName; // 100-102 m_effectAura
|
uint32 EffectApplyAuraName; // 3 m_effectAura
|
||||||
uint32 EffectAmplitude; // 103-105 m_effectAuraPeriod
|
uint32 EffectAmplitude; // 4 m_effectAuraPeriod
|
||||||
int32 EffectBasePoints; // 82-84 m_effectBasePoints (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints)
|
int32 EffectBasePoints; // 5 m_effectBasePoints (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints)
|
||||||
//float unk_320_4; // 169-171 3.2.0
|
float EffectBonusMultiplier; // 6 m_effectBonus
|
||||||
float DmgMultiplier; // 156-158 m_effectChainAmplitude
|
float EffectDamageMultiplier; // 7 m_effectChainAmplitude
|
||||||
uint32 EffectChainTarget; // 109-111 m_effectChainTargets
|
uint32 EffectChainTarget; // 8 m_effectChainTargets
|
||||||
int32 EffectDieSides; // 76-78 m_effectDieSides
|
int32 EffectDieSides; // 9 m_effectDieSides
|
||||||
uint32 EffectItemType; // 112-114 m_effectItemType
|
uint32 EffectItemType; // 10 m_effectItemType
|
||||||
uint32 EffectMechanic; // 85-87 m_effectMechanic
|
uint32 EffectMechanic; // 11 m_effectMechanic
|
||||||
int32 EffectMiscValue; // 115-117 m_effectMiscValue
|
int32 EffectMiscValue; // 12 m_effectMiscValue
|
||||||
int32 EffectMiscValueB; // 118-120 m_effectMiscValueB
|
int32 EffectMiscValueB; // 13 m_effectMiscValueB
|
||||||
float EffectPointsPerComboPoint; // 124-126 m_effectPointsPerCombo
|
float EffectPointsPerComboPoint; // 14 m_effectPointsPerCombo
|
||||||
uint32 EffectRadiusIndex; // 94-96 m_effectRadiusIndex - spellradius.dbc
|
uint32 EffectRadiusIndex; // 15 m_effectRadiusIndex - spellradius.dbc
|
||||||
uint32 EffectRadiusMaxIndex; // 97-99 4.0.0
|
uint32 EffectRadiusMaxIndex; // 16 4.0.0
|
||||||
float EffectRealPointsPerLevel; // 79-81 m_effectRealPointsPerLevel
|
float EffectRealPointsPerLevel; // 17 m_effectRealPointsPerLevel
|
||||||
ClassFamilyMask EffectSpellClassMask; // 127-129 m_effectSpellClassMask
|
ClassFamilyMask EffectSpellClassMask; // 18 19 20 m_effectSpellClassMask
|
||||||
uint32 EffectTriggerSpell; // 121-123 m_effectTriggerSpell
|
uint32 EffectTriggerSpell; // 21 m_effectTriggerSpell
|
||||||
uint32 EffectImplicitTargetA; // 88-90 m_implicitTargetA
|
uint32 EffectImplicitTargetA; // 22 m_implicitTargetA
|
||||||
uint32 EffectImplicitTargetB; // 91-93 m_implicitTargetB
|
uint32 EffectImplicitTargetB; // 23 m_implicitTargetB
|
||||||
uint32 EffectSpellId; // new 4.0.0
|
uint32 EffectSpellId; // 24 m_spellId - spell.dbc
|
||||||
uint32 EffectIndex; // new 4.0.0
|
uint32 EffectIndex; // 25 m_spellEffectIdx
|
||||||
//uint32 unk; // 24 - 4.2.0
|
//uint32 unk; // 26 4.2.0 only 0 or 1
|
||||||
|
|
||||||
// helpers
|
// helpers
|
||||||
|
|
||||||
int32 CalculateSimpleValue() const { return EffectBasePoints; }
|
int32 CalculateSimpleValue() const { return EffectBasePoints; }
|
||||||
|
|
@ -2353,7 +2362,7 @@ struct VehicleEntry
|
||||||
uint32 m_uiLocomotionType; // 34
|
uint32 m_uiLocomotionType; // 34
|
||||||
float m_msslTrgtImpactTexRadius; // 35
|
float m_msslTrgtImpactTexRadius; // 35
|
||||||
uint32 m_uiSeatIndicatorType; // 36 m_vehicleUIIndicatorID
|
uint32 m_uiSeatIndicatorType; // 36 m_vehicleUIIndicatorID
|
||||||
uint32 m_powerType; // 37 m_powerDisplayID
|
uint32 m_powerDisplayID; // 37
|
||||||
// 38 new in 3.1
|
// 38 new in 3.1
|
||||||
// 39 new in 3.1
|
// 39 new in 3.1
|
||||||
};
|
};
|
||||||
|
|
@ -2421,9 +2430,6 @@ struct VehicleSeatEntry
|
||||||
//uint32 unk[6]; // 58-63
|
//uint32 unk[6]; // 58-63
|
||||||
//uint32 unk2; // 64 4.0.0
|
//uint32 unk2; // 64 4.0.0
|
||||||
//uint32 unk3; // 65 4.0.1
|
//uint32 unk3; // 65 4.0.1
|
||||||
|
|
||||||
bool IsUsable() const { return m_flags & SEAT_FLAG_USABLE; }
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct WMOAreaTableEntry
|
struct WMOAreaTableEntry
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,8 @@ const char OverrideSpellDatafmt[]="niiiiiiiiiixx";
|
||||||
const char QuestFactionRewardfmt[] = "niiiiiiiiii";
|
const char QuestFactionRewardfmt[] = "niiiiiiiiii";
|
||||||
const char QuestSortEntryfmt[]="nx";
|
const char QuestSortEntryfmt[]="nx";
|
||||||
const char QuestXPLevelfmt[] = "niiiiiiiiii";
|
const char QuestXPLevelfmt[] = "niiiiiiiiii";
|
||||||
const char Phasefmt[]="nii";
|
const char Phasefmt[] = "nii";
|
||||||
|
const char PowerDisplayfmt[] = "nixxxx";
|
||||||
const char PvPDifficultyfmt[] = "diiiii";
|
const char PvPDifficultyfmt[] = "diiiii";
|
||||||
const char RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiiii";
|
const char RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiiii";
|
||||||
const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiixi";
|
const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiixi";
|
||||||
|
|
|
||||||
|
|
@ -326,13 +326,13 @@ enum SpellAttributesEx
|
||||||
SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE = 0x00010000,// 16 unaffected by school immunity
|
SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE = 0x00010000,// 16 unaffected by school immunity
|
||||||
SPELL_ATTR_EX_UNK17 = 0x00020000,// 17 for auras SPELL_AURA_TRACK_CREATURES, SPELL_AURA_TRACK_RESOURCES and SPELL_AURA_TRACK_STEALTHED select non-stacking tracking spells
|
SPELL_ATTR_EX_UNK17 = 0x00020000,// 17 for auras SPELL_AURA_TRACK_CREATURES, SPELL_AURA_TRACK_RESOURCES and SPELL_AURA_TRACK_STEALTHED select non-stacking tracking spells
|
||||||
SPELL_ATTR_EX_UNK18 = 0x00040000,// 18
|
SPELL_ATTR_EX_UNK18 = 0x00040000,// 18
|
||||||
SPELL_ATTR_EX_UNK19 = 0x00080000,// 19
|
SPELL_ATTR_EX_CANT_TARGET_SELF = 0x00080000,// 19 spells with area effect or friendly targets that exclude the caster
|
||||||
SPELL_ATTR_EX_REQ_TARGET_COMBO_POINTS = 0x00100000,// 20 Req combo points on target
|
SPELL_ATTR_EX_REQ_TARGET_COMBO_POINTS = 0x00100000,// 20 Req combo points on target
|
||||||
SPELL_ATTR_EX_UNK21 = 0x00200000,// 21
|
SPELL_ATTR_EX_UNK21 = 0x00200000,// 21
|
||||||
SPELL_ATTR_EX_REQ_COMBO_POINTS = 0x00400000,// 22 Use combo points (in 4.x not required combo point target selected)
|
SPELL_ATTR_EX_REQ_COMBO_POINTS = 0x00400000,// 22 Use combo points
|
||||||
SPELL_ATTR_EX_UNK23 = 0x00800000,// 23
|
SPELL_ATTR_EX_UNK23 = 0x00800000,// 23
|
||||||
SPELL_ATTR_EX_UNK24 = 0x01000000,// 24 Req fishing pole??
|
SPELL_ATTR_EX_UNK24 = 0x01000000,// 24 Req fishing pole??
|
||||||
SPELL_ATTR_EX_UNK25 = 0x02000000,// 25 not set in 2.4.2
|
SPELL_ATTR_EX_UNK25 = 0x02000000,// 25
|
||||||
SPELL_ATTR_EX_UNK26 = 0x04000000,// 26
|
SPELL_ATTR_EX_UNK26 = 0x04000000,// 26
|
||||||
SPELL_ATTR_EX_UNK27 = 0x08000000,// 27
|
SPELL_ATTR_EX_UNK27 = 0x08000000,// 27
|
||||||
SPELL_ATTR_EX_UNK28 = 0x10000000,// 28
|
SPELL_ATTR_EX_UNK28 = 0x10000000,// 28
|
||||||
|
|
@ -896,11 +896,11 @@ enum SpellEffects
|
||||||
SPELL_EFFECT_LEAP_BACK = 138,
|
SPELL_EFFECT_LEAP_BACK = 138,
|
||||||
SPELL_EFFECT_CLEAR_QUEST = 139,
|
SPELL_EFFECT_CLEAR_QUEST = 139,
|
||||||
SPELL_EFFECT_FORCE_CAST = 140,
|
SPELL_EFFECT_FORCE_CAST = 140,
|
||||||
SPELL_EFFECT_141 = 141,
|
SPELL_EFFECT_FORCE_CAST_WITH_VALUE = 141,
|
||||||
SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE = 142,
|
SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE = 142,
|
||||||
SPELL_EFFECT_APPLY_AREA_AURA_OWNER = 143,
|
SPELL_EFFECT_APPLY_AREA_AURA_OWNER = 143,
|
||||||
SPELL_EFFECT_KNOCKBACK_FROM_POSITION = 144,
|
SPELL_EFFECT_KNOCKBACK_FROM_POSITION = 144,
|
||||||
SPELL_EFFECT_145 = 145,
|
SPELL_EFFECT_GRAVITY_PULL = 145,
|
||||||
SPELL_EFFECT_ACTIVATE_RUNE = 146,
|
SPELL_EFFECT_ACTIVATE_RUNE = 146,
|
||||||
SPELL_EFFECT_QUEST_FAIL = 147,
|
SPELL_EFFECT_QUEST_FAIL = 147,
|
||||||
SPELL_EFFECT_148 = 148,
|
SPELL_EFFECT_148 = 148,
|
||||||
|
|
@ -1411,7 +1411,7 @@ enum Targets
|
||||||
TARGET_SELF = 1,
|
TARGET_SELF = 1,
|
||||||
TARGET_RANDOM_ENEMY_CHAIN_IN_AREA = 2, // only one spell has that, but regardless, it's a target type after all
|
TARGET_RANDOM_ENEMY_CHAIN_IN_AREA = 2, // only one spell has that, but regardless, it's a target type after all
|
||||||
TARGET_RANDOM_FRIEND_CHAIN_IN_AREA = 3,
|
TARGET_RANDOM_FRIEND_CHAIN_IN_AREA = 3,
|
||||||
TARGET_4 = 4, // some plague spells that are infectious - maybe targets not-infected friends inrange
|
TARGET_RANDOM_UNIT_CHAIN_IN_AREA = 4, // some plague spells that are infectious - maybe targets not-infected friends inrange
|
||||||
TARGET_PET = 5,
|
TARGET_PET = 5,
|
||||||
TARGET_CHAIN_DAMAGE = 6,
|
TARGET_CHAIN_DAMAGE = 6,
|
||||||
TARGET_AREAEFFECT_INSTANT = 7, // targets around provided destination point
|
TARGET_AREAEFFECT_INSTANT = 7, // targets around provided destination point
|
||||||
|
|
@ -1460,7 +1460,7 @@ enum Targets
|
||||||
TARGET_ALL_RAID_AROUND_CASTER = 56,
|
TARGET_ALL_RAID_AROUND_CASTER = 56,
|
||||||
TARGET_SINGLE_FRIEND_2 = 57,
|
TARGET_SINGLE_FRIEND_2 = 57,
|
||||||
TARGET_58 = 58,
|
TARGET_58 = 58,
|
||||||
TARGET_59 = 59,
|
TARGET_FRIENDLY_FRONTAL_CONE = 59,
|
||||||
TARGET_NARROW_FRONTAL_CONE = 60,
|
TARGET_NARROW_FRONTAL_CONE = 60,
|
||||||
TARGET_AREAEFFECT_PARTY_AND_CLASS = 61,
|
TARGET_AREAEFFECT_PARTY_AND_CLASS = 61,
|
||||||
TARGET_DUELVSPLAYER_COORDINATES = 63,
|
TARGET_DUELVSPLAYER_COORDINATES = 63,
|
||||||
|
|
@ -1503,12 +1503,12 @@ enum Targets
|
||||||
TARGET_VEHICLE_PASSENGER_6 = 102,
|
TARGET_VEHICLE_PASSENGER_6 = 102,
|
||||||
TARGET_VEHICLE_PASSENGER_7 = 103,
|
TARGET_VEHICLE_PASSENGER_7 = 103,
|
||||||
TARGET_IN_FRONT_OF_CASTER_30 = 104,
|
TARGET_IN_FRONT_OF_CASTER_30 = 104,
|
||||||
TARGET_105 = 105, // 1 spell
|
TARGET_105 = 105,
|
||||||
TARGET_106 = 106,
|
TARGET_106 = 106,
|
||||||
TARGET_107 = 107, // possible TARGET_WMO(GO?)_IN_FRONT_OF_CASTER(_30 ?) TODO: Verify the angle!
|
TARGET_107 = 107, // possible TARGET_WMO(GO?)_IN_FRONT_OF_CASTER(_30 ?) TODO: Verify the angle!
|
||||||
TARGET_GO_IN_FRONT_OF_CASTER_90 = 108,
|
TARGET_GO_IN_FRONT_OF_CASTER_90 = 108,
|
||||||
TARGET_109 = 109, // spell 89008
|
TARGET_109 = 109, // spell 89008
|
||||||
TARGET_110 = 110, // front enemy aoe
|
TARGET_NARROW_FRONTAL_CONE_2 = 110,
|
||||||
TARGET_111 = 111, // not used
|
TARGET_111 = 111, // not used
|
||||||
TARGET_112 = 112, // spell 89549
|
TARGET_112 = 112, // spell 89549
|
||||||
TARGET_113 = 113, // not used
|
TARGET_113 = 113, // not used
|
||||||
|
|
@ -1597,8 +1597,10 @@ enum DamageEffectType
|
||||||
DOT = 2,
|
DOT = 2,
|
||||||
HEAL = 3,
|
HEAL = 3,
|
||||||
/// used also in case when damage applied to health but not applied to spell channelInterruptFlags/etc
|
/// used also in case when damage applied to health but not applied to spell channelInterruptFlags/etc
|
||||||
NODAMAGE = 4,
|
NODAMAGE = 4,
|
||||||
SELF_DAMAGE = 5
|
/// used to avoid rogue loosing stealth on falling damage
|
||||||
|
SELF_DAMAGE_ROGUE_FALL = 5,
|
||||||
|
SELF_DAMAGE = 6
|
||||||
};
|
};
|
||||||
|
|
||||||
enum GameobjectTypes
|
enum GameobjectTypes
|
||||||
|
|
|
||||||
|
|
@ -671,6 +671,51 @@ void WorldSession::SendNotification(int32 string_id, ...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WorldSession::SendSetPhaseShift(uint32 phaseMask, uint16 mapId)
|
||||||
|
{
|
||||||
|
ObjectGuid guid = _player->GetObjectGuid();
|
||||||
|
|
||||||
|
uint32 phaseFlags = 0;
|
||||||
|
|
||||||
|
for (uint32 i = 0; i < sPhaseStore.GetNumRows(); i++)
|
||||||
|
{
|
||||||
|
if (PhaseEntry const* phase = sPhaseStore.LookupEntry(i))
|
||||||
|
{
|
||||||
|
if (phase->PhaseShift == phaseMask)
|
||||||
|
{
|
||||||
|
phaseFlags = phase->Flags;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WorldPacket data(SMSG_SET_PHASE_SHIFT, 30);
|
||||||
|
data.WriteGuidMask<2, 3, 1, 6, 4, 5, 0, 7>(guid);
|
||||||
|
data.WriteGuidBytes<7, 4>(guid);
|
||||||
|
|
||||||
|
data << uint32(0); // number of WorldMapArea.dbc entries to control world map shift * 2
|
||||||
|
|
||||||
|
data.WriteGuidBytes<1>(guid);
|
||||||
|
data << uint32(phaseMask ? phaseFlags : 8);
|
||||||
|
data.WriteGuidBytes<2, 6>(guid);
|
||||||
|
|
||||||
|
data << uint32(0); // number of inactive terrain swaps * 2
|
||||||
|
|
||||||
|
data << uint32(phaseMask ? 2 : 0); // WRONG: number of Phase.dbc ids * 2
|
||||||
|
if (phaseMask)
|
||||||
|
data << uint16(phaseMask);
|
||||||
|
|
||||||
|
data.WriteGuidBytes<3, 0>(guid);
|
||||||
|
|
||||||
|
data << uint32(mapId ? 2 : 0); // number of terrains swaps * 2
|
||||||
|
if (mapId)
|
||||||
|
data << uint16(mapId);
|
||||||
|
|
||||||
|
data.WriteGuidBytes<5>(guid);
|
||||||
|
SendPacket(&data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void WorldSession::SendSetPhaseShift(std::set<uint32> const& phaseIds, std::set<uint32> const& terrainswaps)
|
void WorldSession::SendSetPhaseShift(std::set<uint32> const& phaseIds, std::set<uint32> const& terrainswaps)
|
||||||
{
|
{
|
||||||
if (PlayerLoading())
|
if (PlayerLoading())
|
||||||
|
|
@ -707,6 +752,7 @@ void WorldSession::SendSetPhaseShift(std::set<uint32> const& phaseIds, std::set<
|
||||||
data.WriteGuidBytes<5>(guid);
|
data.WriteGuidBytes<5>(guid);
|
||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
const char* WorldSession::GetMangosString(int32 entry) const
|
const char* WorldSession::GetMangosString(int32 entry) const
|
||||||
{
|
{
|
||||||
|
|
@ -807,7 +853,7 @@ void WorldSession::LoadAccountData(QueryResult* result, uint32 mask)
|
||||||
delete result;
|
delete result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::SetAccountData(AccountDataType type, time_t time_, std::string data)
|
void WorldSession::SetAccountData(AccountDataType type, time_t time_, const std::string& data)
|
||||||
{
|
{
|
||||||
if ((1 << type) & GLOBAL_CACHE_MASK)
|
if ((1 << type) & GLOBAL_CACHE_MASK)
|
||||||
{
|
{
|
||||||
|
|
@ -828,7 +874,7 @@ void WorldSession::SetAccountData(AccountDataType type, time_t time_, std::strin
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// _player can be NULL and packet received after logout but m_GUID still store correct guid
|
// _player can be nullptr and packet received after logout but m_GUID still store correct guid
|
||||||
if (!m_GUIDLow)
|
if (!m_GUIDLow)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -277,7 +277,7 @@ class WorldSession
|
||||||
void SendGroupInvite(Player* player, bool alreadyInGroup = false);
|
void SendGroupInvite(Player* player, bool alreadyInGroup = false);
|
||||||
void SendAreaTriggerMessage(const char* Text, ...) ATTR_PRINTF(2, 3);
|
void SendAreaTriggerMessage(const char* Text, ...) ATTR_PRINTF(2, 3);
|
||||||
void SendTransferAborted(uint32 mapid, uint8 reason, uint8 arg = 0);
|
void SendTransferAborted(uint32 mapid, uint8 reason, uint8 arg = 0);
|
||||||
void SendSetPhaseShift(std::set<uint32> const& phaseIds, std::set<uint32> const& terrainswaps);
|
void SendSetPhaseShift(uint32 phaseMask, uint16 mapId = 0);
|
||||||
void SendQueryTimeResponse();
|
void SendQueryTimeResponse();
|
||||||
void SendRedirectClient(std::string& ip, uint16 port);
|
void SendRedirectClient(std::string& ip, uint16 port);
|
||||||
|
|
||||||
|
|
@ -380,7 +380,7 @@ class WorldSession
|
||||||
|
|
||||||
// Account Data
|
// Account Data
|
||||||
AccountData* GetAccountData(AccountDataType type) { return &m_accountData[type]; }
|
AccountData* GetAccountData(AccountDataType type) { return &m_accountData[type]; }
|
||||||
void SetAccountData(AccountDataType type, time_t time_, std::string data);
|
void SetAccountData(AccountDataType type, time_t time_, const std::string& data);
|
||||||
void SendAccountDataTimes(uint32 mask);
|
void SendAccountDataTimes(uint32 mask);
|
||||||
void LoadGlobalAccountData();
|
void LoadGlobalAccountData();
|
||||||
void LoadAccountData(QueryResult* result, uint32 mask);
|
void LoadAccountData(QueryResult* result, uint32 mask);
|
||||||
|
|
@ -778,8 +778,8 @@ class WorldSession
|
||||||
void HandleQuestPushResult(WorldPacket& recvPacket);
|
void HandleQuestPushResult(WorldPacket& recvPacket);
|
||||||
|
|
||||||
bool processChatmessageFurtherAfterSecurityChecks(std::string&, uint32);
|
bool processChatmessageFurtherAfterSecurityChecks(std::string&, uint32);
|
||||||
void SendPlayerNotFoundNotice(std::string name);
|
void SendPlayerNotFoundNotice(const std::string& name);
|
||||||
void SendPlayerAmbiguousNotice(std::string name);
|
void SendPlayerAmbiguousNotice(const std::string& name);
|
||||||
void SendWrongFactionNotice();
|
void SendWrongFactionNotice();
|
||||||
void SendChatRestrictedNotice(ChatRestrictionType restriction);
|
void SendChatRestrictedNotice(ChatRestrictionType restriction);
|
||||||
void HandleMessagechatOpcode(WorldPacket& recvPacket);
|
void HandleMessagechatOpcode(WorldPacket& recvPacket);
|
||||||
|
|
|
||||||
|
|
@ -210,39 +210,39 @@ enum MangosStrings
|
||||||
LANG_RESETALL_SPELLS = 218,
|
LANG_RESETALL_SPELLS = 218,
|
||||||
LANG_RESETALL_TALENTS = 219,
|
LANG_RESETALL_TALENTS = 219,
|
||||||
|
|
||||||
LANG_WAYPOINT_NOTFOUND = 220,
|
LANG_WAYPOINT_NOTFOUND = 220, // Cannot find waypoint id %u for %s (in path %i, loaded from %s)
|
||||||
LANG_WAYPOINT_NOTFOUNDLAST = 221,
|
LANG_WAYPOINT_NOTFOUNDLAST = 221, // Last Waypoint not found for %s
|
||||||
LANG_WAYPOINT_NOTFOUNDSEARCH = 222,
|
LANG_WAYPOINT_NOTFOUNDPATH = 222, // %s has no path or path empty, path-id %i (loaded from %s)
|
||||||
LANG_WAYPOINT_NOTFOUNDDBPROBLEM = 223,
|
LANG_WAYPOINT_NOTFOUNDDBPROBLEM = 223, // Creature (GUID: %u) No waypoints found - This is a MaNGOS db problem (single float).
|
||||||
LANG_WAYPOINT_CREATSELECTED = 224,
|
LANG_WAYPOINT_NOTFOUND_NPC = 224, // Cannot access %s on map, maybe you are too far away from its spawn location
|
||||||
LANG_WAYPOINT_CREATNOTFOUND = 225,
|
LANG_WAYPOINT_CREATNOTFOUND = 225, // Creature (GUID: %u) not found
|
||||||
LANG_WAYPOINT_VP_SELECT = 226,
|
LANG_WAYPOINT_VP_SELECT = 226, // You must select a visual waypoint.
|
||||||
LANG_WAYPOINT_VP_NOTFOUND = 227,
|
LANG_WAYPOINT_VP_NOTFOUND = 227, // No visual waypoints found
|
||||||
LANG_WAYPOINT_VP_NOTCREATED = 228,
|
LANG_WAYPOINT_VP_NOTCREATED = 228, // Could not create visual waypoint with creatureID: %d
|
||||||
LANG_WAYPOINT_VP_ALLREMOVED = 229,
|
LANG_WAYPOINT_VP_ALLREMOVED = 229, // All visual waypoints removed
|
||||||
LANG_WAYPOINT_NOTCREATED = 230,
|
LANG_WAYPOINT_NOTCREATED = 230, // Could not add waypoint %u to %s (pathId %i stored by %s)
|
||||||
LANG_WAYPOINT_NOGUID = 231,
|
LANG_WAYPOINT_NOGUID = 231, // No GUID provided.
|
||||||
LANG_WAYPOINT_NOWAYPOINTGIVEN = 232,
|
LANG_WAYPOINT_NOWAYPOINTGIVEN = 232, // No waypoint number provided.
|
||||||
LANG_WAYPOINT_ARGUMENTREQ = 233,
|
LANG_WAYPOINT_ARGUMENTREQ = 233, // Argument required for \'%s\'.
|
||||||
LANG_WAYPOINT_ADDED = 234,
|
LANG_WAYPOINT_ADDED = 234, // Added Waypoint %u to %s (PathId %i, path stored by %s)
|
||||||
LANG_WAYPOINT_ADDED_NO = 235,
|
LANG_WAYPOINT_ADDED_NO = 235, // UNUSED
|
||||||
LANG_WAYPOINT_CHANGED = 236,
|
LANG_WAYPOINT_CHANGED = 236, // Waypoint changed.
|
||||||
LANG_WAYPOINT_CHANGED_NO = 237,
|
LANG_WAYPOINT_CHANGED_NO = 237, // Waypoint %s modified.
|
||||||
LANG_WAYPOINT_EXPORTED = 238,
|
LANG_WAYPOINT_EXPORTED = 238, // WP export successfull.
|
||||||
LANG_WAYPOINT_NOTHINGTOEXPORT = 239,
|
LANG_WAYPOINT_NOTHINGTOEXPORT = 239, // No waypoints found inside the database.
|
||||||
LANG_WAYPOINT_IMPORTED = 240,
|
LANG_WAYPOINT_IMPORTED = 240, // File imported.
|
||||||
LANG_WAYPOINT_REMOVED = 241,
|
LANG_WAYPOINT_REMOVED = 241, // Waypoint removed.
|
||||||
LANG_WAYPOINT_NOTREMOVED = 242,
|
LANG_WAYPOINT_NOTREMOVED = 242, // UNUSED
|
||||||
LANG_WAYPOINT_TOOFAR1 = 243,
|
LANG_WAYPOINT_TOOFAR1 = 243, // UNUSED
|
||||||
LANG_WAYPOINT_TOOFAR2 = 244,
|
LANG_WAYPOINT_TOOFAR2 = 244, // UNUSED
|
||||||
LANG_WAYPOINT_TOOFAR3 = 245,
|
LANG_WAYPOINT_TOOFAR3 = 245, // UNUSED
|
||||||
LANG_WAYPOINT_INFO_TITLE = 246,
|
LANG_WAYPOINT_INFO_TITLE = 246, // Waypoint %u for %s (from pathId %i, stored by %s)
|
||||||
LANG_WAYPOINT_INFO_WAITTIME = 247,
|
LANG_WAYPOINT_INFO_WAITTIME = 247, // Waittime: %d
|
||||||
LANG_WAYPOINT_INFO_MODEL = 248,
|
LANG_WAYPOINT_INFO_ORI = 248, // Orientation: %f
|
||||||
LANG_WAYPOINT_INFO_EMOTE = 249,
|
LANG_WAYPOINT_INFO_SCRIPTID = 249, // ScriptId: %u
|
||||||
LANG_WAYPOINT_INFO_SPELL = 250,
|
LANG_WAYPOINT_INFO_UNK_SCRIPTID = 250, // ScriptID set to non-existing id %u, add it to DBScriptsEngine and reload the table.
|
||||||
LANG_WAYPOINT_INFO_TEXT = 251,
|
LANG_WAYPOINT_INFO_TEXT = 251, // UNUSED
|
||||||
LANG_WAYPOINT_INFO_AISCRIPT = 252,
|
LANG_WAYPOINT_INFO_AISCRIPT = 252, // AIScriptName: %s
|
||||||
|
|
||||||
LANG_RENAME_PLAYER = 253,
|
LANG_RENAME_PLAYER = 253,
|
||||||
LANG_RENAME_PLAYER_GUID = 254,
|
LANG_RENAME_PLAYER_GUID = 254,
|
||||||
|
|
@ -742,13 +742,12 @@ enum MangosStrings
|
||||||
LANG_DEBUG_ARENA_OFF = 738,
|
LANG_DEBUG_ARENA_OFF = 738,
|
||||||
LANG_DEBUG_BG_ON = 739,
|
LANG_DEBUG_BG_ON = 739,
|
||||||
LANG_DEBUG_BG_OFF = 740,
|
LANG_DEBUG_BG_OFF = 740,
|
||||||
|
// = 741, not used
|
||||||
LANG_DIST_ARENA_POINTS_START = 741,
|
// = 742, not used
|
||||||
LANG_DIST_ARENA_POINTS_ONLINE_START = 742,
|
// = 743, not used
|
||||||
LANG_DIST_ARENA_POINTS_ONLINE_END = 743,
|
// = 744, not used
|
||||||
LANG_DIST_ARENA_POINTS_TEAM_START = 744,
|
// = 745, not used
|
||||||
LANG_DIST_ARENA_POINTS_TEAM_END = 745,
|
// = 746, not used
|
||||||
LANG_DIST_ARENA_POINTS_END = 746,
|
|
||||||
// = 747, not used
|
// = 747, not used
|
||||||
// = 748, not used
|
// = 748, not used
|
||||||
// = 749, not used
|
// = 749, not used
|
||||||
|
|
@ -1026,14 +1025,6 @@ enum MangosStrings
|
||||||
LANG_VENDOR_WRONG_ITEM_TYPE = 1700,
|
LANG_VENDOR_WRONG_ITEM_TYPE = 1700,
|
||||||
LANG_VENDOR_WRONG_CURRENCY_MAXCOUNT = 1701,
|
LANG_VENDOR_WRONG_CURRENCY_MAXCOUNT = 1701,
|
||||||
|
|
||||||
LANG_PHASING_REPORT_STATUS = 1702,
|
|
||||||
LANG_PHASING_NO_DEFINITIONS = 1703,
|
|
||||||
LANG_PHASING_SUCCESS = 1704,
|
|
||||||
LANG_PHASING_FAILED = 1705,
|
|
||||||
LANG_PHASING_LAST_PHASE = 1706,
|
|
||||||
LANG_PHASING_LIST = 1707,
|
|
||||||
LANG_PHASING_PHASEMASK = 1708,
|
|
||||||
|
|
||||||
// FREE IDS 1800-9999
|
// FREE IDS 1800-9999
|
||||||
|
|
||||||
// Use for not-in-official-sources patches
|
// Use for not-in-official-sources patches
|
||||||
|
|
@ -1045,4 +1036,5 @@ enum MangosStrings
|
||||||
// `db_script_string` table index 2000000000-2000999999 (MIN_DB_SCRIPT_STRING_ID-MAX_DB_SCRIPT_STRING_ID)
|
// `db_script_string` table index 2000000000-2000999999 (MIN_DB_SCRIPT_STRING_ID-MAX_DB_SCRIPT_STRING_ID)
|
||||||
// For other tables maybe 2001000000-2147483647 (max index)
|
// For other tables maybe 2001000000-2147483647 (max index)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -557,8 +557,8 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||||
|
|
||||||
if (!changenth(line, 2, chraccount)) // characters.account update
|
if (!changenth(line, 2, chraccount)) // characters.account update
|
||||||
ROLLBACK(DUMP_FILE_BROKEN);
|
ROLLBACK(DUMP_FILE_BROKEN);
|
||||||
|
|
||||||
if (name == "")
|
if (name.empty())
|
||||||
{
|
{
|
||||||
// check if the original name already exists
|
// check if the original name already exists
|
||||||
name = getnth(line, 3); // characters.name
|
name = getnth(line, 3); // characters.name
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ namespace MaNGOS
|
||||||
{
|
{
|
||||||
char const* text = sObjectMgr.GetMangosString(i_textId, loc_idx);
|
char const* text = sObjectMgr.GetMangosString(i_textId, loc_idx);
|
||||||
|
|
||||||
ChatHandler::BuildChatPacket(data, i_msgtype, text, LANG_UNIVERSAL, i_player.GetChatTag(), i_player.GetObjectGuid(), nullptr, i_player.GetObjectGuid(), nullptr, nullptr,
|
ChatHandler::BuildChatPacket(data, i_msgtype, text, LANG_UNIVERSAL, i_player.GetChatTag(), i_player.GetObjectGuid(), NULL, i_player.GetObjectGuid(), NULL, NULL,
|
||||||
i_achievementId);
|
i_achievementId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ ChannelMgr::~ChannelMgr()
|
||||||
channels.clear();
|
channels.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
Channel* ChannelMgr::GetJoinChannel(std::string name, uint32 channel_id)
|
Channel* ChannelMgr::GetJoinChannel(const std::string& name, uint32 channel_id)
|
||||||
{
|
{
|
||||||
std::wstring wname;
|
std::wstring wname;
|
||||||
Utf8toWStr(name, wname);
|
Utf8toWStr(name, wname);
|
||||||
|
|
@ -66,7 +66,7 @@ Channel* ChannelMgr::GetJoinChannel(std::string name, uint32 channel_id)
|
||||||
return channels[wname];
|
return channels[wname];
|
||||||
}
|
}
|
||||||
|
|
||||||
Channel* ChannelMgr::GetChannel(std::string name, Player* p, bool pkt)
|
Channel* ChannelMgr::GetChannel(const std::string& name, Player* p, bool pkt)
|
||||||
{
|
{
|
||||||
std::wstring wname;
|
std::wstring wname;
|
||||||
Utf8toWStr(name, wname);
|
Utf8toWStr(name, wname);
|
||||||
|
|
@ -83,13 +83,13 @@ Channel* ChannelMgr::GetChannel(std::string name, Player* p, bool pkt)
|
||||||
p->GetSession()->SendPacket(&data);
|
p->GetSession()->SendPacket(&data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return i->second;
|
return i->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChannelMgr::LeftChannel(std::string name)
|
void ChannelMgr::LeftChannel(const std::string& name)
|
||||||
{
|
{
|
||||||
std::wstring wname;
|
std::wstring wname;
|
||||||
Utf8toWStr(name, wname);
|
Utf8toWStr(name, wname);
|
||||||
|
|
@ -109,7 +109,7 @@ void ChannelMgr::LeftChannel(std::string name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChannelMgr::MakeNotOnPacket(WorldPacket* data, std::string name)
|
void ChannelMgr::MakeNotOnPacket(WorldPacket* data, const std::string& name)
|
||||||
{
|
{
|
||||||
data->Initialize(SMSG_CHANNEL_NOTIFY, (1 + 10)); // we guess size
|
data->Initialize(SMSG_CHANNEL_NOTIFY, (1 + 10)); // we guess size
|
||||||
(*data) << (uint8)CHAT_NOT_MEMBER_NOTICE << name;
|
(*data) << (uint8)CHAT_NOT_MEMBER_NOTICE << name;
|
||||||
|
|
|
||||||
|
|
@ -38,12 +38,12 @@ class ChannelMgr
|
||||||
ChannelMgr() {}
|
ChannelMgr() {}
|
||||||
~ChannelMgr();
|
~ChannelMgr();
|
||||||
|
|
||||||
Channel* GetJoinChannel(std::string name, uint32 channel_id);
|
Channel* GetJoinChannel(const std::string& name, uint32 channel_id);
|
||||||
Channel* GetChannel(std::string name, Player* p, bool pkt = true);
|
Channel* GetChannel(const std::string& name, Player* p, bool pkt = true);
|
||||||
void LeftChannel(std::string name);
|
void LeftChannel(const std::string& name);
|
||||||
private:
|
private:
|
||||||
ChannelMap channels;
|
ChannelMap channels;
|
||||||
void MakeNotOnPacket(WorldPacket* data, std::string name);
|
void MakeNotOnPacket(WorldPacket* data, const std::string& name);
|
||||||
};
|
};
|
||||||
|
|
||||||
class AllianceChannelMgr : public ChannelMgr {};
|
class AllianceChannelMgr : public ChannelMgr {};
|
||||||
|
|
|
||||||
|
|
@ -1047,7 +1047,7 @@ void WorldSession::HandleChangePlayerNameOpcodeCallBack(QueryResult* result, uin
|
||||||
WorldSession* session = sWorld.FindSession(accountId);
|
WorldSession* session = sWorld.FindSession(accountId);
|
||||||
if (!session)
|
if (!session)
|
||||||
{
|
{
|
||||||
if (result) delete result;
|
delete result;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1077,6 +1077,8 @@ void WorldSession::HandleChangePlayerNameOpcodeCallBack(QueryResult* result, uin
|
||||||
data << guid;
|
data << guid;
|
||||||
data << newname;
|
data << newname;
|
||||||
session->SendPacket(&data);
|
session->SendPacket(&data);
|
||||||
|
|
||||||
|
sWorld.InvalidatePlayerDataToAllClient(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleSetPlayerDeclinedNamesOpcode(WorldPacket& recv_data)
|
void WorldSession::HandleSetPlayerDeclinedNamesOpcode(WorldPacket& recv_data)
|
||||||
|
|
@ -1325,6 +1327,8 @@ void WorldSession::HandleCharCustomizeOpcode(WorldPacket& recv_data)
|
||||||
data << uint8(hairColor);
|
data << uint8(hairColor);
|
||||||
data << uint8(facialHair);
|
data << uint8(facialHair);
|
||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
|
|
||||||
|
sWorld.InvalidatePlayerDataToAllClient(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleEquipmentSetSaveOpcode(WorldPacket& recv_data)
|
void WorldSession::HandleEquipmentSetSaveOpcode(WorldPacket& recv_data)
|
||||||
|
|
|
||||||
|
|
@ -450,7 +450,6 @@ ChatCommand* ChatHandler::getCommandTable()
|
||||||
{ "add", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcAddCommand, "", NULL },
|
{ "add", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcAddCommand, "", NULL },
|
||||||
{ "addcurrency", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcAddVendorCurrencyCommand,"", NULL },
|
{ "addcurrency", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcAddVendorCurrencyCommand,"", NULL },
|
||||||
{ "additem", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcAddVendorItemCommand, "", NULL },
|
{ "additem", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcAddVendorItemCommand, "", NULL },
|
||||||
{ "addmove", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcAddMoveCommand, "", NULL },
|
|
||||||
{ "aiinfo", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcAIInfoCommand, "", NULL },
|
{ "aiinfo", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcAIInfoCommand, "", NULL },
|
||||||
{ "allowmove", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcAllowMovementCommand, "", NULL },
|
{ "allowmove", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcAllowMovementCommand, "", NULL },
|
||||||
{ "changeentry", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcChangeEntryCommand, "", NULL },
|
{ "changeentry", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcChangeEntryCommand, "", NULL },
|
||||||
|
|
@ -536,13 +535,13 @@ ChatCommand* ChatHandler::getCommandTable()
|
||||||
{ "creature_ai_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAIScriptsCommand, "", NULL },
|
{ "creature_ai_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAIScriptsCommand, "", NULL },
|
||||||
{ "creature_ai_summons", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAISummonsCommand, "", NULL },
|
{ "creature_ai_summons", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAISummonsCommand, "", NULL },
|
||||||
{ "creature_ai_texts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAITextsCommand, "", NULL },
|
{ "creature_ai_texts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAITextsCommand, "", NULL },
|
||||||
{ "creature_battleground", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadBattleEventCommand, "", NULL },
|
{ "creature_battleground", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadBattleEventCommand, "", NULL },
|
||||||
{ "creature_template_classlevelstats", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreaturesStatsCommand, "", nullptr },
|
{ "creature_template_classlevelstats", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreaturesStatsCommand, "", NULL },
|
||||||
{ "creature_involvedrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestInvRelationsCommand, "", NULL },
|
{ "creature_involvedrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestInvRelationsCommand, "", NULL },
|
||||||
{ "creature_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesCreatureCommand, "", NULL },
|
{ "creature_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesCreatureCommand, "", NULL },
|
||||||
{ "creature_questrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestRelationsCommand, "", NULL },
|
{ "creature_questrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestRelationsCommand, "", NULL },
|
||||||
{ "db_script_string", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDbScriptStringCommand, "", NULL },
|
{ "db_script_string", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDbScriptStringCommand, "", NULL },
|
||||||
{ "dbscripts_on_creature_death", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDBScriptsOnCreatureDeathCommand,"", NULL },
|
{ "dbscripts_on_creature_death", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDBScriptsOnCreatureDeathCommand, "", NULL },
|
||||||
{ "dbscripts_on_event", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDBScriptsOnEventCommand, "", NULL },
|
{ "dbscripts_on_event", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDBScriptsOnEventCommand, "", NULL },
|
||||||
{ "dbscripts_on_gossip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDBScriptsOnGossipCommand, "", NULL },
|
{ "dbscripts_on_gossip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDBScriptsOnGossipCommand, "", NULL },
|
||||||
{ "dbscripts_on_go_use", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDBScriptsOnGoUseCommand, "", NULL },
|
{ "dbscripts_on_go_use", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDBScriptsOnGoUseCommand, "", NULL },
|
||||||
|
|
@ -583,7 +582,6 @@ ChatCommand* ChatHandler::getCommandTable()
|
||||||
{ "npc_trainer", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcTrainerCommand, "", NULL },
|
{ "npc_trainer", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcTrainerCommand, "", NULL },
|
||||||
{ "npc_vendor", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcVendorCommand, "", NULL },
|
{ "npc_vendor", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcVendorCommand, "", NULL },
|
||||||
{ "page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadPageTextsCommand, "", NULL },
|
{ "page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadPageTextsCommand, "", NULL },
|
||||||
{ "phase_definitions", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadPhaseDefinitionsCommand, "", NULL },
|
|
||||||
{ "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesPickpocketingCommand, "", NULL},
|
{ "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesPickpocketingCommand, "", NULL},
|
||||||
{ "points_of_interest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadPointsOfInterestCommand, "", NULL },
|
{ "points_of_interest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadPointsOfInterestCommand, "", NULL },
|
||||||
{ "prospecting_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesProspectingCommand, "", NULL },
|
{ "prospecting_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesProspectingCommand, "", NULL },
|
||||||
|
|
@ -690,8 +688,8 @@ ChatCommand* ChatHandler::getCommandTable()
|
||||||
{
|
{
|
||||||
{ "corpses", SEC_GAMEMASTER, true, &ChatHandler::HandleServerCorpsesCommand, "", NULL },
|
{ "corpses", SEC_GAMEMASTER, true, &ChatHandler::HandleServerCorpsesCommand, "", NULL },
|
||||||
{ "exit", SEC_CONSOLE, true, &ChatHandler::HandleServerExitCommand, "", NULL },
|
{ "exit", SEC_CONSOLE, true, &ChatHandler::HandleServerExitCommand, "", NULL },
|
||||||
{ "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable },
|
{ "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable },
|
||||||
{ "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable },
|
{ "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable },
|
||||||
{ "info", SEC_PLAYER, true, &ChatHandler::HandleServerInfoCommand, "", NULL },
|
{ "info", SEC_PLAYER, true, &ChatHandler::HandleServerInfoCommand, "", NULL },
|
||||||
{ "log", SEC_CONSOLE, true, NULL, "", serverLogCommandTable },
|
{ "log", SEC_CONSOLE, true, NULL, "", serverLogCommandTable },
|
||||||
{ "motd", SEC_PLAYER, true, &ChatHandler::HandleServerMotdCommand, "", NULL },
|
{ "motd", SEC_PLAYER, true, &ChatHandler::HandleServerMotdCommand, "", NULL },
|
||||||
|
|
@ -2637,9 +2635,7 @@ char* ChatHandler::ExtractLinkArg(char** args, char const* const* linkTypes /*=
|
||||||
if (*tail == ':' && somethingPair) // optional data extraction
|
if (*tail == ':' && somethingPair) // optional data extraction
|
||||||
{
|
{
|
||||||
// :something...|h[name]|h|r
|
// :something...|h[name]|h|r
|
||||||
|
++tail;
|
||||||
if (*tail == ':')
|
|
||||||
++tail;
|
|
||||||
|
|
||||||
// something|h[name]|h|r or something:something2...|h[name]|h|r
|
// something|h[name]|h|r or something:something2...|h[name]|h|r
|
||||||
|
|
||||||
|
|
@ -3626,9 +3622,9 @@ void ChatHandler::LogCommand(char const* fullcmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg msgtype, char const* message, Language language /*= LANG_UNIVERSAL*/, ChatTagFlags chatTag /*= CHAT_TAG_NONE*/,
|
void ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg msgtype, char const* message, Language language /*= LANG_UNIVERSAL*/, ChatTagFlags chatTag /*= CHAT_TAG_NONE*/,
|
||||||
ObjectGuid const& senderGuid /*= ObjectGuid()*/, char const* senderName /*= nullptr*/,
|
ObjectGuid const& senderGuid /*= ObjectGuid()*/, char const* senderName /*= NULL*/,
|
||||||
ObjectGuid const& targetGuid /*= ObjectGuid()*/, char const* targetName /*= nullptr*/,
|
ObjectGuid const& targetGuid /*= ObjectGuid()*/, char const* targetName /*= NULL*/,
|
||||||
char const* channelName /*= nullptr*/, uint32 achievementId /*= 0*/, const char* addonPrefix /*= nullptr*/)
|
char const* channelName /*= NULL*/, uint32 achievementId /*= 0*/, const char* addonPrefix /*= NULL*/)
|
||||||
{
|
{
|
||||||
bool isGM = chatTag & CHAT_TAG_GM;
|
bool isGM = chatTag & CHAT_TAG_GM;
|
||||||
bool isAchievement = false;
|
bool isAchievement = false;
|
||||||
|
|
|
||||||
|
|
@ -368,7 +368,6 @@ class ChatHandler
|
||||||
|
|
||||||
//-----------------------Npc Commands-----------------------
|
//-----------------------Npc Commands-----------------------
|
||||||
bool HandleNpcAddCommand(char* args);
|
bool HandleNpcAddCommand(char* args);
|
||||||
bool HandleNpcAddMoveCommand(char* args);
|
|
||||||
bool HandleNpcAddVendorCurrencyCommand(char* args);
|
bool HandleNpcAddVendorCurrencyCommand(char* args);
|
||||||
bool HandleNpcAddVendorItemCommand(char* args);
|
bool HandleNpcAddVendorItemCommand(char* args);
|
||||||
bool HandleNpcAIInfoCommand(char* args);
|
bool HandleNpcAIInfoCommand(char* args);
|
||||||
|
|
@ -538,6 +537,7 @@ class ChatHandler
|
||||||
bool HandleServerLogLevelCommand(char* args);
|
bool HandleServerLogLevelCommand(char* args);
|
||||||
bool HandleServerMotdCommand(char* args);
|
bool HandleServerMotdCommand(char* args);
|
||||||
bool HandleServerPLimitCommand(char* args);
|
bool HandleServerPLimitCommand(char* args);
|
||||||
|
bool HandleServerResetAllRaidCommand(char* args);
|
||||||
bool HandleServerRestartCommand(char* args);
|
bool HandleServerRestartCommand(char* args);
|
||||||
bool HandleServerSetMotdCommand(char* args);
|
bool HandleServerSetMotdCommand(char* args);
|
||||||
bool HandleServerShutDownCommand(char* args);
|
bool HandleServerShutDownCommand(char* args);
|
||||||
|
|
@ -640,8 +640,6 @@ class ChatHandler
|
||||||
bool HandleMmap(char* args);
|
bool HandleMmap(char* args);
|
||||||
bool HandleMmapTestArea(char* args);
|
bool HandleMmapTestArea(char* args);
|
||||||
|
|
||||||
bool HandleReloadPhaseDefinitionsCommand(char* /*args*/);
|
|
||||||
|
|
||||||
//! Development Commands
|
//! Development Commands
|
||||||
bool HandleSaveAllCommand(char* args);
|
bool HandleSaveAllCommand(char* args);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -774,14 +774,14 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data)
|
||||||
player->GetSession()->SendPacket(&data);
|
player->GetSession()->SendPacket(&data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::SendPlayerNotFoundNotice(std::string name)
|
void WorldSession::SendPlayerNotFoundNotice(const std::string& name)
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, name.size() + 1);
|
WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, name.size() + 1);
|
||||||
data << name;
|
data << name;
|
||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::SendPlayerAmbiguousNotice(std::string name)
|
void WorldSession::SendPlayerAmbiguousNotice(const std::string& name)
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAT_PLAYER_AMBIGUOUS, name.size() + 1);
|
WorldPacket data(SMSG_CHAT_PLAYER_AMBIGUOUS, name.size() + 1);
|
||||||
data << name;
|
data << name;
|
||||||
|
|
|
||||||
|
|
@ -261,6 +261,7 @@ enum EventMask
|
||||||
EVENT_MASK_ON_DIE = FLAG_DESPAWN_ON_DEATH | FLAG_SELFKILL_ON_DEATH | FLAG_RESPAWN_ON_DEATH | FLAG_FOLLOW,
|
EVENT_MASK_ON_DIE = FLAG_DESPAWN_ON_DEATH | FLAG_SELFKILL_ON_DEATH | FLAG_RESPAWN_ON_DEATH | FLAG_FOLLOW,
|
||||||
EVENT_MASK_ON_RESPAWN = FLAG_RESPAWN_ON_RESPAWN | FLAG_DESPAWN_ON_RESPAWN | FLAG_FOLLOW,
|
EVENT_MASK_ON_RESPAWN = FLAG_RESPAWN_ON_RESPAWN | FLAG_DESPAWN_ON_RESPAWN | FLAG_FOLLOW,
|
||||||
EVENT_MASK_TRIGGER_TO = FLAG_TO_AGGRO_ON_AGGRO | FLAG_TO_RESPAWN_ON_EVADE | FLAG_FOLLOW,
|
EVENT_MASK_TRIGGER_TO = FLAG_TO_AGGRO_ON_AGGRO | FLAG_TO_RESPAWN_ON_EVADE | FLAG_FOLLOW,
|
||||||
|
EVENT_MASK_ON_DESPAWN = FLAG_DESPAWN_ON_DESPAWN,
|
||||||
};
|
};
|
||||||
|
|
||||||
// This functions checks if the NPC has linked NPCs for dynamic action
|
// This functions checks if the NPC has linked NPCs for dynamic action
|
||||||
|
|
@ -413,6 +414,7 @@ void CreatureLinkingHolder::DoCreatureLinkingEvent(CreatureLinkingEvent eventTyp
|
||||||
case LINKING_EVENT_EVADE: eventFlagFilter = EVENT_MASK_ON_EVADE; reverseEventFlagFilter = FLAG_TO_RESPAWN_ON_EVADE; break;
|
case LINKING_EVENT_EVADE: eventFlagFilter = EVENT_MASK_ON_EVADE; reverseEventFlagFilter = FLAG_TO_RESPAWN_ON_EVADE; break;
|
||||||
case LINKING_EVENT_DIE: eventFlagFilter = EVENT_MASK_ON_DIE; reverseEventFlagFilter = 0; break;
|
case LINKING_EVENT_DIE: eventFlagFilter = EVENT_MASK_ON_DIE; reverseEventFlagFilter = 0; break;
|
||||||
case LINKING_EVENT_RESPAWN: eventFlagFilter = EVENT_MASK_ON_RESPAWN; reverseEventFlagFilter = FLAG_FOLLOW; break;
|
case LINKING_EVENT_RESPAWN: eventFlagFilter = EVENT_MASK_ON_RESPAWN; reverseEventFlagFilter = FLAG_FOLLOW; break;
|
||||||
|
case LINKING_EVENT_DESPAWN: eventFlagFilter = EVENT_MASK_ON_DESPAWN; reverseEventFlagFilter = 0; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process Slaves (by entry)
|
// Process Slaves (by entry)
|
||||||
|
|
@ -470,6 +472,7 @@ void CreatureLinkingHolder::DoCreatureLinkingEvent(CreatureLinkingEvent eventTyp
|
||||||
SetFollowing(pSource, pMaster);
|
SetFollowing(pSource, pMaster);
|
||||||
break;
|
break;
|
||||||
case LINKING_EVENT_DIE: // Nothing linked for this case
|
case LINKING_EVENT_DIE: // Nothing linked for this case
|
||||||
|
case LINKING_EVENT_DESPAWN: // Nothing linked for this case
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -549,6 +552,11 @@ void CreatureLinkingHolder::ProcessSlave(CreatureLinkingEvent eventType, Creatur
|
||||||
if (flag & FLAG_FOLLOW && pSlave->IsAlive() && !pSlave->IsInCombat())
|
if (flag & FLAG_FOLLOW && pSlave->IsAlive() && !pSlave->IsInCombat())
|
||||||
SetFollowing(pSlave, pSource);
|
SetFollowing(pSlave, pSource);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case LINKING_EVENT_DESPAWN:
|
||||||
|
if (flag & FLAG_DESPAWN_ON_DESPAWN && !pSlave->IsDespawned())
|
||||||
|
pSlave->ForcedDespawn();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ enum CreatureLinkingEvent
|
||||||
LINKING_EVENT_EVADE = 1,
|
LINKING_EVENT_EVADE = 1,
|
||||||
LINKING_EVENT_DIE = 2,
|
LINKING_EVENT_DIE = 2,
|
||||||
LINKING_EVENT_RESPAWN = 3,
|
LINKING_EVENT_RESPAWN = 3,
|
||||||
|
LINKING_EVENT_DESPAWN = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
// enum describing possible flags action flags for NPCs linked to other NPCs
|
// enum describing possible flags action flags for NPCs linked to other NPCs
|
||||||
|
|
@ -77,12 +78,13 @@ enum CreatureLinkingFlags
|
||||||
|
|
||||||
// Dynamic behaviour, out of combat
|
// Dynamic behaviour, out of combat
|
||||||
FLAG_FOLLOW = 0x0200,
|
FLAG_FOLLOW = 0x0200,
|
||||||
|
FLAG_DESPAWN_ON_DESPAWN = 0x2000,
|
||||||
|
|
||||||
// Passive behaviour
|
// Passive behaviour
|
||||||
FLAG_CANT_SPAWN_IF_BOSS_DEAD = 0x0400,
|
FLAG_CANT_SPAWN_IF_BOSS_DEAD = 0x0400,
|
||||||
FLAG_CANT_SPAWN_IF_BOSS_ALIVE = 0x0800,
|
FLAG_CANT_SPAWN_IF_BOSS_ALIVE = 0x0800,
|
||||||
|
|
||||||
LINKING_FLAG_INVALID = 0x2000, // TODO adjust when other flags are implemented
|
LINKING_FLAG_INVALID = 0x4000, // TODO adjust when other flags are implemented
|
||||||
};
|
};
|
||||||
|
|
||||||
// Structure holding the information for an entry
|
// Structure holding the information for an entry
|
||||||
|
|
|
||||||
|
|
@ -555,8 +555,11 @@ namespace MaNGOS
|
||||||
void Visit(CameraMapType& m)
|
void Visit(CameraMapType& m)
|
||||||
{
|
{
|
||||||
for (CameraMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
for (CameraMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||||
if (itr->getSource()->GetBody()->InSamePhase(i_searcher) && itr->getSource()->GetBody()->IsWithinDist(i_searcher, i_dist))
|
{
|
||||||
i_do(itr->getSource()->GetOwner());
|
Camera* camera = itr->getSource();
|
||||||
|
if (camera->GetBody()->InSamePhase(i_searcher) && camera->GetBody()->IsWithinDist(i_searcher, i_dist))
|
||||||
|
i_do(camera->GetOwner());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) {}
|
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) {}
|
||||||
};
|
};
|
||||||
|
|
@ -678,13 +681,14 @@ namespace MaNGOS
|
||||||
WorldObject const& GetFocusObject() const { return *i_unit; }
|
WorldObject const& GetFocusObject() const { return *i_unit; }
|
||||||
bool operator()(GameObject* go) const
|
bool operator()(GameObject* go) const
|
||||||
{
|
{
|
||||||
if (go->GetGOInfo()->type != GAMEOBJECT_TYPE_SPELL_FOCUS)
|
GameObjectInfo const* goInfo = go->GetGOInfo();
|
||||||
|
if (goInfo->type != GAMEOBJECT_TYPE_SPELL_FOCUS)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (go->GetGOInfo()->spellFocus.focusId != i_focusId)
|
if (goInfo->spellFocus.focusId != i_focusId)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
float dist = (float)go->GetGOInfo()->spellFocus.dist;
|
float dist = (float)goInfo->spellFocus.dist;
|
||||||
|
|
||||||
return go->IsWithinDistInMap(i_unit, dist);
|
return go->IsWithinDistInMap(i_unit, dist);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -485,7 +485,7 @@ void Group::Disband(bool hideDestroy)
|
||||||
}
|
}
|
||||||
|
|
||||||
m_leaderGuid.Clear();
|
m_leaderGuid.Clear();
|
||||||
m_leaderName = "";
|
m_leaderName.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "DB2Structure.h"
|
#include "DB2Structure.h"
|
||||||
#include "DB2Stores.h"
|
#include "DB2Stores.h"
|
||||||
|
#include "Vehicle.h"
|
||||||
|
#include "TransportSystem.h"
|
||||||
|
|
||||||
/* differeces from off:
|
/* differeces from off:
|
||||||
-you can uninvite yourself - is is useful
|
-you can uninvite yourself - is is useful
|
||||||
|
|
@ -905,6 +907,14 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke
|
||||||
*data << uint32(0);
|
*data << uint32(0);
|
||||||
*data << uint8(0);
|
*data << uint8(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mask & GROUP_UPDATE_FLAG_VEHICLE_SEAT)
|
||||||
|
{
|
||||||
|
if (player->GetTransportInfo())
|
||||||
|
*data << uint32(((Unit*)player->GetTransportInfo()->GetTransport())->GetVehicleInfo()->GetVehicleEntry()->m_seatID[player->GetTransportInfo()->GetTransportSeat()]);
|
||||||
|
else
|
||||||
|
*data << uint32(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*this procedure handles clients CMSG_REQUEST_PARTY_MEMBER_STATS request*/
|
/*this procedure handles clients CMSG_REQUEST_PARTY_MEMBER_STATS request*/
|
||||||
|
|
@ -1048,6 +1058,9 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recv_data)
|
||||||
data << uint32(0); // GROUP_UPDATE_FLAG_PET_AURAS
|
data << uint32(0); // GROUP_UPDATE_FLAG_PET_AURAS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player->GetTransportInfo()) // GROUP_UPDATE_FLAG_VEHICLE_SEAT
|
||||||
|
data << uint32(((Unit*)player->GetTransportInfo()->GetTransport())->GetVehicleInfo()->GetVehicleEntry()->m_seatID[player->GetTransportInfo()->GetTransportSeat()]);
|
||||||
|
|
||||||
data << uint32(8); // GROUP_UPDATE_FLAG_PHASE
|
data << uint32(8); // GROUP_UPDATE_FLAG_PHASE
|
||||||
data << uint32(0); // GROUP_UPDATE_FLAG_PHASE
|
data << uint32(0); // GROUP_UPDATE_FLAG_PHASE
|
||||||
data << uint8(0); // GROUP_UPDATE_FLAG_PHASE
|
data << uint8(0); // GROUP_UPDATE_FLAG_PHASE
|
||||||
|
|
|
||||||
|
|
@ -59,3 +59,39 @@ bool InstanceData::CheckConditionCriteriaMeet(Player const* /*source*/, uint32 i
|
||||||
instance->GetId(), instance_condition_id, uint32(conditionSourceType));
|
instance->GetId(), instance_condition_id, uint32(conditionSourceType));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InstanceData::SendEncounterFrame(uint32 type, ObjectGuid sourceGuid /*= NULL*/, uint8 param1 /*= 0*/, uint8 param2 /*= 0*/)
|
||||||
|
{
|
||||||
|
// size of this packet is at most 15 (usually less)
|
||||||
|
WorldPacket data(SMSG_INSTANCE_ENCOUNTER, 15);
|
||||||
|
data << uint32(type);
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case ENCOUNTER_FRAME_ENGAGE:
|
||||||
|
case ENCOUNTER_FRAME_DISENGAGE:
|
||||||
|
case ENCOUNTER_FRAME_UPDATE_PRIORITY:
|
||||||
|
MANGOS_ASSERT(sourceGuid);
|
||||||
|
|
||||||
|
data << sourceGuid.WriteAsPacked();
|
||||||
|
data << uint8(param1);
|
||||||
|
break;
|
||||||
|
case ENCOUNTER_FRAME_ADD_TIMER:
|
||||||
|
case ENCOUNTER_FRAME_ENABLE_OBJECTIVE:
|
||||||
|
case ENCOUNTER_FRAME_DISABLE_OBJECTIVE:
|
||||||
|
case ENCOUNTER_FRAME_SET_COMBAT_RES_LIMIT:
|
||||||
|
data << uint8(param1);
|
||||||
|
break;
|
||||||
|
case ENCOUNTER_FRAME_UPDATE_OBJECTIVE:
|
||||||
|
data << uint8(param1);
|
||||||
|
data << uint8(param2);
|
||||||
|
break;
|
||||||
|
case ENCOUNTER_FRAME_UNK7:
|
||||||
|
case ENCOUNTER_FRAME_ADD_COMBAT_RES_LIMIT:
|
||||||
|
case ENCOUNTER_FRAME_RESET_COMBAT_RES_LIMIT:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
instance->SendToPlayers(&data);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "ObjectGuid.h"
|
#include "ObjectGuid.h"
|
||||||
|
#include "WorldPacket.h"
|
||||||
|
|
||||||
class Map;
|
class Map;
|
||||||
class Unit;
|
class Unit;
|
||||||
|
|
@ -55,7 +56,22 @@ enum InstanceConditionIDs // Suggested values
|
||||||
INSTANCE_CONDITION_ID_ULDUAR = 33113,
|
INSTANCE_CONDITION_ID_ULDUAR = 33113,
|
||||||
};
|
};
|
||||||
|
|
||||||
class InstanceData
|
enum EncounterFrameTypes // only raid UI specific
|
||||||
|
{
|
||||||
|
ENCOUNTER_FRAME_SET_COMBAT_RES_LIMIT = 0,
|
||||||
|
ENCOUNTER_FRAME_RESET_COMBAT_RES_LIMIT = 1,
|
||||||
|
ENCOUNTER_FRAME_ENGAGE = 2,
|
||||||
|
ENCOUNTER_FRAME_DISENGAGE = 3,
|
||||||
|
ENCOUNTER_FRAME_UPDATE_PRIORITY = 4,
|
||||||
|
ENCOUNTER_FRAME_ADD_TIMER = 5,
|
||||||
|
ENCOUNTER_FRAME_ENABLE_OBJECTIVE = 6,
|
||||||
|
ENCOUNTER_FRAME_UPDATE_OBJECTIVE = 7,
|
||||||
|
ENCOUNTER_FRAME_DISABLE_OBJECTIVE = 8,
|
||||||
|
ENCOUNTER_FRAME_UNK7 = 9, // Seems to have something to do with sorting the encounter units
|
||||||
|
ENCOUNTER_FRAME_ADD_COMBAT_RES_LIMIT = 10
|
||||||
|
};
|
||||||
|
|
||||||
|
class MANGOS_DLL_SPEC InstanceData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -128,6 +144,9 @@ class InstanceData
|
||||||
// This is used for such things are heroic loot
|
// This is used for such things are heroic loot
|
||||||
// See ObjectMgr.h enum ConditionSource for possible values of conditionSourceType
|
// See ObjectMgr.h enum ConditionSource for possible values of conditionSourceType
|
||||||
virtual bool CheckConditionCriteriaMeet(Player const* source, uint32 instance_condition_id, WorldObject const* conditionSource, uint32 conditionSourceType) const;
|
virtual bool CheckConditionCriteriaMeet(Player const* source, uint32 instance_condition_id, WorldObject const* conditionSource, uint32 conditionSourceType) const;
|
||||||
|
|
||||||
|
// Special UI unit frame - sent mostly for raid bosses
|
||||||
|
void SendEncounterFrame(uint32 type, ObjectGuid sourceGuid = ObjectGuid(), uint8 param1 = 0, uint8 param2 = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -223,35 +223,6 @@ void WorldSession::SendLfgSearchResults(LfgType type, uint32 entry)
|
||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* pre dev21 version
|
|
||||||
* delete this if the one below it proves to be good (chucky)
|
|
||||||
void WorldSession::SendLfgJoinResult(LfgJoinResult result)
|
|
||||||
{
|
|
||||||
WorldPacket data(SMSG_LFG_JOIN_RESULT, 0);
|
|
||||||
data << uint32(result);
|
|
||||||
data << uint32(0); // ERR_LFG_ROLE_CHECK_FAILED_TIMEOUT = 3, ERR_LFG_ROLE_CHECK_FAILED_NOT_VIABLE = (value - 3 == result)
|
|
||||||
|
|
||||||
if (result == ERR_LFG_NO_SLOTS_PARTY)
|
|
||||||
{
|
|
||||||
uint8 count1 = 0;
|
|
||||||
data << uint8(count1); // players count?
|
|
||||||
for (uint32 i = 0; i < count1; ++i)
|
|
||||||
{
|
|
||||||
data << uint64(0); // player guid?
|
|
||||||
uint32 count2 = 0;
|
|
||||||
for (uint32 j = 0; j < count2; ++j)
|
|
||||||
{
|
|
||||||
data << uint32(0); // dungeon id/type
|
|
||||||
data << uint32(0); // lock status?
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SendPacket(&data);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
void WorldSession::SendLfgJoinResult(LfgJoinResult result, LFGState state, partyForbidden const& lockedDungeons)
|
void WorldSession::SendLfgJoinResult(LfgJoinResult result, LFGState state, partyForbidden const& lockedDungeons)
|
||||||
{
|
{
|
||||||
uint32 packetSize = 0;
|
uint32 packetSize = 0;
|
||||||
|
|
|
||||||
|
|
@ -747,7 +747,7 @@ void Map::CreatureRelocation(Creature* creature, float x, float y, float z, floa
|
||||||
MANGOS_ASSERT(CheckGridIntegrity(creature, true));
|
MANGOS_ASSERT(CheckGridIntegrity(creature, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Map::CreatureCellRelocation(Creature* c, Cell new_cell)
|
bool Map::CreatureCellRelocation(Creature* c, const Cell& new_cell)
|
||||||
{
|
{
|
||||||
Cell const& old_cell = c->GetCurrentCell();
|
Cell const& old_cell = c->GetCurrentCell();
|
||||||
if (old_cell.DiffGrid(new_cell))
|
if (old_cell.DiffGrid(new_cell))
|
||||||
|
|
@ -1311,6 +1311,32 @@ void Map::CreateInstanceData(bool load)
|
||||||
}
|
}
|
||||||
} */
|
} */
|
||||||
|
|
||||||
|
void Map::TeleportAllPlayersTo(TeleportLocation loc)
|
||||||
|
{
|
||||||
|
while (HavePlayers())
|
||||||
|
{
|
||||||
|
if (Player* plr = m_mapRefManager.getFirst()->getSource())
|
||||||
|
{
|
||||||
|
// Teleport to specified location and removes the player from this map (if the map exists).
|
||||||
|
// Todo : we can add some specific location if needed (ex: map exit location for dungeon)
|
||||||
|
switch (loc)
|
||||||
|
{
|
||||||
|
case TELEPORT_LOCATION_HOMEBIND:
|
||||||
|
plr->TeleportToHomebind();
|
||||||
|
break;
|
||||||
|
case TELEPORT_LOCATION_BG_ENTRY_POINT:
|
||||||
|
plr->TeleportToBGEntryPoint();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// just in case, remove the player from the list explicitly here as well to prevent a possible infinite loop
|
||||||
|
// note that this remove is not needed if the code works well in other places
|
||||||
|
plr->GetMapRef().unlink();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Map::SetWeather(uint32 zoneId, WeatherType type, float grade, bool permanently)
|
void Map::SetWeather(uint32 zoneId, WeatherType type, float grade, bool permanently)
|
||||||
{
|
{
|
||||||
Weather* wth = m_weatherSystem->FindOrCreateWeather(zoneId);
|
Weather* wth = m_weatherSystem->FindOrCreateWeather(zoneId);
|
||||||
|
|
@ -1565,15 +1591,7 @@ void DungeonMap::PermBindAllPlayers(Player* player)
|
||||||
|
|
||||||
void DungeonMap::UnloadAll(bool pForce)
|
void DungeonMap::UnloadAll(bool pForce)
|
||||||
{
|
{
|
||||||
if (HavePlayers())
|
TeleportAllPlayersTo(TELEPORT_LOCATION_HOMEBIND);
|
||||||
{
|
|
||||||
sLog.outError("DungeonMap::UnloadAll: there are still players in the instance at unload, should not happen!");
|
|
||||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
|
||||||
{
|
|
||||||
Player* plr = itr->getSource();
|
|
||||||
plr->TeleportToHomebind();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_resetAfterUnload == true)
|
if (m_resetAfterUnload == true)
|
||||||
GetPersistanceState()->DeleteRespawnTimes();
|
GetPersistanceState()->DeleteRespawnTimes();
|
||||||
|
|
@ -1669,17 +1687,10 @@ void BattleGroundMap::SetUnload()
|
||||||
|
|
||||||
void BattleGroundMap::UnloadAll(bool pForce)
|
void BattleGroundMap::UnloadAll(bool pForce)
|
||||||
{
|
{
|
||||||
while (HavePlayers())
|
TeleportAllPlayersTo(TELEPORT_LOCATION_BG_ENTRY_POINT);
|
||||||
{
|
|
||||||
if (Player* plr = m_mapRefManager.getFirst()->getSource())
|
Map::UnloadAll(pForce);
|
||||||
{
|
TeleportAllPlayersTo(TELEPORT_LOCATION_BG_ENTRY_POINT);
|
||||||
plr->TeleportTo(plr->GetBattleGroundEntryPoint());
|
|
||||||
// TeleportTo removes the player from this map (if the map exists) -> calls BattleGroundMap::Remove -> invalidates the iterator.
|
|
||||||
// just in case, remove the player from the list explicitly here as well to prevent a possible infinite loop
|
|
||||||
// note that this remove is not needed if the code works well in other places
|
|
||||||
plr->GetMapRef().unlink();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Map::UnloadAll(pForce);
|
Map::UnloadAll(pForce);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -323,7 +323,7 @@ class Map : public GridRefManager<NGridType>
|
||||||
void SendInitTransports(Player* player);
|
void SendInitTransports(Player* player);
|
||||||
void SendRemoveTransports(Player* player);
|
void SendRemoveTransports(Player* player);
|
||||||
|
|
||||||
bool CreatureCellRelocation(Creature* creature, Cell new_cell);
|
bool CreatureCellRelocation(Creature* c, const Cell& new_cell);
|
||||||
|
|
||||||
bool loaded(const GridPair&) const;
|
bool loaded(const GridPair&) const;
|
||||||
void EnsureGridCreated(const GridPair&);
|
void EnsureGridCreated(const GridPair&);
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,10 @@
|
||||||
|
|
||||||
INSTANTIATE_SINGLETON_1(MapPersistentStateManager);
|
INSTANTIATE_SINGLETON_1(MapPersistentStateManager);
|
||||||
|
|
||||||
static uint32 resetEventTypeDelay[MAX_RESET_EVENT_TYPE] = { 0, 3600, 900, 300, 60 };
|
static uint32 resetEventTypeDelay[MAX_RESET_EVENT_TYPE] = { 0, // not used
|
||||||
|
3600, 900, 300, 60, // (seconds) normal and official timer delay to inform player about instance reset
|
||||||
|
60, 30, 10, 5 // (seconds) fast reset by gm command inform timer
|
||||||
|
};
|
||||||
|
|
||||||
//== MapPersistentState functions ==========================
|
//== MapPersistentState functions ==========================
|
||||||
MapPersistentState::MapPersistentState(uint16 MapId, uint32 InstanceId, Difficulty difficulty)
|
MapPersistentState::MapPersistentState(uint16 MapId, uint32 InstanceId, Difficulty difficulty)
|
||||||
|
|
@ -220,6 +223,11 @@ DungeonPersistentState::DungeonPersistentState(uint16 MapId, uint32 InstanceId,
|
||||||
DungeonPersistentState::~DungeonPersistentState()
|
DungeonPersistentState::~DungeonPersistentState()
|
||||||
{
|
{
|
||||||
DEBUG_LOG("Unloading DungeonPersistantState of map %u instance %u", GetMapId(), GetInstanceId());
|
DEBUG_LOG("Unloading DungeonPersistantState of map %u instance %u", GetMapId(), GetInstanceId());
|
||||||
|
UnbindThisState();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DungeonPersistentState::UnbindThisState()
|
||||||
|
{
|
||||||
while (!m_playerList.empty())
|
while (!m_playerList.empty())
|
||||||
{
|
{
|
||||||
Player* player = *(m_playerList.begin());
|
Player* player = *(m_playerList.begin());
|
||||||
|
|
@ -537,7 +545,7 @@ void DungeonResetScheduler::ScheduleReset(bool add, time_t time, DungeonResetEve
|
||||||
|
|
||||||
void DungeonResetScheduler::Update()
|
void DungeonResetScheduler::Update()
|
||||||
{
|
{
|
||||||
time_t now = time(NULL), t;
|
time_t now = time(nullptr), t;
|
||||||
while (!m_resetTimeQueue.empty() && (t = m_resetTimeQueue.begin()->first) < now)
|
while (!m_resetTimeQueue.empty() && (t = m_resetTimeQueue.begin()->first) < now)
|
||||||
{
|
{
|
||||||
DungeonResetEvent& event = m_resetTimeQueue.begin()->second;
|
DungeonResetEvent& event = m_resetTimeQueue.begin()->second;
|
||||||
|
|
@ -550,8 +558,10 @@ void DungeonResetScheduler::Update()
|
||||||
{
|
{
|
||||||
// global reset/warning for a certain map
|
// global reset/warning for a certain map
|
||||||
time_t resetTime = GetResetTimeFor(event.mapid, event.difficulty);
|
time_t resetTime = GetResetTimeFor(event.mapid, event.difficulty);
|
||||||
m_InstanceSaves._ResetOrWarnAll(event.mapid, event.difficulty, event.type != RESET_EVENT_INFORM_LAST, uint32(resetTime - now));
|
uint32 timeLeft = uint32(std::max(int32(resetTime - now), 0));
|
||||||
if (event.type != RESET_EVENT_INFORM_LAST)
|
bool warn = event.type != RESET_EVENT_INFORM_LAST && event.type != RESET_EVENT_FORCED_INFORM_LAST;
|
||||||
|
m_InstanceSaves._ResetOrWarnAll(event.mapid, event.difficulty, warn, timeLeft);
|
||||||
|
if (event.type != RESET_EVENT_INFORM_LAST && event.type != RESET_EVENT_FORCED_INFORM_LAST)
|
||||||
{
|
{
|
||||||
// schedule the next warning/reset
|
// schedule the next warning/reset
|
||||||
event.type = ResetEventType(event.type + 1);
|
event.type = ResetEventType(event.type + 1);
|
||||||
|
|
@ -584,6 +594,32 @@ void DungeonResetScheduler::Update()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DungeonResetScheduler::ResetAllRaid()
|
||||||
|
{
|
||||||
|
time_t now = time(nullptr);
|
||||||
|
ResetTimeQueue rTQ;
|
||||||
|
rTQ.clear();
|
||||||
|
|
||||||
|
time_t timeleft = resetEventTypeDelay[RESET_EVENT_FORCED_INFORM_1];
|
||||||
|
|
||||||
|
for (ResetTimeQueue::iterator itr = m_resetTimeQueue.begin(); itr != m_resetTimeQueue.end(); ++itr)
|
||||||
|
{
|
||||||
|
DungeonResetEvent& event = itr->second;
|
||||||
|
|
||||||
|
// we only reset raid dungeon
|
||||||
|
if (event.type == RESET_EVENT_NORMAL_DUNGEON)
|
||||||
|
{
|
||||||
|
rTQ.insert(std::pair<time_t, DungeonResetEvent>(itr->first, event));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
event.type = RESET_EVENT_FORCED_INFORM_1;
|
||||||
|
time_t next_reset = now + timeleft;
|
||||||
|
SetResetTimeFor(event.mapid, event.difficulty, next_reset);
|
||||||
|
rTQ.insert(std::pair<time_t, DungeonResetEvent>(now, event));
|
||||||
|
}
|
||||||
|
m_resetTimeQueue = rTQ;
|
||||||
|
}
|
||||||
|
|
||||||
//== MapPersistentStateManager functions =========================
|
//== MapPersistentStateManager functions =========================
|
||||||
|
|
||||||
MapPersistentStateManager::MapPersistentStateManager() : lock_instLists(false), m_Scheduler(*this)
|
MapPersistentStateManager::MapPersistentStateManager() : lock_instLists(false), m_Scheduler(*this)
|
||||||
|
|
@ -855,14 +891,37 @@ void MapPersistentStateManager::_ResetInstance(uint32 mapid, uint32 instanceId)
|
||||||
DeleteInstanceFromDB(instanceId); // even if state not loaded
|
DeleteInstanceFromDB(instanceId); // even if state not loaded
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct MapPersistantStateResetWorker
|
||||||
|
{
|
||||||
|
MapPersistantStateResetWorker() {};
|
||||||
|
void operator()(Map* map)
|
||||||
|
{
|
||||||
|
((DungeonMap*)map)->TeleportAllPlayersTo(TELEPORT_LOCATION_HOMEBIND);
|
||||||
|
((DungeonMap*)map)->Reset(INSTANCE_RESET_GLOBAL);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct MapPersistantStateWarnWorker
|
||||||
|
{
|
||||||
|
MapPersistantStateWarnWorker(time_t _timeLeft) : timeLeft(_timeLeft)
|
||||||
|
{};
|
||||||
|
|
||||||
|
void operator()(Map* map)
|
||||||
|
{
|
||||||
|
((DungeonMap*)map)->SendResetWarnings(timeLeft);
|
||||||
|
}
|
||||||
|
|
||||||
|
time_t timeLeft;
|
||||||
|
};
|
||||||
|
|
||||||
void MapPersistentStateManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool warn, uint32 timeLeft)
|
void MapPersistentStateManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool warn, uint32 timeLeft)
|
||||||
{
|
{
|
||||||
// global reset for all instances of the given map
|
// global reset for all instances of the given map
|
||||||
MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
|
MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
|
||||||
if (!mapEntry->Instanceable())
|
if (!mapEntry->IsDungeon())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
time_t now = time(NULL);
|
time_t now = time(nullptr);
|
||||||
|
|
||||||
if (!warn)
|
if (!warn)
|
||||||
{
|
{
|
||||||
|
|
@ -873,14 +932,21 @@ void MapPersistentStateManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficu
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove all binds to instances of the given map
|
// remove all binds for online player
|
||||||
for (PersistentStateMap::iterator itr = m_instanceSaveByInstanceId.begin(); itr != m_instanceSaveByInstanceId.end();)
|
std::list<DungeonPersistentState *> unbindList;
|
||||||
{
|
|
||||||
|
// note that we must build a list of states to unbind and then unbind them in two steps. this is because the unbinding may
|
||||||
|
// trigger the modification of the collection, which would invalidate the iterator and cause a crash.
|
||||||
|
for (PersistentStateMap::iterator itr = m_instanceSaveByInstanceId.begin(); itr != m_instanceSaveByInstanceId.end(); ++itr)
|
||||||
if (itr->second->GetMapId() == mapid && itr->second->GetDifficulty() == difficulty)
|
if (itr->second->GetMapId() == mapid && itr->second->GetDifficulty() == difficulty)
|
||||||
_ResetSave(m_instanceSaveByInstanceId, itr);
|
unbindList.push_back((DungeonPersistentState *)itr->second);
|
||||||
else
|
|
||||||
++itr;
|
for (auto i : unbindList)
|
||||||
}
|
i->UnbindThisState();
|
||||||
|
|
||||||
|
// reset maps, teleport player automaticaly to their homebinds and unload maps
|
||||||
|
MapPersistantStateResetWorker worker;
|
||||||
|
sMapMgr.DoForAllMapsWithMapId(mapid, worker);
|
||||||
|
|
||||||
// delete them from the DB, even if not loaded
|
// delete them from the DB, even if not loaded
|
||||||
CharacterDatabase.BeginTransaction();
|
CharacterDatabase.BeginTransaction();
|
||||||
|
|
@ -893,23 +959,12 @@ void MapPersistentStateManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficu
|
||||||
time_t next_reset = DungeonResetScheduler::CalculateNextResetTime(mapDiff, now + timeLeft);
|
time_t next_reset = DungeonResetScheduler::CalculateNextResetTime(mapDiff, now + timeLeft);
|
||||||
// update it in the DB
|
// update it in the DB
|
||||||
CharacterDatabase.PExecute("UPDATE instance_reset SET resettime = '" UI64FMTD "' WHERE mapid = '%u' AND difficulty = '%u'", (uint64)next_reset, mapid, difficulty);
|
CharacterDatabase.PExecute("UPDATE instance_reset SET resettime = '" UI64FMTD "' WHERE mapid = '%u' AND difficulty = '%u'", (uint64)next_reset, mapid, difficulty);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// note: this isn't fast but it's meant to be executed very rarely
|
// note: this isn't fast but it's meant to be executed very rarely
|
||||||
const MapManager::MapMapType& maps = sMapMgr.Maps();
|
MapPersistantStateWarnWorker worker(timeLeft);
|
||||||
|
sMapMgr.DoForAllMapsWithMapId(mapid, worker);
|
||||||
MapManager::MapMapType::const_iterator iter_last = maps.lower_bound(MapID(mapid + 1));
|
|
||||||
for (MapManager::MapMapType::const_iterator mitr = maps.lower_bound(MapID(mapid)); mitr != iter_last; ++mitr)
|
|
||||||
{
|
|
||||||
Map* map2 = mitr->second;
|
|
||||||
if (map2->GetId() != mapid)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (warn)
|
|
||||||
((DungeonMap*)map2)->SendResetWarnings(timeLeft);
|
|
||||||
else
|
|
||||||
((DungeonMap*)map2)->Reset(INSTANCE_RESET_GLOBAL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapPersistentStateManager::GetStatistics(uint32& numStates, uint32& numBoundPlayers, uint32& numBoundGroups)
|
void MapPersistentStateManager::GetStatistics(uint32& numStates, uint32& numBoundPlayers, uint32& numBoundGroups)
|
||||||
|
|
|
||||||
|
|
@ -229,6 +229,8 @@ class DungeonPersistentState : public MapPersistentState
|
||||||
void DeleteFromDB();
|
void DeleteFromDB();
|
||||||
/* Delete respawn data at dungeon reset */
|
/* Delete respawn data at dungeon reset */
|
||||||
void DeleteRespawnTimes();
|
void DeleteRespawnTimes();
|
||||||
|
/* Remove players bind to this state */
|
||||||
|
void UnbindThisState();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool CanBeUnload() const override; // overwrite MapPersistentState::CanBeUnload
|
bool CanBeUnload() const override; // overwrite MapPersistentState::CanBeUnload
|
||||||
|
|
@ -273,14 +275,18 @@ class BattleGroundPersistentState : public MapPersistentState
|
||||||
|
|
||||||
enum ResetEventType
|
enum ResetEventType
|
||||||
{
|
{
|
||||||
RESET_EVENT_NORMAL_DUNGEON = 0, // no fixed reset time
|
RESET_EVENT_NORMAL_DUNGEON = 0, // no fixed reset time
|
||||||
RESET_EVENT_INFORM_1 = 1, // raid/heroic warnings
|
RESET_EVENT_INFORM_1 = 1, // raid/heroic warnings
|
||||||
RESET_EVENT_INFORM_2 = 2,
|
RESET_EVENT_INFORM_2 = 2,
|
||||||
RESET_EVENT_INFORM_3 = 3,
|
RESET_EVENT_INFORM_3 = 3,
|
||||||
RESET_EVENT_INFORM_LAST = 4,
|
RESET_EVENT_INFORM_LAST = 4,
|
||||||
|
RESET_EVENT_FORCED_INFORM_1 = 5,
|
||||||
|
RESET_EVENT_FORCED_INFORM_2 = 6,
|
||||||
|
RESET_EVENT_FORCED_INFORM_3 = 7,
|
||||||
|
RESET_EVENT_FORCED_INFORM_LAST = 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MAX_RESET_EVENT_TYPE 5
|
#define MAX_RESET_EVENT_TYPE 9
|
||||||
|
|
||||||
/* resetTime is a global propery of each (raid/heroic) map
|
/* resetTime is a global propery of each (raid/heroic) map
|
||||||
all instances of that map reset at the same time */
|
all instances of that map reset at the same time */
|
||||||
|
|
@ -323,6 +329,7 @@ class DungeonResetScheduler
|
||||||
|
|
||||||
void Update();
|
void Update();
|
||||||
|
|
||||||
|
void ResetAllRaid();
|
||||||
private: // fields
|
private: // fields
|
||||||
MapPersistentStateManager& m_InstanceSaves;
|
MapPersistentStateManager& m_InstanceSaves;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,8 @@
|
||||||
|
|
||||||
INSTANTIATE_SINGLETON_1(MassMailMgr);
|
INSTANTIATE_SINGLETON_1(MassMailMgr);
|
||||||
|
|
||||||
void MassMailMgr::AddMassMailTask(MailDraft* mailProto, MailSender sender, uint32 raceMask)
|
|
||||||
|
void MassMailMgr::AddMassMailTask(MailDraft* mailProto, const MailSender& sender, uint32 raceMask)
|
||||||
{
|
{
|
||||||
if (RACEMASK_ALL_PLAYABLE & ~raceMask) // have races not included in mask
|
if (RACEMASK_ALL_PLAYABLE & ~raceMask) // have races not included in mask
|
||||||
{
|
{
|
||||||
|
|
@ -72,9 +73,9 @@ struct MassMailerQueryHandler
|
||||||
}
|
}
|
||||||
} massMailerQueryHandler;
|
} massMailerQueryHandler;
|
||||||
|
|
||||||
void MassMailMgr::AddMassMailTask(MailDraft* mailProto, MailSender sender, char const* query)
|
void MassMailMgr::AddMassMailTask(MailDraft* mailProto, const MailSender& sender, char const* query)
|
||||||
{
|
{
|
||||||
CharacterDatabase.AsyncPQuery(&massMailerQueryHandler, &MassMailerQueryHandler::HandleQueryCallback, mailProto, sender, query);
|
CharacterDatabase.AsyncPQuery(&massMailerQueryHandler, &MassMailerQueryHandler::HandleQueryCallback, mailProto, sender, "%s", query);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MassMailMgr::Update(bool sendall /*= false*/)
|
void MassMailMgr::Update(bool sendall /*= false*/)
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class MassMailMgr
|
||||||
*
|
*
|
||||||
* Note: this function safe to be called from Map::Update content/etc, real data add will executed in next tick after query results ready
|
* Note: this function safe to be called from Map::Update content/etc, real data add will executed in next tick after query results ready
|
||||||
*/
|
*/
|
||||||
void AddMassMailTask(MailDraft* mailProto, MailSender sender, uint32 raceMask);
|
void AddMassMailTask(MailDraft* mailProto, const MailSender& sender, uint32 raceMask);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* And new mass mail task with SQL query text for fill receivers list.
|
* And new mass mail task with SQL query text for fill receivers list.
|
||||||
|
|
@ -80,7 +80,7 @@ class MassMailMgr
|
||||||
*
|
*
|
||||||
* Note: this function safe to be called from Map::Update content/etc, real data add will executed in next tick after query results ready
|
* Note: this function safe to be called from Map::Update content/etc, real data add will executed in next tick after query results ready
|
||||||
*/
|
*/
|
||||||
void AddMassMailTask(MailDraft* mailProto, MailSender sender, char const* queryStr);
|
void AddMassMailTask(MailDraft* mailProto, const MailSender& sender, char const* queryStr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* And new mass mail task and let fill receivers list returned as result.
|
* And new mass mail task and let fill receivers list returned as result.
|
||||||
|
|
@ -90,7 +90,7 @@ class MassMailMgr
|
||||||
*
|
*
|
||||||
* Note: this function NOT SAFE for call from Map::Update content/etc
|
* Note: this function NOT SAFE for call from Map::Update content/etc
|
||||||
*/
|
*/
|
||||||
ReceiversList& AddMassMailTask(MailDraft* mailProto, MailSender sender)
|
ReceiversList& AddMassMailTask(MailDraft* mailProto, const MailSender& sender)
|
||||||
{
|
{
|
||||||
m_massMails.push_back(MassMail(mailProto, sender));
|
m_massMails.push_back(MassMail(mailProto, sender));
|
||||||
return m_massMails.rbegin()->m_receivers;
|
return m_massMails.rbegin()->m_receivers;
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,9 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data)
|
||||||
if (GetPlayer()->IsAlive() || GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
if (GetPlayer()->IsAlive() || GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (GetPlayer()->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
|
||||||
|
return;
|
||||||
|
|
||||||
// the world update order is sessions, players, creatures
|
// the world update order is sessions, players, creatures
|
||||||
// the netcode runs in parallel with all of these
|
// the netcode runs in parallel with all of these
|
||||||
// creatures can kill players
|
// creatures can kill players
|
||||||
|
|
|
||||||
|
|
@ -1,383 +0,0 @@
|
||||||
/*
|
|
||||||
* This file is part of the MaNGOS Project. See AUTHORS file for Copyright information
|
|
||||||
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*
|
|
||||||
* World of Warcraft, and all World of Warcraft or Warcraft art, images,
|
|
||||||
* and lore are copyrighted by Blizzard Entertainment, Inc.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "PhaseMgr.h"
|
|
||||||
#include "Chat.h"
|
|
||||||
#include "Language.h"
|
|
||||||
#include "ObjectMgr.h"
|
|
||||||
#include "Player.h"
|
|
||||||
#include "SpellAuras.h"
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////
|
|
||||||
// Updating
|
|
||||||
|
|
||||||
PhaseMgr::PhaseMgr(Player* _player) : player(_player), _UpdateFlags(0)
|
|
||||||
{
|
|
||||||
phaseData = new PhaseData(_player);
|
|
||||||
_PhaseDefinitionStore = sObjectMgr.GetPhaseDefinitionStore();
|
|
||||||
_SpellPhaseStore = sObjectMgr.GetSpellPhaseStore();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PhaseMgr::Update()
|
|
||||||
{
|
|
||||||
if (IsUpdateInProgress())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (_UpdateFlags & PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED)
|
|
||||||
phaseData->SendPhaseshiftToPlayer();
|
|
||||||
|
|
||||||
if (_UpdateFlags & PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED)
|
|
||||||
phaseData->SendPhaseMaskToPlayer();
|
|
||||||
|
|
||||||
_UpdateFlags = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PhaseMgr::RemoveUpdateFlag(PhaseUpdateFlag updateFlag)
|
|
||||||
{
|
|
||||||
_UpdateFlags &= ~updateFlag;
|
|
||||||
|
|
||||||
if (updateFlag == PHASE_UPDATE_FLAG_ZONE_UPDATE)
|
|
||||||
{
|
|
||||||
// Update zone changes
|
|
||||||
if (phaseData->HasActiveDefinitions())
|
|
||||||
{
|
|
||||||
phaseData->ResetDefinitions();
|
|
||||||
_UpdateFlags |= (PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED | PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_PhaseDefinitionStore->find(player->GetZoneId()) != _PhaseDefinitionStore->end())
|
|
||||||
Recalculate();
|
|
||||||
}
|
|
||||||
|
|
||||||
Update();
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
|
||||||
// Notifier
|
|
||||||
|
|
||||||
void PhaseMgr::NotifyConditionChanged(PhaseUpdateData const& updateData)
|
|
||||||
{
|
|
||||||
if (NeedsPhaseUpdateWithData(updateData))
|
|
||||||
{
|
|
||||||
Recalculate();
|
|
||||||
Update();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////
|
|
||||||
// Phasing Definitions
|
|
||||||
|
|
||||||
void PhaseMgr::Recalculate()
|
|
||||||
{
|
|
||||||
if (phaseData->HasActiveDefinitions())
|
|
||||||
{
|
|
||||||
phaseData->ResetDefinitions();
|
|
||||||
_UpdateFlags |= (PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED | PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED);
|
|
||||||
}
|
|
||||||
|
|
||||||
PhaseDefinitionStore::const_iterator itr = _PhaseDefinitionStore->find(player->GetZoneId());
|
|
||||||
if (itr != _PhaseDefinitionStore->end())
|
|
||||||
for (PhaseDefinitionContainer::const_iterator phase = itr->second.begin(); phase != itr->second.end(); ++phase)
|
|
||||||
if (CheckDefinition(*phase))
|
|
||||||
{
|
|
||||||
phaseData->AddPhaseDefinition(*phase);
|
|
||||||
|
|
||||||
if ((*phase)->phasemask)
|
|
||||||
_UpdateFlags |= PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED;
|
|
||||||
|
|
||||||
if ((*phase)->phaseId || (*phase)->terrainswapmap)
|
|
||||||
_UpdateFlags |= PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED;
|
|
||||||
|
|
||||||
if ((*phase)->IsLastDefinition())
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool PhaseMgr::CheckDefinition(PhaseDefinition const* phaseDefinition)
|
|
||||||
{
|
|
||||||
return !phaseDefinition->conditionId || sObjectMgr.IsPlayerMeetToCondition(phaseDefinition->conditionId, player, player->GetMap(), player, CONDITION_FROM_PHASEMGR);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool PhaseMgr::NeedsPhaseUpdateWithData(PhaseUpdateData const updateData)
|
|
||||||
{
|
|
||||||
PhaseDefinitionStore::const_iterator itr = _PhaseDefinitionStore->find(player->GetZoneId());
|
|
||||||
if (itr != _PhaseDefinitionStore->end())
|
|
||||||
{
|
|
||||||
for (PhaseDefinitionContainer::const_iterator phase = itr->second.begin(); phase != itr->second.end(); ++phase)
|
|
||||||
{
|
|
||||||
std::vector<PlayerCondition const*> conditions;
|
|
||||||
sObjectMgr.GetConditions((*phase)->conditionId, conditions);
|
|
||||||
|
|
||||||
for (std::vector<PlayerCondition const*>::const_iterator itr = conditions.begin(); itr != conditions.end(); ++itr)
|
|
||||||
if (updateData.IsConditionRelated(*itr))
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////
|
|
||||||
// Auras
|
|
||||||
|
|
||||||
void PhaseMgr::RegisterPhasingAuraEffect(Aura const* auraEffect)
|
|
||||||
{
|
|
||||||
PhaseInfo* phaseInfo = new PhaseInfo();
|
|
||||||
|
|
||||||
if (auraEffect->GetMiscValue())
|
|
||||||
{
|
|
||||||
_UpdateFlags |= PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED;
|
|
||||||
phaseInfo->phasemask = auraEffect->GetMiscValue();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SpellPhaseStore::const_iterator itr = _SpellPhaseStore->find(auraEffect->GetHolder()->GetId());
|
|
||||||
if (itr != _SpellPhaseStore->end())
|
|
||||||
{
|
|
||||||
if (itr->second->phasemask)
|
|
||||||
{
|
|
||||||
_UpdateFlags |= PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED;
|
|
||||||
phaseInfo->phasemask = itr->second->phasemask;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itr->second->terrainswapmap)
|
|
||||||
phaseInfo->terrainswapmap = itr->second->terrainswapmap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// this is not Phase.dbc id...
|
|
||||||
// phaseInfo->phaseId = auraEffect->GetMiscBValue();
|
|
||||||
|
|
||||||
if (phaseInfo->NeedsClientSideUpdate())
|
|
||||||
_UpdateFlags |= PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED;
|
|
||||||
|
|
||||||
phaseData->AddAuraInfo(auraEffect->GetHolder()->GetId(), phaseInfo);
|
|
||||||
|
|
||||||
Update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PhaseMgr::UnRegisterPhasingAuraEffect(Aura const* auraEffect)
|
|
||||||
{
|
|
||||||
_UpdateFlags |= phaseData->RemoveAuraInfo(auraEffect->GetHolder()->GetId());
|
|
||||||
|
|
||||||
Update();
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////
|
|
||||||
// Commands
|
|
||||||
|
|
||||||
void PhaseMgr::SendDebugReportToPlayer(Player* const debugger)
|
|
||||||
{
|
|
||||||
ChatHandler(debugger).PSendSysMessage(LANG_PHASING_REPORT_STATUS, player->GetName(), player->GetZoneId(), player->getLevel(), player->GetTeam(), _UpdateFlags);
|
|
||||||
|
|
||||||
PhaseDefinitionStore::const_iterator itr = _PhaseDefinitionStore->find(player->GetZoneId());
|
|
||||||
if (itr == _PhaseDefinitionStore->end())
|
|
||||||
ChatHandler(debugger).PSendSysMessage(LANG_PHASING_NO_DEFINITIONS, player->GetZoneId());
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (PhaseDefinitionContainer::const_iterator phase = itr->second.begin(); phase != itr->second.end(); ++phase)
|
|
||||||
{
|
|
||||||
if (CheckDefinition(*phase))
|
|
||||||
ChatHandler(debugger->GetSession()).PSendSysMessage(LANG_PHASING_SUCCESS, (*phase)->entry, (*phase)->IsNegatingPhasemask() ? "negated Phase" : "Phase", (*phase)->phasemask);
|
|
||||||
else
|
|
||||||
ChatHandler(debugger).PSendSysMessage(LANG_PHASING_FAILED, (*phase)->phasemask, (*phase)->entry, (*phase)->zoneId);
|
|
||||||
|
|
||||||
if ((*phase)->IsLastDefinition())
|
|
||||||
{
|
|
||||||
ChatHandler(debugger).PSendSysMessage(LANG_PHASING_LAST_PHASE, (*phase)->phasemask, (*phase)->entry, (*phase)->zoneId);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ChatHandler(debugger).PSendSysMessage(LANG_PHASING_LIST, phaseData->_PhasemaskThroughDefinitions, phaseData->_PhasemaskThroughAuras, phaseData->_CustomPhasemask);
|
|
||||||
|
|
||||||
ChatHandler(debugger).PSendSysMessage(LANG_PHASING_PHASEMASK, phaseData->GetPhaseMaskForSpawn(), player->GetPhaseMask());
|
|
||||||
}
|
|
||||||
|
|
||||||
void PhaseMgr::SetCustomPhase(uint32 const phaseMask)
|
|
||||||
{
|
|
||||||
phaseData->_CustomPhasemask = phaseMask;
|
|
||||||
|
|
||||||
// phase auras normally not expected at BG but anyway better check
|
|
||||||
if (BattleGround* bg = player->GetBattleGround())
|
|
||||||
bg->EventPlayerDroppedFlag(player);
|
|
||||||
|
|
||||||
_UpdateFlags |= PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED;
|
|
||||||
|
|
||||||
Update();
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////
|
|
||||||
// Phase Data
|
|
||||||
|
|
||||||
uint32 PhaseData::GetCurrentPhasemask() const
|
|
||||||
{
|
|
||||||
if (player->isGameMaster())
|
|
||||||
return uint32(PHASEMASK_ANYWHERE);
|
|
||||||
|
|
||||||
if (_CustomPhasemask)
|
|
||||||
return _CustomPhasemask;
|
|
||||||
|
|
||||||
return GetPhaseMaskForSpawn();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline uint32 PhaseData::GetPhaseMaskForSpawn() const
|
|
||||||
{
|
|
||||||
uint32 const phase = (_PhasemaskThroughDefinitions | _PhasemaskThroughAuras);
|
|
||||||
return (phase ? phase : PHASEMASK_NORMAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PhaseData::SendPhaseMaskToPlayer()
|
|
||||||
{
|
|
||||||
// Server side update
|
|
||||||
uint32 const phasemask = GetCurrentPhasemask();
|
|
||||||
if (player->GetPhaseMask() == phasemask)
|
|
||||||
return;
|
|
||||||
|
|
||||||
player->SetPhaseMask(phasemask, false);
|
|
||||||
|
|
||||||
if (player->IsInWorld())
|
|
||||||
player->UpdateVisibilityAndView();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PhaseData::SendPhaseshiftToPlayer()
|
|
||||||
{
|
|
||||||
// Client side update
|
|
||||||
std::set<uint32> phaseIds;
|
|
||||||
std::set<uint32> terrainswaps;
|
|
||||||
|
|
||||||
for (PhaseInfoContainer::const_iterator itr = spellPhaseInfo.begin(); itr != spellPhaseInfo.end(); ++itr)
|
|
||||||
{
|
|
||||||
if (itr->second->terrainswapmap)
|
|
||||||
terrainswaps.insert(itr->second->terrainswapmap);
|
|
||||||
|
|
||||||
if (itr->second->phaseId)
|
|
||||||
phaseIds.insert(itr->second->phaseId);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Phase Definitions
|
|
||||||
for (std::list<PhaseDefinition const*>::const_iterator itr = activePhaseDefinitions.begin(); itr != activePhaseDefinitions.end(); ++itr)
|
|
||||||
{
|
|
||||||
if ((*itr)->phaseId)
|
|
||||||
phaseIds.insert((*itr)->phaseId);
|
|
||||||
|
|
||||||
if ((*itr)->terrainswapmap)
|
|
||||||
terrainswaps.insert((*itr)->terrainswapmap);
|
|
||||||
}
|
|
||||||
|
|
||||||
player->GetSession()->SendSetPhaseShift(phaseIds, terrainswaps);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PhaseData::AddPhaseDefinition(PhaseDefinition const* phaseDefinition)
|
|
||||||
{
|
|
||||||
if (phaseDefinition->IsOverwritingExistingPhases())
|
|
||||||
{
|
|
||||||
activePhaseDefinitions.clear();
|
|
||||||
_PhasemaskThroughDefinitions = phaseDefinition->phasemask;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (phaseDefinition->IsNegatingPhasemask())
|
|
||||||
_PhasemaskThroughDefinitions &= ~phaseDefinition->phasemask;
|
|
||||||
else
|
|
||||||
_PhasemaskThroughDefinitions |= phaseDefinition->phasemask;
|
|
||||||
}
|
|
||||||
|
|
||||||
activePhaseDefinitions.push_back(phaseDefinition);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PhaseData::AddAuraInfo(uint32 const spellId, PhaseInfo* phaseInfo)
|
|
||||||
{
|
|
||||||
if (phaseInfo->phasemask)
|
|
||||||
_PhasemaskThroughAuras |= phaseInfo->phasemask;
|
|
||||||
|
|
||||||
spellPhaseInfo[spellId] = phaseInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32 PhaseData::RemoveAuraInfo(uint32 const spellId)
|
|
||||||
{
|
|
||||||
PhaseInfoContainer::iterator rAura = spellPhaseInfo.find(spellId);
|
|
||||||
if (rAura != spellPhaseInfo.end())
|
|
||||||
{
|
|
||||||
uint32 updateflag = 0;
|
|
||||||
|
|
||||||
if (rAura->second->NeedsClientSideUpdate())
|
|
||||||
updateflag |= PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED;
|
|
||||||
|
|
||||||
if (rAura->second->NeedsServerSideUpdate())
|
|
||||||
{
|
|
||||||
_PhasemaskThroughAuras = 0;
|
|
||||||
|
|
||||||
updateflag |= PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED;
|
|
||||||
|
|
||||||
spellPhaseInfo.erase(rAura);
|
|
||||||
|
|
||||||
for (PhaseInfoContainer::const_iterator itr = spellPhaseInfo.begin(); itr != spellPhaseInfo.end(); ++itr)
|
|
||||||
_PhasemaskThroughAuras |= itr->second->phasemask;
|
|
||||||
}
|
|
||||||
|
|
||||||
return updateflag;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////
|
|
||||||
// Phase Update Data
|
|
||||||
|
|
||||||
void PhaseUpdateData::AddQuestUpdate(uint32 const questId)
|
|
||||||
{
|
|
||||||
AddConditionType(CONDITION_QUESTREWARDED);
|
|
||||||
AddConditionType(CONDITION_QUESTTAKEN);
|
|
||||||
AddConditionType(CONDITION_QUEST_NONE);
|
|
||||||
|
|
||||||
_questId = questId;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool PhaseUpdateData::IsConditionRelated(PlayerCondition const* condition) const
|
|
||||||
{
|
|
||||||
switch (condition->m_condition)
|
|
||||||
{
|
|
||||||
case CONDITION_QUESTREWARDED:
|
|
||||||
case CONDITION_QUESTTAKEN:
|
|
||||||
case CONDITION_QUEST_NONE:
|
|
||||||
return condition->m_value1 == _questId && ((1 << condition->m_condition) & _conditionTypeFlags);
|
|
||||||
default:
|
|
||||||
return (1 << condition->m_condition) & _conditionTypeFlags;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool PhaseMgr::IsConditionTypeSupported(ConditionType const conditionType)
|
|
||||||
{
|
|
||||||
switch (conditionType)
|
|
||||||
{
|
|
||||||
case CONDITION_QUESTREWARDED:
|
|
||||||
case CONDITION_QUESTTAKEN:
|
|
||||||
case CONDITION_QUEST_NONE:
|
|
||||||
case CONDITION_TEAM:
|
|
||||||
case CONDITION_RACE_CLASS:
|
|
||||||
case CONDITION_LEVEL:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,175 +0,0 @@
|
||||||
/*
|
|
||||||
* This file is part of the MaNGOS Project. See AUTHORS file for Copyright information
|
|
||||||
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*
|
|
||||||
* World of Warcraft, and all World of Warcraft or Warcraft art, images,
|
|
||||||
* and lore are copyrighted by Blizzard Entertainment, Inc.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MANGOS_PHASEMGR_H
|
|
||||||
#define MANGOS_PHASEMGR_H
|
|
||||||
|
|
||||||
#include "SharedDefines.h"
|
|
||||||
#include "ObjectMgr.h"
|
|
||||||
|
|
||||||
class ObjectMgr;
|
|
||||||
class Player;
|
|
||||||
class Aura;
|
|
||||||
class PlayerCondition;
|
|
||||||
|
|
||||||
// Phasing (visibility)
|
|
||||||
enum PhasingFlags
|
|
||||||
{
|
|
||||||
PHASE_FLAG_OVERWRITE_EXISTING = 0x01, // don't stack with existing phases, overwrites existing phases
|
|
||||||
PHASE_FLAG_NO_MORE_PHASES = 0x02, // stop calculating phases after this phase was applied (no more phases will be applied)
|
|
||||||
PHASE_FLAG_NEGATE_PHASE = 0x04 // negate instead to add the phasemask
|
|
||||||
};
|
|
||||||
|
|
||||||
enum PhaseUpdateFlag
|
|
||||||
{
|
|
||||||
PHASE_UPDATE_FLAG_ZONE_UPDATE = 0x01,
|
|
||||||
PHASE_UPDATE_FLAG_AREA_UPDATE = 0x02,
|
|
||||||
|
|
||||||
// Internal flags
|
|
||||||
PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED = 0x08,
|
|
||||||
PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED = 0x10,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PhaseDefinition
|
|
||||||
{
|
|
||||||
uint32 zoneId;
|
|
||||||
uint32 entry;
|
|
||||||
uint32 phasemask;
|
|
||||||
uint32 phaseId;
|
|
||||||
uint32 terrainswapmap;
|
|
||||||
uint8 flags;
|
|
||||||
uint16 conditionId;
|
|
||||||
|
|
||||||
bool IsOverwritingExistingPhases() const { return flags & PHASE_FLAG_OVERWRITE_EXISTING; }
|
|
||||||
bool IsLastDefinition() const { return flags & PHASE_FLAG_NO_MORE_PHASES; }
|
|
||||||
bool IsNegatingPhasemask() const { return flags & PHASE_FLAG_NEGATE_PHASE; }
|
|
||||||
};
|
|
||||||
|
|
||||||
struct SpellPhaseInfo
|
|
||||||
{
|
|
||||||
uint32 spellId;
|
|
||||||
uint32 phasemask;
|
|
||||||
uint32 terrainswapmap;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PhaseInfo
|
|
||||||
{
|
|
||||||
PhaseInfo() : phasemask(0), terrainswapmap(0), phaseId(0) {}
|
|
||||||
|
|
||||||
uint32 phasemask;
|
|
||||||
uint32 terrainswapmap;
|
|
||||||
uint32 phaseId;
|
|
||||||
|
|
||||||
bool NeedsServerSideUpdate() const { return phasemask; }
|
|
||||||
bool NeedsClientSideUpdate() const { return terrainswapmap || phaseId; }
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef UNORDERED_MAP<uint32 /*spellId*/, PhaseInfo*> PhaseInfoContainer;
|
|
||||||
|
|
||||||
struct PhaseData
|
|
||||||
{
|
|
||||||
PhaseData(Player* _player) : _PhasemaskThroughDefinitions(0), _PhasemaskThroughAuras(0), _CustomPhasemask(0), player(_player) {}
|
|
||||||
|
|
||||||
uint32 _PhasemaskThroughDefinitions;
|
|
||||||
uint32 _PhasemaskThroughAuras;
|
|
||||||
uint32 _CustomPhasemask;
|
|
||||||
|
|
||||||
uint32 GetCurrentPhasemask() const;
|
|
||||||
inline uint32 GetPhaseMaskForSpawn() const;
|
|
||||||
|
|
||||||
void ResetDefinitions() { _PhasemaskThroughDefinitions = 0; activePhaseDefinitions.clear(); }
|
|
||||||
void AddPhaseDefinition(PhaseDefinition const* phaseDefinition);
|
|
||||||
bool HasActiveDefinitions() const { return !activePhaseDefinitions.empty(); }
|
|
||||||
|
|
||||||
void AddAuraInfo(uint32 const spellId, PhaseInfo* phaseInfo);
|
|
||||||
uint32 RemoveAuraInfo(uint32 const spellId);
|
|
||||||
|
|
||||||
void SendPhaseMaskToPlayer();
|
|
||||||
void SendPhaseshiftToPlayer();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Player* player;
|
|
||||||
std::list<PhaseDefinition const*> activePhaseDefinitions;
|
|
||||||
PhaseInfoContainer spellPhaseInfo;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PhaseUpdateData
|
|
||||||
{
|
|
||||||
void AddConditionType(ConditionType const conditionType) { _conditionTypeFlags |= (1 << conditionType); }
|
|
||||||
void AddQuestUpdate(uint32 const questId);
|
|
||||||
|
|
||||||
bool IsConditionRelated(PlayerCondition const* condition) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
uint32 _conditionTypeFlags;
|
|
||||||
uint32 _questId;
|
|
||||||
};
|
|
||||||
|
|
||||||
class PhaseMgr
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
PhaseMgr(Player* _player);
|
|
||||||
~PhaseMgr() { delete phaseData; }
|
|
||||||
|
|
||||||
uint32 GetCurrentPhasemask() { return phaseData->GetCurrentPhasemask(); };
|
|
||||||
inline uint32 GetPhaseMaskForSpawn() { return phaseData->GetCurrentPhasemask(); }
|
|
||||||
|
|
||||||
// Phase definitions update handling
|
|
||||||
void NotifyConditionChanged(PhaseUpdateData const& updateData);
|
|
||||||
void NotifyStoresReloaded() { Recalculate(); Update(); }
|
|
||||||
|
|
||||||
void Update();
|
|
||||||
|
|
||||||
// Aura phase effects
|
|
||||||
void RegisterPhasingAuraEffect(Aura const* auraEffect);
|
|
||||||
void UnRegisterPhasingAuraEffect(Aura const* auraEffect);
|
|
||||||
|
|
||||||
// Update flags (delayed phasing)
|
|
||||||
void AddUpdateFlag(PhaseUpdateFlag const updateFlag) { _UpdateFlags |= updateFlag; }
|
|
||||||
void RemoveUpdateFlag(PhaseUpdateFlag const updateFlag);
|
|
||||||
|
|
||||||
// Needed for modify phase command
|
|
||||||
void SetCustomPhase(uint32 const phaseMask);
|
|
||||||
|
|
||||||
// Debug
|
|
||||||
void SendDebugReportToPlayer(Player* const debugger);
|
|
||||||
|
|
||||||
static bool IsConditionTypeSupported(ConditionType const conditionType);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void Recalculate();
|
|
||||||
|
|
||||||
inline bool CheckDefinition(PhaseDefinition const* phaseDefinition);
|
|
||||||
|
|
||||||
bool NeedsPhaseUpdateWithData(PhaseUpdateData const updateData);
|
|
||||||
|
|
||||||
inline bool IsUpdateInProgress() const { return (_UpdateFlags & PHASE_UPDATE_FLAG_ZONE_UPDATE) || (_UpdateFlags & PHASE_UPDATE_FLAG_AREA_UPDATE); }
|
|
||||||
|
|
||||||
PhaseDefinitionStore const* _PhaseDefinitionStore;
|
|
||||||
SpellPhaseStore const* _SpellPhaseStore;
|
|
||||||
|
|
||||||
Player* player;
|
|
||||||
PhaseData* phaseData;
|
|
||||||
uint8 _UpdateFlags;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -100,7 +100,7 @@ void WorldSession::SendNameQueryOpcodeFromDBCallBack(QueryResult* result, uint32
|
||||||
uint32 lowguid = fields[0].GetUInt32();
|
uint32 lowguid = fields[0].GetUInt32();
|
||||||
std::string name = fields[1].GetCppString();
|
std::string name = fields[1].GetCppString();
|
||||||
uint8 pRace = 0, pGender = 0, pClass = 0;
|
uint8 pRace = 0, pGender = 0, pClass = 0;
|
||||||
if (name == "")
|
if (name.empty())
|
||||||
name = session->GetMangosString(LANG_NON_EXIST_CHARACTER);
|
name = session->GetMangosString(LANG_NON_EXIST_CHARACTER);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -120,7 +120,7 @@ void WorldSession::SendNameQueryOpcodeFromDBCallBack(QueryResult* result, uint32
|
||||||
data << uint8(pClass); // class
|
data << uint8(pClass); // class
|
||||||
|
|
||||||
// if the first declined name field (5) is empty, the rest must be too
|
// if the first declined name field (5) is empty, the rest must be too
|
||||||
if (sWorld.getConfig(CONFIG_BOOL_DECLINED_NAMES_USED) && fields[5].GetCppString() != "")
|
if (sWorld.getConfig(CONFIG_BOOL_DECLINED_NAMES_USED) && !fields[5].GetCppString().empty())
|
||||||
{
|
{
|
||||||
data << uint8(1); // is declined
|
data << uint8(1); // is declined
|
||||||
for (int i = 5; i < MAX_DECLINED_NAME_CASES + 5; ++i)
|
for (int i = 5; i < MAX_DECLINED_NAME_CASES + 5; ++i)
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@
|
||||||
#include "ObjectAccessor.h"
|
#include "ObjectAccessor.h"
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
#include "Group.h"
|
#include "Group.h"
|
||||||
#include "PhaseMgr.h"
|
|
||||||
|
|
||||||
void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket& recv_data)
|
void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket& recv_data)
|
||||||
{
|
{
|
||||||
|
|
@ -352,11 +351,6 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
_player->SetQuestStatus(quest, QUEST_STATUS_NONE);
|
_player->SetQuestStatus(quest, QUEST_STATUS_NONE);
|
||||||
|
|
||||||
PhaseUpdateData phaseUdateData;
|
|
||||||
phaseUdateData.AddQuestUpdate(quest);
|
|
||||||
|
|
||||||
_player->GetPhaseMgr()->NotifyConditionChanged(phaseUdateData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_player->SetQuestSlot(slot, 0);
|
_player->SetQuestSlot(slot, 0);
|
||||||
|
|
|
||||||
|
|
@ -1547,12 +1547,12 @@ bool ScriptAction::HandleScriptStep()
|
||||||
}
|
}
|
||||||
|
|
||||||
// bitmask: 0/1=target-player, 0/2=with distance dependent, 0/4=map wide, 0/8=zone wide
|
// bitmask: 0/1=target-player, 0/2=with distance dependent, 0/4=map wide, 0/8=zone wide
|
||||||
Player* pSoundTarget = NULL;
|
Player* pSoundTarget = nullptr;
|
||||||
if (m_script->playSound.flags & 1)
|
if (m_script->playSound.flags & 1)
|
||||||
{
|
{
|
||||||
pSoundTarget = GetPlayerTargetOrSourceAndLog(pSource, pTarget);
|
pSoundTarget = GetPlayerTargetOrSourceAndLog(pSource, pTarget);
|
||||||
if (!pSoundTarget)
|
if (!pSoundTarget)
|
||||||
{ break; }
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_script->data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL)
|
if (m_script->data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL)
|
||||||
|
|
@ -1560,11 +1560,11 @@ bool ScriptAction::HandleScriptStep()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_script->playSound.flags & 2)
|
if (m_script->playSound.flags & 2)
|
||||||
{ pSource->PlayDistanceSound(m_script->playSound.soundId, pSoundTarget); }
|
pSource->PlayDistanceSound(m_script->playSound.soundId, pSoundTarget);
|
||||||
else if (m_script->playSound.flags & (4 | 8))
|
else if (m_script->playSound.flags & (4 | 8))
|
||||||
{ m_map->PlayDirectSoundToMap(m_script->playSound.soundId, m_script->playSound.flags & 8 ? pSource->GetZoneId() : 0); }
|
m_map->PlayDirectSoundToMap(m_script->playSound.soundId, m_script->playSound.flags & 8 ? pSource->GetZoneId() : 0);
|
||||||
else
|
else
|
||||||
{ pSource->PlayDirectSound(m_script->playSound.soundId, pSoundTarget); }
|
pSource->PlayDirectSound(m_script->playSound.soundId, pSoundTarget);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -2697,3 +2697,8 @@ uint32 GetScriptIdsCount()
|
||||||
{
|
{
|
||||||
return sScriptMgr.GetScriptIdsCount();
|
return sScriptMgr.GetScriptIdsCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AddWaypointFromExternal(uint32 entry, int32 pathId, uint32 pointId, float x, float y, float z, float o, uint32 waittime)
|
||||||
|
{
|
||||||
|
return sWaypointMgr.AddExternalNode(entry, pathId, pointId, x, y, z, o, waittime);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ SpellCastTargets::SpellCastTargets()
|
||||||
m_itemTargetEntry = 0;
|
m_itemTargetEntry = 0;
|
||||||
|
|
||||||
m_srcX = m_srcY = m_srcZ = m_destX = m_destY = m_destZ = 0.0f;
|
m_srcX = m_srcY = m_srcZ = m_destX = m_destY = m_destZ = 0.0f;
|
||||||
m_strTarget = "";
|
m_strTarget.clear();
|
||||||
m_targetMask = 0;
|
m_targetMask = 0;
|
||||||
|
|
||||||
m_elevation = 0.0f;
|
m_elevation = 0.0f;
|
||||||
|
|
@ -1406,7 +1406,7 @@ void Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask)
|
||||||
if (m_applyMultiplierMask & (1 << effectNumber))
|
if (m_applyMultiplierMask & (1 << effectNumber))
|
||||||
{
|
{
|
||||||
// Get multiplier
|
// Get multiplier
|
||||||
float multiplier = spellEffect ? spellEffect->DmgMultiplier : 1.0f;
|
float multiplier = spellEffect ? spellEffect->EffectDamageMultiplier : 1.0f;
|
||||||
// Apply multiplier mods
|
// Apply multiplier mods
|
||||||
if (realCaster)
|
if (realCaster)
|
||||||
if (Player* modOwner = realCaster->GetSpellModOwner())
|
if (Player* modOwner = realCaster->GetSpellModOwner())
|
||||||
|
|
@ -1529,7 +1529,7 @@ void Spell::HandleDelayedSpellLaunch(TargetInfo* target)
|
||||||
if (m_applyMultiplierMask & (1 << effectNumber))
|
if (m_applyMultiplierMask & (1 << effectNumber))
|
||||||
{
|
{
|
||||||
// Get multiplier
|
// Get multiplier
|
||||||
float multiplier = spellEffect ? spellEffect->DmgMultiplier : 1.0f;
|
float multiplier = spellEffect ? spellEffect->EffectDamageMultiplier : 1.0f;
|
||||||
// Apply multiplier mods
|
// Apply multiplier mods
|
||||||
if (real_caster)
|
if (real_caster)
|
||||||
if (Player* modOwner = real_caster->GetSpellModOwner())
|
if (Player* modOwner = real_caster->GetSpellModOwner())
|
||||||
|
|
@ -1685,7 +1685,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
|
|
||||||
// Get a random point in circle. Use sqrt(rand) to correct distribution when converting polar to Cartesian coordinates.
|
// Get a random point in circle. Use sqrt(rand) to correct distribution when converting polar to Cartesian coordinates.
|
||||||
radius *= sqrtf(rand_norm_f());
|
radius *= sqrtf(rand_norm_f());
|
||||||
// no 'break' expected since we use code in case TARGET_RANDOM_CIRCUMFERENCE_POINT!!!
|
// no 'break' expected since we use code in case TARGET_RANDOM_CIRCUMFERENCE_POINT!!!
|
||||||
case TARGET_RANDOM_CIRCUMFERENCE_POINT:
|
case TARGET_RANDOM_CIRCUMFERENCE_POINT:
|
||||||
{
|
{
|
||||||
// Get a random point AT the circumference
|
// Get a random point AT the circumference
|
||||||
|
|
@ -1771,77 +1771,38 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
targetUnitMap.push_back(m_caster);
|
targetUnitMap.push_back(m_caster);
|
||||||
break;
|
break;
|
||||||
case TARGET_RANDOM_ENEMY_CHAIN_IN_AREA:
|
case TARGET_RANDOM_ENEMY_CHAIN_IN_AREA:
|
||||||
{
|
|
||||||
m_targets.m_targetMask = 0;
|
|
||||||
unMaxTargets = EffectChainTarget;
|
|
||||||
float max_range = radius + unMaxTargets * CHAIN_SPELL_JUMP_RADIUS;
|
|
||||||
|
|
||||||
UnitList tempTargetUnitMap;
|
|
||||||
|
|
||||||
{
|
|
||||||
MaNGOS::AnyAoETargetUnitInObjectRangeCheck u_check(m_caster, max_range);
|
|
||||||
MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck> searcher(tempTargetUnitMap, u_check);
|
|
||||||
Cell::VisitAllObjects(m_caster, searcher, max_range);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tempTargetUnitMap.empty())
|
|
||||||
break;
|
|
||||||
|
|
||||||
tempTargetUnitMap.sort(TargetDistanceOrderNear(m_caster));
|
|
||||||
|
|
||||||
// Now to get us a random target that's in the initial range of the spell
|
|
||||||
uint32 t = 0;
|
|
||||||
UnitList::iterator itr = tempTargetUnitMap.begin();
|
|
||||||
while (itr != tempTargetUnitMap.end() && (*itr)->IsWithinDist(m_caster, radius))
|
|
||||||
++t, ++itr;
|
|
||||||
|
|
||||||
if (!t)
|
|
||||||
break;
|
|
||||||
|
|
||||||
itr = tempTargetUnitMap.begin();
|
|
||||||
std::advance(itr, rand() % t);
|
|
||||||
Unit* pUnitTarget = *itr;
|
|
||||||
targetUnitMap.push_back(pUnitTarget);
|
|
||||||
|
|
||||||
tempTargetUnitMap.erase(itr);
|
|
||||||
|
|
||||||
tempTargetUnitMap.sort(TargetDistanceOrderNear(pUnitTarget));
|
|
||||||
|
|
||||||
t = unMaxTargets - 1;
|
|
||||||
Unit* prev = pUnitTarget;
|
|
||||||
UnitList::iterator next = tempTargetUnitMap.begin();
|
|
||||||
|
|
||||||
while (t && next != tempTargetUnitMap.end())
|
|
||||||
{
|
|
||||||
if (!prev->IsWithinDist(*next, CHAIN_SPELL_JUMP_RADIUS))
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (!m_spellInfo->HasAttribute(SPELL_ATTR_EX2_IGNORE_LOS) && !prev->IsWithinLOSInMap(*next))
|
|
||||||
{
|
|
||||||
++next;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
prev = *next;
|
|
||||||
targetUnitMap.push_back(prev);
|
|
||||||
tempTargetUnitMap.erase(next);
|
|
||||||
tempTargetUnitMap.sort(TargetDistanceOrderNear(prev));
|
|
||||||
next = tempTargetUnitMap.begin();
|
|
||||||
|
|
||||||
--t;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case TARGET_RANDOM_FRIEND_CHAIN_IN_AREA:
|
case TARGET_RANDOM_FRIEND_CHAIN_IN_AREA:
|
||||||
|
case TARGET_RANDOM_UNIT_CHAIN_IN_AREA:
|
||||||
{
|
{
|
||||||
m_targets.m_targetMask = 0;
|
m_targets.m_targetMask = 0;
|
||||||
unMaxTargets = EffectChainTarget;
|
unMaxTargets = EffectChainTarget;
|
||||||
float max_range = radius + unMaxTargets * CHAIN_SPELL_JUMP_RADIUS;
|
float max_range = radius + unMaxTargets * CHAIN_SPELL_JUMP_RADIUS;
|
||||||
|
|
||||||
UnitList tempTargetUnitMap;
|
UnitList tempTargetUnitMap;
|
||||||
|
|
||||||
|
switch (targetMode)
|
||||||
{
|
{
|
||||||
MaNGOS::AnyFriendlyUnitInObjectRangeCheck u_check(m_caster, max_range);
|
case TARGET_RANDOM_ENEMY_CHAIN_IN_AREA:
|
||||||
MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck> searcher(tempTargetUnitMap, u_check);
|
{
|
||||||
Cell::VisitAllObjects(m_caster, searcher, max_range);
|
MaNGOS::AnyAoETargetUnitInObjectRangeCheck u_check(m_caster, max_range);
|
||||||
|
MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck> searcher(tempTargetUnitMap, u_check);
|
||||||
|
Cell::VisitAllObjects(m_caster, searcher, max_range);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TARGET_RANDOM_FRIEND_CHAIN_IN_AREA:
|
||||||
|
{
|
||||||
|
MaNGOS::AnyFriendlyUnitInObjectRangeCheck u_check(m_caster, max_range);
|
||||||
|
MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck> searcher(tempTargetUnitMap, u_check);
|
||||||
|
Cell::VisitAllObjects(m_caster, searcher, max_range);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TARGET_RANDOM_UNIT_CHAIN_IN_AREA:
|
||||||
|
{
|
||||||
|
MaNGOS::AnyUnitInObjectRangeCheck u_check(m_caster, max_range);
|
||||||
|
MaNGOS::UnitListSearcher<MaNGOS::AnyUnitInObjectRangeCheck> searcher(tempTargetUnitMap, u_check);
|
||||||
|
Cell::VisitAllObjects(m_caster, searcher, max_range);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tempTargetUnitMap.empty())
|
if (tempTargetUnitMap.empty())
|
||||||
|
|
@ -1974,6 +1935,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
switch (m_spellInfo->Id)
|
switch (m_spellInfo->Id)
|
||||||
{
|
{
|
||||||
// Do not target current victim
|
// Do not target current victim
|
||||||
|
case 30769: // Pick Red Riding Hood
|
||||||
case 30843: // Enfeeble
|
case 30843: // Enfeeble
|
||||||
case 31347: // Doom
|
case 31347: // Doom
|
||||||
case 37676: // Insidious Whisper
|
case 37676: // Insidious Whisper
|
||||||
|
|
@ -2010,10 +1972,12 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
case SPELL_EFFECT_KILL_CREDIT_PERSONAL:
|
case SPELL_EFFECT_KILL_CREDIT_PERSONAL:
|
||||||
case SPELL_EFFECT_KILL_CREDIT_GROUP:
|
case SPELL_EFFECT_KILL_CREDIT_GROUP:
|
||||||
targetB = SPELL_TARGETS_ALL;
|
targetB = SPELL_TARGETS_ALL;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// Select friendly targets for positive effect
|
// Select friendly targets for positive effect
|
||||||
if (IsPositiveEffect(m_spellInfo, effIndex))
|
if (IsPositiveEffect(m_spellInfo, effIndex))
|
||||||
targetB = SPELL_TARGETS_FRIENDLY;
|
targetB = SPELL_TARGETS_FRIENDLY;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
UnitList tempTargetUnitMap;
|
UnitList tempTargetUnitMap;
|
||||||
|
|
@ -2055,9 +2019,6 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// exclude caster
|
|
||||||
targetUnitMap.remove(m_caster);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TARGET_AREAEFFECT_CUSTOM:
|
case TARGET_AREAEFFECT_CUSTOM:
|
||||||
|
|
@ -2172,7 +2133,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
tempTargetGOList.erase(itr++);
|
tempTargetGOList.erase(itr++);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// no break here
|
// no break here
|
||||||
case TARGET_AREAEFFECT_GO_AROUND_SOURCE:
|
case TARGET_AREAEFFECT_GO_AROUND_SOURCE:
|
||||||
case TARGET_AREAEFFECT_GO_AROUND_DEST:
|
case TARGET_AREAEFFECT_GO_AROUND_DEST:
|
||||||
default:
|
default:
|
||||||
|
|
@ -2302,10 +2263,6 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
case TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER:
|
case TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER:
|
||||||
switch (m_spellInfo->Id)
|
switch (m_spellInfo->Id)
|
||||||
{
|
{
|
||||||
case 56153: // Guardian Aura - Ahn'Kahet
|
|
||||||
FillAreaTargets(targetUnitMap, radius, PUSH_SELF_CENTER, SPELL_TARGETS_FRIENDLY);
|
|
||||||
targetUnitMap.remove(m_caster);
|
|
||||||
break;
|
|
||||||
case 64844: // Divine Hymn
|
case 64844: // Divine Hymn
|
||||||
// target amount stored in parent spell dummy effect but hard to access
|
// target amount stored in parent spell dummy effect but hard to access
|
||||||
FillRaidOrPartyHealthPriorityTargets(targetUnitMap, m_caster, m_caster, radius, 3, true, false, true);
|
FillRaidOrPartyHealthPriorityTargets(targetUnitMap, m_caster, m_caster, radius, 3, true, false, true);
|
||||||
|
|
@ -2356,7 +2313,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
else
|
else
|
||||||
FillAreaTargets(targetUnitMap, radius, PUSH_DEST_CENTER, SPELL_TARGETS_FRIENDLY);
|
FillAreaTargets(targetUnitMap, radius, PUSH_DEST_CENTER, SPELL_TARGETS_FRIENDLY);
|
||||||
break;
|
break;
|
||||||
// TARGET_SINGLE_PARTY means that the spells can only be casted on a party member and not on the caster (some seals, fire shield from imp, etc..)
|
// TARGET_SINGLE_PARTY means that the spells can only be casted on a party member and not on the caster (some seals, fire shield from imp, etc..)
|
||||||
case TARGET_SINGLE_PARTY:
|
case TARGET_SINGLE_PARTY:
|
||||||
{
|
{
|
||||||
Unit* target = m_targets.getUnitTarget();
|
Unit* target = m_targets.getUnitTarget();
|
||||||
|
|
@ -2364,7 +2321,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
if (target && target != m_caster)
|
if (target && target != m_caster)
|
||||||
{
|
{
|
||||||
// Can only be casted on group's members or its pets
|
// Can only be casted on group's members or its pets
|
||||||
Group* pGroup = NULL;
|
Group* pGroup = nullptr;
|
||||||
|
|
||||||
Unit* owner = m_caster->GetCharmerOrOwner();
|
Unit* owner = m_caster->GetCharmerOrOwner();
|
||||||
Unit* targetOwner = target->GetCharmerOrOwner();
|
Unit* targetOwner = target->GetCharmerOrOwner();
|
||||||
|
|
@ -2431,9 +2388,57 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
case TARGET_LARGE_FRONTAL_CONE:
|
case TARGET_LARGE_FRONTAL_CONE:
|
||||||
FillAreaTargets(targetUnitMap, radius, PUSH_IN_FRONT_90, SPELL_TARGETS_AOE_DAMAGE);
|
FillAreaTargets(targetUnitMap, radius, PUSH_IN_FRONT_90, SPELL_TARGETS_AOE_DAMAGE);
|
||||||
break;
|
break;
|
||||||
case TARGET_NARROW_FRONTAL_CONE:
|
case TARGET_FRIENDLY_FRONTAL_CONE:
|
||||||
FillAreaTargets(targetUnitMap, radius, PUSH_IN_FRONT_15, SPELL_TARGETS_AOE_DAMAGE);
|
FillAreaTargets(targetUnitMap, radius, PUSH_IN_FRONT_30, SPELL_TARGETS_FRIENDLY);
|
||||||
break;
|
break;
|
||||||
|
case TARGET_NARROW_FRONTAL_CONE:
|
||||||
|
case TARGET_NARROW_FRONTAL_CONE_2:
|
||||||
|
{
|
||||||
|
SpellTargets targetB = SPELL_TARGETS_AOE_DAMAGE;
|
||||||
|
|
||||||
|
if (spellEffect->Effect == SPELL_EFFECT_SCRIPT_EFFECT)
|
||||||
|
targetB = SPELL_TARGETS_ALL;
|
||||||
|
|
||||||
|
UnitList tempTargetUnitMap;
|
||||||
|
SQLMultiStorage::SQLMSIteratorBounds<SpellTargetEntry> bounds = sSpellScriptTargetStorage.getBounds<SpellTargetEntry>(m_spellInfo->Id);
|
||||||
|
|
||||||
|
// fill real target list if no spell script target defined
|
||||||
|
FillAreaTargets(bounds.first != bounds.second ? tempTargetUnitMap : targetUnitMap,
|
||||||
|
radius, PUSH_IN_FRONT_15, bounds.first != bounds.second ? SPELL_TARGETS_ALL : targetB);
|
||||||
|
|
||||||
|
if (!tempTargetUnitMap.empty())
|
||||||
|
{
|
||||||
|
for (UnitList::const_iterator iter = tempTargetUnitMap.begin(); iter != tempTargetUnitMap.end(); ++iter)
|
||||||
|
{
|
||||||
|
if ((*iter)->GetTypeId() != TYPEID_UNIT)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for (SQLMultiStorage::SQLMultiSIterator<SpellTargetEntry> i_spellST = bounds.first; i_spellST != bounds.second; ++i_spellST)
|
||||||
|
{
|
||||||
|
if (i_spellST->CanNotHitWithSpellEffect(effIndex))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// only creature entries supported for this target type
|
||||||
|
if (i_spellST->type == SPELL_TARGET_TYPE_GAMEOBJECT)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ((*iter)->GetEntry() == i_spellST->targetEntry)
|
||||||
|
{
|
||||||
|
if (i_spellST->type == SPELL_TARGET_TYPE_DEAD && ((Creature*)(*iter))->IsCorpse())
|
||||||
|
{
|
||||||
|
targetUnitMap.push_back((*iter));
|
||||||
|
}
|
||||||
|
else if (i_spellST->type == SPELL_TARGET_TYPE_CREATURE && (*iter)->IsAlive())
|
||||||
|
{
|
||||||
|
targetUnitMap.push_back((*iter));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case TARGET_IN_FRONT_OF_CASTER_30:
|
case TARGET_IN_FRONT_OF_CASTER_30:
|
||||||
FillAreaTargets(targetUnitMap, radius, PUSH_IN_FRONT_30, SPELL_TARGETS_AOE_DAMAGE);
|
FillAreaTargets(targetUnitMap, radius, PUSH_IN_FRONT_30, SPELL_TARGETS_AOE_DAMAGE);
|
||||||
break;
|
break;
|
||||||
|
|
@ -2483,9 +2488,10 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
{
|
{
|
||||||
if (Unit* pUnitTarget = m_caster->SelectMagnetTarget(m_targets.getUnitTarget(), this, effIndex))
|
if (Unit* pUnitTarget = m_caster->SelectMagnetTarget(m_targets.getUnitTarget(), this, effIndex))
|
||||||
{
|
{
|
||||||
if (m_targets.getUnitTarget() && m_targets.getUnitTarget() != pUnitTarget)
|
if (m_targets.getUnitTarget() && m_targets.getUnitTarget() != pUnitTarget)
|
||||||
m_spellFlags |= SPELL_FLAG_REDIRECTED;
|
m_spellFlags |= SPELL_FLAG_REDIRECTED;
|
||||||
|
|
||||||
|
m_targets.setUnitTarget(pUnitTarget);
|
||||||
targetUnitMap.push_back(pUnitTarget);
|
targetUnitMap.push_back(pUnitTarget);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -2493,7 +2499,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
case TARGET_AREAEFFECT_PARTY:
|
case TARGET_AREAEFFECT_PARTY:
|
||||||
{
|
{
|
||||||
Unit* owner = m_caster->GetCharmerOrOwner();
|
Unit* owner = m_caster->GetCharmerOrOwner();
|
||||||
Player* pTarget = NULL;
|
Player* pTarget = nullptr;
|
||||||
|
|
||||||
if (owner)
|
if (owner)
|
||||||
{
|
{
|
||||||
|
|
@ -2519,13 +2525,13 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Group* pGroup = pTarget ? pTarget->GetGroup() : NULL;
|
Group* pGroup = pTarget ? pTarget->GetGroup() : nullptr;
|
||||||
|
|
||||||
if (pGroup)
|
if (pGroup)
|
||||||
{
|
{
|
||||||
uint8 subgroup = pTarget->GetSubGroup();
|
uint8 subgroup = pTarget->GetSubGroup();
|
||||||
|
|
||||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
for (GroupReference* itr = pGroup->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||||
{
|
{
|
||||||
Player* Target = itr->getSource();
|
Player* Target = itr->getSource();
|
||||||
|
|
||||||
|
|
@ -2641,12 +2647,12 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
case TARGET_AREAEFFECT_PARTY_AND_CLASS:
|
case TARGET_AREAEFFECT_PARTY_AND_CLASS:
|
||||||
{
|
{
|
||||||
Player* targetPlayer = m_targets.getUnitTarget() && m_targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER
|
Player* targetPlayer = m_targets.getUnitTarget() && m_targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER
|
||||||
? (Player*)m_targets.getUnitTarget() : NULL;
|
? (Player*)m_targets.getUnitTarget() : nullptr;
|
||||||
|
|
||||||
Group* pGroup = targetPlayer ? targetPlayer->GetGroup() : NULL;
|
Group* pGroup = targetPlayer ? targetPlayer->GetGroup() : nullptr;
|
||||||
if (pGroup)
|
if (pGroup)
|
||||||
{
|
{
|
||||||
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
for (GroupReference* itr = pGroup->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||||
{
|
{
|
||||||
Player* Target = itr->getSource();
|
Player* Target = itr->getSource();
|
||||||
|
|
||||||
|
|
@ -2683,7 +2689,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
case TARGET_RIGHT_FROM_VICTIM:
|
case TARGET_RIGHT_FROM_VICTIM:
|
||||||
case TARGET_LEFT_FROM_VICTIM:
|
case TARGET_LEFT_FROM_VICTIM:
|
||||||
{
|
{
|
||||||
Unit* pTarget = NULL;
|
Unit* pTarget = nullptr;
|
||||||
|
|
||||||
// explicit cast data from client or server-side cast
|
// explicit cast data from client or server-side cast
|
||||||
// some spell at client send caster
|
// some spell at client send caster
|
||||||
|
|
@ -2770,7 +2776,6 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
case TARGET_POINT_AT_SE:
|
case TARGET_POINT_AT_SE:
|
||||||
case TARGET_POINT_AT_SW:
|
case TARGET_POINT_AT_SW:
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
|
if (!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
|
||||||
{
|
{
|
||||||
Unit* currentTarget = m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster;
|
Unit* currentTarget = m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster;
|
||||||
|
|
@ -2968,6 +2973,10 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove caster from the list if required by attribute
|
||||||
|
if (targetMode != TARGET_SELF && targetMode != TARGET_SELF2 && m_spellInfo->HasAttribute(SPELL_ATTR_EX_CANT_TARGET_SELF))
|
||||||
|
targetUnitMap.remove(m_caster);
|
||||||
|
|
||||||
if (unMaxTargets && targetUnitMap.size() > unMaxTargets)
|
if (unMaxTargets && targetUnitMap.size() > unMaxTargets)
|
||||||
{
|
{
|
||||||
// make sure one unit is always removed per iteration
|
// make sure one unit is always removed per iteration
|
||||||
|
|
@ -6038,6 +6047,42 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case SPELL_EFFECT_RESURRECT:
|
||||||
|
case SPELL_EFFECT_RESURRECT_NEW:
|
||||||
|
{
|
||||||
|
if (m_targets.m_targetMask & (TARGET_FLAG_CORPSE | TARGET_FLAG_PVP_CORPSE))
|
||||||
|
{
|
||||||
|
if (Corpse* corpse = m_caster->GetMap()->GetCorpse(m_targets.getCorpseTargetGuid()))
|
||||||
|
{
|
||||||
|
if (Player* owner = ObjectAccessor::FindPlayer(corpse->GetOwnerGuid()))
|
||||||
|
{
|
||||||
|
if (owner->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
|
||||||
|
return SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED;
|
||||||
|
}
|
||||||
|
else if (m_targets.m_targetMask & TARGET_FLAG_UNIT)
|
||||||
|
{
|
||||||
|
Unit* target = m_targets.getUnitTarget();
|
||||||
|
if (!target || target->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
|
||||||
|
return SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SPELL_EFFECT_SELF_RESURRECT:
|
||||||
|
{
|
||||||
|
if (m_caster->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
|
||||||
|
return SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case SPELL_EFFECT_LEAP:
|
case SPELL_EFFECT_LEAP:
|
||||||
case SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER:
|
case SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER:
|
||||||
{
|
{
|
||||||
|
|
@ -6594,12 +6639,12 @@ SpellCastResult Spell::CheckRange(bool strict)
|
||||||
// special range cases
|
// special range cases
|
||||||
switch (m_spellInfo->rangeIndex)
|
switch (m_spellInfo->rangeIndex)
|
||||||
{
|
{
|
||||||
// self cast doesn't need range checking -- also for Starshards fix
|
// self cast doesn't need range checking -- also for Starshards fix
|
||||||
// spells that can be cast anywhere also need no check
|
// spells that can be cast anywhere also need no check
|
||||||
case SPELL_RANGE_IDX_SELF_ONLY:
|
case SPELL_RANGE_IDX_SELF_ONLY:
|
||||||
case SPELL_RANGE_IDX_ANYWHERE:
|
case SPELL_RANGE_IDX_ANYWHERE:
|
||||||
return SPELL_CAST_OK;
|
return SPELL_CAST_OK;
|
||||||
// combat range spells are treated differently
|
// combat range spells are treated differently
|
||||||
case SPELL_RANGE_IDX_COMBAT:
|
case SPELL_RANGE_IDX_COMBAT:
|
||||||
{
|
{
|
||||||
if (target)
|
if (target)
|
||||||
|
|
@ -6608,9 +6653,11 @@ SpellCastResult Spell::CheckRange(bool strict)
|
||||||
return SPELL_CAST_OK;
|
return SPELL_CAST_OK;
|
||||||
|
|
||||||
float range_mod = strict ? 0.0f : 5.0f;
|
float range_mod = strict ? 0.0f : 5.0f;
|
||||||
float base = ATTACK_DISTANCE;
|
|
||||||
if (Player* modOwner = m_caster->GetSpellModOwner())
|
if (Player* modOwner = m_caster->GetSpellModOwner())
|
||||||
range_mod += modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, base, this);
|
{
|
||||||
|
float base = ATTACK_DISTANCE;
|
||||||
|
range_mod += modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, base);
|
||||||
|
}
|
||||||
|
|
||||||
// with additional 5 dist for non stricted case (some melee spells have delay in apply
|
// with additional 5 dist for non stricted case (some melee spells have delay in apply
|
||||||
return m_caster->CanReachWithMeleeAttack(target, range_mod) ? SPELL_CAST_OK : SPELL_FAILED_OUT_OF_RANGE;
|
return m_caster->CanReachWithMeleeAttack(target, range_mod) ? SPELL_CAST_OK : SPELL_FAILED_OUT_OF_RANGE;
|
||||||
|
|
@ -6628,7 +6675,7 @@ SpellCastResult Spell::CheckRange(bool strict)
|
||||||
float min_range = GetSpellMinRange(srange, friendly);
|
float min_range = GetSpellMinRange(srange, friendly);
|
||||||
|
|
||||||
if (Player* modOwner = m_caster->GetSpellModOwner())
|
if (Player* modOwner = m_caster->GetSpellModOwner())
|
||||||
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, max_range, this);
|
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RANGE, max_range);
|
||||||
|
|
||||||
if (target && target != m_caster)
|
if (target && target != m_caster)
|
||||||
{
|
{
|
||||||
|
|
@ -7382,16 +7429,22 @@ bool Spell::CheckTarget(Unit* target, SpellEffectIndex eff)
|
||||||
if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// unselectable targets skipped in all cases except TARGET_SCRIPT targeting
|
// unselectable targets skipped in all cases except TARGET_SCRIPT targeting or vehicle passengers
|
||||||
// in case TARGET_SCRIPT target selected by server always and can't be cheated
|
// in case TARGET_SCRIPT target selected by server always and can't be cheated
|
||||||
if ((!m_IsTriggeredSpell || target != m_targets.getUnitTarget()) &&
|
if ((!m_IsTriggeredSpell || target != m_targets.getUnitTarget()) &&
|
||||||
target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE) &&
|
target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE) &&
|
||||||
|
(!target->GetTransportInfo() || (target->GetTransportInfo() &&
|
||||||
|
!((Unit*)target->GetTransportInfo()->GetTransport())->IsVehicle())) &&
|
||||||
spellEffect->EffectImplicitTargetA != TARGET_SCRIPT &&
|
spellEffect->EffectImplicitTargetA != TARGET_SCRIPT &&
|
||||||
spellEffect->EffectImplicitTargetB != TARGET_SCRIPT &&
|
spellEffect->EffectImplicitTargetB != TARGET_SCRIPT &&
|
||||||
spellEffect->EffectImplicitTargetA != TARGET_AREAEFFECT_INSTANT &&
|
spellEffect->EffectImplicitTargetA != TARGET_AREAEFFECT_INSTANT &&
|
||||||
spellEffect->EffectImplicitTargetB != TARGET_AREAEFFECT_INSTANT &&
|
spellEffect->EffectImplicitTargetB != TARGET_AREAEFFECT_INSTANT &&
|
||||||
spellEffect->EffectImplicitTargetA != TARGET_AREAEFFECT_CUSTOM &&
|
spellEffect->EffectImplicitTargetA != TARGET_AREAEFFECT_CUSTOM &&
|
||||||
spellEffect->EffectImplicitTargetB != TARGET_AREAEFFECT_CUSTOM )
|
spellEffect->EffectImplicitTargetB != TARGET_AREAEFFECT_CUSTOM &&
|
||||||
|
spellEffect->EffectImplicitTargetA != TARGET_NARROW_FRONTAL_CONE &&
|
||||||
|
spellEffect->EffectImplicitTargetB != TARGET_NARROW_FRONTAL_CONE &&
|
||||||
|
spellEffect->EffectImplicitTargetA != TARGET_NARROW_FRONTAL_CONE_2 &&
|
||||||
|
spellEffect->EffectImplicitTargetB != TARGET_NARROW_FRONTAL_CONE_2)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7999,15 +8052,21 @@ void Spell::GetSpellRangeAndRadius(SpellEffectEntry const* spellEffect, float& r
|
||||||
case 62577: // Blizzard (Ulduar, Thorim)
|
case 62577: // Blizzard (Ulduar, Thorim)
|
||||||
case 62603: // Blizzard (h) (Ulduar, Thorim)
|
case 62603: // Blizzard (h) (Ulduar, Thorim)
|
||||||
case 62797: // Storm Cloud (Ulduar, Hodir)
|
case 62797: // Storm Cloud (Ulduar, Hodir)
|
||||||
|
case 62978: // Summon Guardian (Ulduar, Yogg Saron)
|
||||||
case 63018: // Searing Light (Ulduar, XT-002)
|
case 63018: // Searing Light (Ulduar, XT-002)
|
||||||
case 63024: // Gravity Bomb (Ulduar, XT-002)
|
case 63024: // Gravity Bomb (Ulduar, XT-002)
|
||||||
case 63545: // Icicle (Ulduar, Hodir)
|
case 63545: // Icicle (Ulduar, Hodir)
|
||||||
|
case 63744: // Sara's Anger (Ulduar, Yogg-Saron)
|
||||||
|
case 63745: // Sara's Blessing (Ulduar, Yogg-Saron)
|
||||||
|
case 63747: // Sara's Fervor (Ulduar, Yogg-Saron)
|
||||||
case 63795: // Psychosis (Ulduar, Yogg-Saron)
|
case 63795: // Psychosis (Ulduar, Yogg-Saron)
|
||||||
case 63820: // Summon Scrap Bot Trigger (Ulduar, Mimiron) use for Scrap Bots, hits npc 33856
|
case 63820: // Summon Scrap Bot Trigger (Ulduar, Mimiron) use for Scrap Bots, hits npc 33856
|
||||||
|
case 63830: // Malady of the Mind (Ulduar, Yogg-Saron)
|
||||||
case 64218: // Overcharge (VoA, Emalon)
|
case 64218: // Overcharge (VoA, Emalon)
|
||||||
case 64234: // Gravity Bomb (h) (Ulduar, XT-002)
|
case 64234: // Gravity Bomb (h) (Ulduar, XT-002)
|
||||||
case 64402: // Rocket Strike (Ulduar, Mimiron)
|
case 64402: // Rocket Strike (Ulduar, Mimiron)
|
||||||
case 64425: // Summon Scrap Bot Trigger (Ulduar, Mimiron) use for Assault Bots, hits npc 33856
|
case 64425: // Summon Scrap Bot Trigger (Ulduar, Mimiron) use for Assault Bots, hits npc 33856
|
||||||
|
case 64465: // Shadow Beacon (Ulduar, Yogg-Saron)
|
||||||
case 64543: // Melt Ice (Ulduar, Hodir)
|
case 64543: // Melt Ice (Ulduar, Hodir)
|
||||||
case 64623: // Frost Bomb (Ulduar, Mimiron)
|
case 64623: // Frost Bomb (Ulduar, Mimiron)
|
||||||
case 65121: // Searing Light (h) (Ulduar, XT-002)
|
case 65121: // Searing Light (h) (Ulduar, XT-002)
|
||||||
|
|
@ -8055,6 +8114,7 @@ void Spell::GetSpellRangeAndRadius(SpellEffectEntry const* spellEffect, float& r
|
||||||
case 10258: // Awaken Vault Warder (Uldaman)
|
case 10258: // Awaken Vault Warder (Uldaman)
|
||||||
case 28542: // Life Drain (Naxx, Sapphiron)
|
case 28542: // Life Drain (Naxx, Sapphiron)
|
||||||
case 62476: // Icicle (Ulduar, Hodir)
|
case 62476: // Icicle (Ulduar, Hodir)
|
||||||
|
case 63802: // Brain Link (Ulduar, Yogg-Saron)
|
||||||
case 66013: // Penetrating Cold (10 man) (ToCrusader, Anub'arak)
|
case 66013: // Penetrating Cold (10 man) (ToCrusader, Anub'arak)
|
||||||
case 67755: // Nerubian Burrower (Mode 1) (ToCrusader, Anub'arak)
|
case 67755: // Nerubian Burrower (Mode 1) (ToCrusader, Anub'arak)
|
||||||
case 67756: // Nerubian Burrower (Mode 2) (ToCrusader, Anub'arak)
|
case 67756: // Nerubian Burrower (Mode 2) (ToCrusader, Anub'arak)
|
||||||
|
|
@ -8243,8 +8303,12 @@ void Spell::GetSpellRangeAndRadius(SpellEffectEntry const* spellEffect, float& r
|
||||||
case 73143: // Bone Spike Graveyard (during Bone Storm) (Icecrown Citadel, Lord Marrowgar encounter, 25N)
|
case 73143: // Bone Spike Graveyard (during Bone Storm) (Icecrown Citadel, Lord Marrowgar encounter, 25N)
|
||||||
case 73144: // Bone Spike Graveyard (during Bone Storm) (Icecrown Citadel, Lord Marrowgar encounter, 10H)
|
case 73144: // Bone Spike Graveyard (during Bone Storm) (Icecrown Citadel, Lord Marrowgar encounter, 10H)
|
||||||
case 73145: // Bone Spike Graveyard (during Bone Storm) (Icecrown Citadel, Lord Marrowgar encounter, 25H)
|
case 73145: // Bone Spike Graveyard (during Bone Storm) (Icecrown Citadel, Lord Marrowgar encounter, 25H)
|
||||||
radius = DEFAULT_VISIBILITY_INSTANCE;
|
case 72350: // Fury of Frostmourne
|
||||||
break;
|
case 72351: // Fury of Frostmourne
|
||||||
|
case 72706: // Achievement Check
|
||||||
|
case 72830: // Achievement Check
|
||||||
|
radius = DEFAULT_VISIBILITY_INSTANCE;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -382,6 +382,8 @@ class Spell
|
||||||
void EffectActivateSpec(SpellEffectEntry const* effect);
|
void EffectActivateSpec(SpellEffectEntry const* effect);
|
||||||
void EffectCancelAura(SpellEffectEntry const* effect);
|
void EffectCancelAura(SpellEffectEntry const* effect);
|
||||||
void EffectKnockBackFromPosition(SpellEffectEntry const* effect);
|
void EffectKnockBackFromPosition(SpellEffectEntry const* effect);
|
||||||
|
void EffectGravityPull(SpellEffectEntry const* effect);
|
||||||
|
void EffectCreateTamedPet(SpellEffectEntry const* effect);
|
||||||
|
|
||||||
Spell(Unit* caster, SpellEntry const* info, bool triggered, ObjectGuid originalCasterGUID = ObjectGuid(), SpellEntry const* triggeredBy = NULL);
|
Spell(Unit* caster, SpellEntry const* info, bool triggered, ObjectGuid originalCasterGUID = ObjectGuid(), SpellEntry const* triggeredBy = NULL);
|
||||||
~Spell();
|
~Spell();
|
||||||
|
|
|
||||||
|
|
@ -52,474 +52,471 @@ enum AuraFlags
|
||||||
*/
|
*/
|
||||||
enum AuraType
|
enum AuraType
|
||||||
{
|
{
|
||||||
SPELL_AURA_NONE = 0,
|
SPELL_AURA_NONE = 0,
|
||||||
SPELL_AURA_BIND_SIGHT = 1,
|
SPELL_AURA_BIND_SIGHT = 1,
|
||||||
SPELL_AURA_MOD_POSSESS = 2,
|
SPELL_AURA_MOD_POSSESS = 2,
|
||||||
/**
|
/**
|
||||||
* The aura should do periodic damage, the function that handles
|
* The aura should do periodic damage, the function that handles
|
||||||
* this is Aura::HandlePeriodicDamage, the amount is usually decided
|
* this is Aura::HandlePeriodicDamage, the amount is usually decided
|
||||||
* by the Unit::SpellDamageBonusDone or Unit::MeleeDamageBonusDone
|
* by the Unit::SpellDamageBonusDone or Unit::MeleeDamageBonusDone
|
||||||
* which increases/decreases the Modifier::m_amount
|
* which increases/decreases the Modifier::m_amount
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_PERIODIC_DAMAGE = 3,
|
SPELL_AURA_PERIODIC_DAMAGE = 3,
|
||||||
/**
|
/**
|
||||||
* Used by Aura::HandleAuraDummy
|
* Used by Aura::HandleAuraDummy
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_DUMMY = 4,
|
SPELL_AURA_DUMMY = 4,
|
||||||
/**
|
/**
|
||||||
* Used by Aura::HandleModConfuse, will either confuse or unconfuse
|
* Used by Aura::HandleModConfuse, will either confuse or unconfuse
|
||||||
* the target depending on whether the apply flag is set
|
* the target depending on whether the apply flag is set
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_MOD_CONFUSE = 5,
|
SPELL_AURA_MOD_CONFUSE = 5,
|
||||||
SPELL_AURA_MOD_CHARM = 6,
|
SPELL_AURA_MOD_CHARM = 6,
|
||||||
SPELL_AURA_MOD_FEAR = 7,
|
SPELL_AURA_MOD_FEAR = 7,
|
||||||
/**
|
/**
|
||||||
* The aura will do periodic heals of a target, handled by
|
* The aura will do periodic heals of a target, handled by
|
||||||
* Aura::HandlePeriodicHeal, uses Unit::SpellHealingBonusDone
|
* Aura::HandlePeriodicHeal, uses Unit::SpellHealingBonusDone
|
||||||
* to calculate whether to increase or decrease Modifier::m_amount
|
* to calculate whether to increase or decrease Modifier::m_amount
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_PERIODIC_HEAL = 8,
|
SPELL_AURA_PERIODIC_HEAL = 8,
|
||||||
/**
|
/**
|
||||||
* Changes the attackspeed, the Modifier::m_amount decides
|
* Changes the attackspeed, the Modifier::m_amount decides
|
||||||
* how much we change in percent, ie, if the m_amount is
|
* how much we change in percent, ie, if the m_amount is
|
||||||
* 50 the attackspeed will increase by 50%
|
* 50 the attackspeed will increase by 50%
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_MOD_ATTACKSPEED = 9,
|
SPELL_AURA_MOD_ATTACKSPEED = 9,
|
||||||
//This doesn't make sense if you look at SpellAuras.cpp:2696
|
|
||||||
//Where a bitwise check is made, but the SpellSchools enum is just
|
|
||||||
//a normal enumeration, not in the style: 1 2 4 8 ...
|
|
||||||
/**
|
/**
|
||||||
* Modifies the threat that the Aura does in percent,
|
* Modifies the threat that the Aura does in percent,
|
||||||
* the Modifier::m_miscvalue decides which of the SpellSchools
|
* the Modifier::m_miscvalue decides which of the SpellSchools
|
||||||
* it should affect threat for.
|
* it should affect threat for.
|
||||||
* \see SpellSchoolMask
|
* \see SpellSchoolMask
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_MOD_THREAT = 10,
|
SPELL_AURA_MOD_THREAT = 10,
|
||||||
/**
|
/**
|
||||||
* Just applies a taunt which will change the threat a mob has
|
* Just applies a taunt which will change the threat a mob has
|
||||||
* Taken care of in Aura::HandleModThreat
|
* Taken care of in Aura::HandleModThreat
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_MOD_TAUNT = 11,
|
SPELL_AURA_MOD_TAUNT = 11,
|
||||||
/**
|
/**
|
||||||
* Stuns targets in different ways, taken care of in
|
* Stuns targets in different ways, taken care of in
|
||||||
* Aura::HandleAuraModStun
|
* Aura::HandleAuraModStun
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_MOD_STUN = 12,
|
SPELL_AURA_MOD_STUN = 12,
|
||||||
/**
|
/**
|
||||||
* Changes the damage done by a weapon in any hand, the Modifier::m_miscvalue
|
* Changes the damage done by a weapon in any hand, the Modifier::m_miscvalue
|
||||||
* will tell what school the damage is from, it's used as a bitmask
|
* will tell what school the damage is from, it's used as a bitmask
|
||||||
* \see SpellSchoolMask
|
* \see SpellSchoolMask
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_MOD_DAMAGE_DONE = 13,
|
SPELL_AURA_MOD_DAMAGE_DONE = 13,
|
||||||
/**
|
/**
|
||||||
* Not handled by the Aura class but instead this is implemented in
|
* Not handled by the Aura class but instead this is implemented in
|
||||||
* Unit::MeleeDamageBonusTaken and Unit::SpellBaseDamageBonusTaken
|
* Unit::MeleeDamageBonusTaken and Unit::SpellBaseDamageBonusTaken
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_MOD_DAMAGE_TAKEN = 14,
|
SPELL_AURA_MOD_DAMAGE_TAKEN = 14,
|
||||||
/**
|
/**
|
||||||
* Not handled by the Aura class, implemented in Unit::DealMeleeDamage
|
* Not handled by the Aura class, implemented in Unit::DealMeleeDamage
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_DAMAGE_SHIELD = 15,
|
SPELL_AURA_DAMAGE_SHIELD = 15,
|
||||||
/**
|
/**
|
||||||
* Taken care of in Aura::HandleModStealth, take note that this
|
* Taken care of in Aura::HandleModStealth, take note that this
|
||||||
* is not the same thing as invisibility
|
* is not the same thing as invisibility
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_MOD_STEALTH = 16,
|
SPELL_AURA_MOD_STEALTH = 16,
|
||||||
/**
|
/**
|
||||||
* Not handled by the Aura class, implemented in Unit::isVisibleForOrDetect
|
* Not handled by the Aura class, implemented in Unit::isVisibleForOrDetect
|
||||||
* which does a lot of checks to determine whether the person is visible or not,
|
* which does a lot of checks to determine whether the person is visible or not,
|
||||||
* the SPELL_AURA_MOD_STEALTH seems to determine how in/visible ie a rogue is.
|
* the SPELL_AURA_MOD_STEALTH seems to determine how in/visible ie a rogue is.
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_MOD_STEALTH_DETECT = 17,
|
SPELL_AURA_MOD_STEALTH_DETECT = 17,
|
||||||
/**
|
/**
|
||||||
* Handled by Aura::HandleInvisibility, the Modifier::m_miscvalue in the struct
|
* Handled by Aura::HandleInvisibility, the Modifier::m_miscvalue in the struct
|
||||||
* seems to decide what kind of invisibility it is with a bitflag. the miscvalue
|
* seems to decide what kind of invisibility it is with a bitflag. the miscvalue
|
||||||
* decides which bit is set, ie: 3 would make the 3rd bit be set.
|
* decides which bit is set, ie: 3 would make the 3rd bit be set.
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_MOD_INVISIBILITY = 18,
|
SPELL_AURA_MOD_INVISIBILITY = 18,
|
||||||
/**
|
/**
|
||||||
* Adds one of the kinds of detections to the possible detections.
|
* Adds one of the kinds of detections to the possible detections.
|
||||||
* As in SPEALL_AURA_MOD_INVISIBILITY the Modifier::m_miscvalue seems to decide
|
* As in SPEALL_AURA_MOD_INVISIBILITY the Modifier::m_miscvalue seems to decide
|
||||||
* what kind of invisibility the Unit should be able to detect.
|
* what kind of invisibility the Unit should be able to detect.
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_MOD_INVISIBILITY_DETECTION = 19,
|
SPELL_AURA_MOD_INVISIBILITY_DETECTION = 19,
|
||||||
SPELL_AURA_OBS_MOD_HEALTH = 20, // 20,21 unofficial
|
SPELL_AURA_OBS_MOD_HEALTH = 20, // 20,21 unofficial
|
||||||
SPELL_AURA_OBS_MOD_MANA = 21,
|
SPELL_AURA_OBS_MOD_MANA = 21,
|
||||||
/**
|
/**
|
||||||
* Handled by Aura::HandleAuraModResistance, changes the resistance for a unit
|
* Handled by Aura::HandleAuraModResistance, changes the resistance for a unit
|
||||||
* the field Modifier::m_miscvalue decides which kind of resistance that should
|
* the field Modifier::m_miscvalue decides which kind of resistance that should
|
||||||
* be changed, for possible values see SpellSchools.
|
* be changed, for possible values see SpellSchools.
|
||||||
* \see SpellSchools
|
* \see SpellSchools
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_MOD_RESISTANCE = 22,
|
SPELL_AURA_MOD_RESISTANCE = 22,
|
||||||
/**
|
/**
|
||||||
* Currently just sets Aura::m_isPeriodic to apply and has a special case
|
* Currently just sets Aura::m_isPeriodic to apply and has a special case
|
||||||
* for Curse of the Plaguebringer.
|
* for Curse of the Plaguebringer.
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_PERIODIC_TRIGGER_SPELL = 23,
|
SPELL_AURA_PERIODIC_TRIGGER_SPELL = 23,
|
||||||
/**
|
/**
|
||||||
* Just sets Aura::m_isPeriodic to apply
|
* Just sets Aura::m_isPeriodic to apply
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_PERIODIC_ENERGIZE = 24,
|
SPELL_AURA_PERIODIC_ENERGIZE = 24,
|
||||||
/**
|
/**
|
||||||
* Changes whether the target is pacified or not depending on the apply flag.
|
* Changes whether the target is pacified or not depending on the apply flag.
|
||||||
* Pacify makes the target silenced and have all it's attack skill disabled.
|
* Pacify makes the target silenced and have all it's attack skill disabled.
|
||||||
* See: http://www.wowhead.com/spell=6462/pacified
|
* See: http://www.wowhead.com/spell=6462/pacified
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_MOD_PACIFY = 25,
|
SPELL_AURA_MOD_PACIFY = 25,
|
||||||
/**
|
/**
|
||||||
* Roots or unroots the target
|
* Roots or unroots the target
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_MOD_ROOT = 26,
|
SPELL_AURA_MOD_ROOT = 26,
|
||||||
/**
|
/**
|
||||||
* Silences the target and stops and spell casts that should be stopped,
|
* Silences the target and stops and spell casts that should be stopped,
|
||||||
* they have the flag SpellPreventionType::SPELL_PREVENTION_TYPE_SILENCE
|
* they have the flag SpellPreventionType::SPELL_PREVENTION_TYPE_SILENCE
|
||||||
*/
|
*/
|
||||||
SPELL_AURA_MOD_SILENCE = 27,
|
SPELL_AURA_MOD_SILENCE = 27,
|
||||||
SPELL_AURA_REFLECT_SPELLS = 28,
|
SPELL_AURA_REFLECT_SPELLS = 28,
|
||||||
SPELL_AURA_MOD_STAT = 29,
|
SPELL_AURA_MOD_STAT = 29,
|
||||||
SPELL_AURA_MOD_SKILL = 30,
|
SPELL_AURA_MOD_SKILL = 30,
|
||||||
SPELL_AURA_MOD_INCREASE_SPEED = 31,
|
SPELL_AURA_MOD_INCREASE_SPEED = 31,
|
||||||
SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED = 32,
|
SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED = 32,
|
||||||
SPELL_AURA_MOD_DECREASE_SPEED = 33,
|
SPELL_AURA_MOD_DECREASE_SPEED = 33,
|
||||||
SPELL_AURA_MOD_INCREASE_HEALTH = 34,
|
SPELL_AURA_MOD_INCREASE_HEALTH = 34,
|
||||||
SPELL_AURA_MOD_INCREASE_ENERGY = 35,
|
SPELL_AURA_MOD_INCREASE_ENERGY = 35,
|
||||||
SPELL_AURA_MOD_SHAPESHIFT = 36,
|
SPELL_AURA_MOD_SHAPESHIFT = 36,
|
||||||
SPELL_AURA_EFFECT_IMMUNITY = 37,
|
SPELL_AURA_EFFECT_IMMUNITY = 37,
|
||||||
SPELL_AURA_STATE_IMMUNITY = 38,
|
SPELL_AURA_STATE_IMMUNITY = 38,
|
||||||
SPELL_AURA_SCHOOL_IMMUNITY = 39,
|
SPELL_AURA_SCHOOL_IMMUNITY = 39,
|
||||||
SPELL_AURA_DAMAGE_IMMUNITY = 40,
|
SPELL_AURA_DAMAGE_IMMUNITY = 40,
|
||||||
SPELL_AURA_DISPEL_IMMUNITY = 41,
|
SPELL_AURA_DISPEL_IMMUNITY = 41,
|
||||||
SPELL_AURA_PROC_TRIGGER_SPELL = 42,
|
SPELL_AURA_PROC_TRIGGER_SPELL = 42,
|
||||||
SPELL_AURA_PROC_TRIGGER_DAMAGE = 43,
|
SPELL_AURA_PROC_TRIGGER_DAMAGE = 43,
|
||||||
SPELL_AURA_TRACK_CREATURES = 44,
|
SPELL_AURA_TRACK_CREATURES = 44,
|
||||||
SPELL_AURA_TRACK_RESOURCES = 45,
|
SPELL_AURA_TRACK_RESOURCES = 45,
|
||||||
SPELL_AURA_46 = 46, // Ignore all Gear test spells
|
SPELL_AURA_46 = 46, // Ignore all Gear test spells
|
||||||
SPELL_AURA_MOD_PARRY_PERCENT = 47,
|
SPELL_AURA_MOD_PARRY_PERCENT = 47,
|
||||||
SPELL_AURA_PERIODIC_TRIGGER_BY_CLIENT = 48, // Client periodic trigger spell by self (3 spells in 3.3.5a)
|
SPELL_AURA_PERIODIC_TRIGGER_BY_CLIENT = 48, // Client periodic trigger spell by self (3 spells in 3.3.5a)
|
||||||
SPELL_AURA_MOD_DODGE_PERCENT = 49,
|
SPELL_AURA_MOD_DODGE_PERCENT = 49,
|
||||||
SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT = 50,
|
SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT = 50,
|
||||||
SPELL_AURA_MOD_BLOCK_CHANCE_PERCENT = 51,
|
SPELL_AURA_MOD_BLOCK_CHANCE_PERCENT = 51,
|
||||||
SPELL_AURA_MOD_CRIT_PERCENT = 52,
|
SPELL_AURA_MOD_CRIT_PERCENT = 52,
|
||||||
SPELL_AURA_PERIODIC_LEECH = 53,
|
SPELL_AURA_PERIODIC_LEECH = 53,
|
||||||
SPELL_AURA_MOD_HIT_CHANCE = 54,
|
SPELL_AURA_MOD_HIT_CHANCE = 54,
|
||||||
SPELL_AURA_MOD_SPELL_HIT_CHANCE = 55,
|
SPELL_AURA_MOD_SPELL_HIT_CHANCE = 55,
|
||||||
SPELL_AURA_TRANSFORM = 56,
|
SPELL_AURA_TRANSFORM = 56,
|
||||||
SPELL_AURA_MOD_SPELL_CRIT_CHANCE = 57,
|
SPELL_AURA_MOD_SPELL_CRIT_CHANCE = 57,
|
||||||
SPELL_AURA_MOD_INCREASE_SWIM_SPEED = 58,
|
SPELL_AURA_MOD_INCREASE_SWIM_SPEED = 58,
|
||||||
SPELL_AURA_MOD_DAMAGE_DONE_CREATURE = 59,
|
SPELL_AURA_MOD_DAMAGE_DONE_CREATURE = 59,
|
||||||
SPELL_AURA_MOD_PACIFY_SILENCE = 60,
|
SPELL_AURA_MOD_PACIFY_SILENCE = 60,
|
||||||
SPELL_AURA_MOD_SCALE = 61,
|
SPELL_AURA_MOD_SCALE = 61,
|
||||||
SPELL_AURA_PERIODIC_HEALTH_FUNNEL = 62,
|
SPELL_AURA_PERIODIC_HEALTH_FUNNEL = 62,
|
||||||
SPELL_AURA_63 = 63, // old SPELL_AURA_PERIODIC_MANA_FUNNEL
|
SPELL_AURA_63 = 63, // old SPELL_AURA_PERIODIC_MANA_FUNNEL
|
||||||
SPELL_AURA_PERIODIC_MANA_LEECH = 64,
|
SPELL_AURA_PERIODIC_MANA_LEECH = 64,
|
||||||
SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK = 65,
|
SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK = 65,
|
||||||
SPELL_AURA_FEIGN_DEATH = 66,
|
SPELL_AURA_FEIGN_DEATH = 66,
|
||||||
SPELL_AURA_MOD_DISARM = 67,
|
SPELL_AURA_MOD_DISARM = 67,
|
||||||
SPELL_AURA_MOD_STALKED = 68,
|
SPELL_AURA_MOD_STALKED = 68,
|
||||||
SPELL_AURA_SCHOOL_ABSORB = 69,
|
SPELL_AURA_SCHOOL_ABSORB = 69,
|
||||||
SPELL_AURA_EXTRA_ATTACKS = 70,
|
SPELL_AURA_EXTRA_ATTACKS = 70,
|
||||||
SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL = 71,
|
SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL = 71,
|
||||||
SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT = 72,
|
SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT = 72,
|
||||||
SPELL_AURA_MOD_POWER_COST_SCHOOL = 73,
|
SPELL_AURA_MOD_POWER_COST_SCHOOL = 73,
|
||||||
SPELL_AURA_REFLECT_SPELLS_SCHOOL = 74,
|
SPELL_AURA_REFLECT_SPELLS_SCHOOL = 74,
|
||||||
SPELL_AURA_MOD_LANGUAGE = 75,
|
SPELL_AURA_MOD_LANGUAGE = 75,
|
||||||
SPELL_AURA_FAR_SIGHT = 76,
|
SPELL_AURA_FAR_SIGHT = 76,
|
||||||
SPELL_AURA_MECHANIC_IMMUNITY = 77,
|
SPELL_AURA_MECHANIC_IMMUNITY = 77,
|
||||||
SPELL_AURA_MOUNTED = 78,
|
SPELL_AURA_MOUNTED = 78,
|
||||||
SPELL_AURA_MOD_DAMAGE_PERCENT_DONE = 79,
|
SPELL_AURA_MOD_DAMAGE_PERCENT_DONE = 79,
|
||||||
SPELL_AURA_MOD_PERCENT_STAT = 80,
|
SPELL_AURA_MOD_PERCENT_STAT = 80,
|
||||||
SPELL_AURA_SPLIT_DAMAGE_PCT = 81,
|
SPELL_AURA_SPLIT_DAMAGE_PCT = 81,
|
||||||
SPELL_AURA_WATER_BREATHING = 82,
|
SPELL_AURA_WATER_BREATHING = 82,
|
||||||
SPELL_AURA_MOD_BASE_RESISTANCE = 83,
|
SPELL_AURA_MOD_BASE_RESISTANCE = 83,
|
||||||
SPELL_AURA_MOD_REGEN = 84,
|
SPELL_AURA_MOD_REGEN = 84,
|
||||||
SPELL_AURA_MOD_POWER_REGEN = 85,
|
SPELL_AURA_MOD_POWER_REGEN = 85,
|
||||||
SPELL_AURA_CHANNEL_DEATH_ITEM = 86,
|
SPELL_AURA_CHANNEL_DEATH_ITEM = 86,
|
||||||
SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN = 87,
|
SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN = 87,
|
||||||
SPELL_AURA_MOD_HEALTH_REGEN_PERCENT = 88,
|
SPELL_AURA_MOD_HEALTH_REGEN_PERCENT = 88,
|
||||||
SPELL_AURA_PERIODIC_DAMAGE_PERCENT = 89,
|
SPELL_AURA_PERIODIC_DAMAGE_PERCENT = 89,
|
||||||
SPELL_AURA_90 = 90, // old SPELL_AURA_MOD_RESIST_CHANCE
|
SPELL_AURA_90 = 90, // old SPELL_AURA_MOD_RESIST_CHANCE
|
||||||
SPELL_AURA_MOD_DETECT_RANGE = 91,
|
SPELL_AURA_MOD_DETECT_RANGE = 91,
|
||||||
SPELL_AURA_PREVENTS_FLEEING = 92,
|
SPELL_AURA_PREVENTS_FLEEING = 92,
|
||||||
SPELL_AURA_MOD_UNATTACKABLE = 93,
|
SPELL_AURA_MOD_UNATTACKABLE = 93,
|
||||||
SPELL_AURA_INTERRUPT_REGEN = 94,
|
SPELL_AURA_INTERRUPT_REGEN = 94,
|
||||||
SPELL_AURA_GHOST = 95,
|
SPELL_AURA_GHOST = 95,
|
||||||
SPELL_AURA_SPELL_MAGNET = 96,
|
SPELL_AURA_SPELL_MAGNET = 96,
|
||||||
SPELL_AURA_MANA_SHIELD = 97,
|
SPELL_AURA_MANA_SHIELD = 97,
|
||||||
SPELL_AURA_MOD_SKILL_TALENT = 98,
|
SPELL_AURA_MOD_SKILL_TALENT = 98,
|
||||||
SPELL_AURA_MOD_ATTACK_POWER = 99,
|
SPELL_AURA_MOD_ATTACK_POWER = 99,
|
||||||
SPELL_AURA_AURAS_VISIBLE = 100,
|
SPELL_AURA_AURAS_VISIBLE = 100,
|
||||||
SPELL_AURA_MOD_RESISTANCE_PCT = 101,
|
SPELL_AURA_MOD_RESISTANCE_PCT = 101,
|
||||||
SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS = 102,
|
SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS = 102,
|
||||||
SPELL_AURA_MOD_TOTAL_THREAT = 103,
|
SPELL_AURA_MOD_TOTAL_THREAT = 103,
|
||||||
SPELL_AURA_WATER_WALK = 104,
|
SPELL_AURA_WATER_WALK = 104,
|
||||||
SPELL_AURA_FEATHER_FALL = 105,
|
SPELL_AURA_FEATHER_FALL = 105,
|
||||||
SPELL_AURA_HOVER = 106,
|
SPELL_AURA_HOVER = 106,
|
||||||
SPELL_AURA_ADD_FLAT_MODIFIER = 107,
|
SPELL_AURA_ADD_FLAT_MODIFIER = 107,
|
||||||
SPELL_AURA_ADD_PCT_MODIFIER = 108,
|
SPELL_AURA_ADD_PCT_MODIFIER = 108,
|
||||||
SPELL_AURA_ADD_TARGET_TRIGGER = 109,
|
SPELL_AURA_ADD_TARGET_TRIGGER = 109,
|
||||||
SPELL_AURA_MOD_POWER_REGEN_PERCENT = 110,
|
SPELL_AURA_MOD_POWER_REGEN_PERCENT = 110,
|
||||||
SPELL_AURA_ADD_CASTER_HIT_TRIGGER = 111,
|
SPELL_AURA_ADD_CASTER_HIT_TRIGGER = 111,
|
||||||
SPELL_AURA_OVERRIDE_CLASS_SCRIPTS = 112,
|
SPELL_AURA_OVERRIDE_CLASS_SCRIPTS = 112,
|
||||||
SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN = 113,
|
SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN = 113,
|
||||||
SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT = 114,
|
SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT = 114,
|
||||||
SPELL_AURA_MOD_HEALING = 115,
|
SPELL_AURA_MOD_HEALING = 115,
|
||||||
SPELL_AURA_MOD_REGEN_DURING_COMBAT = 116,
|
SPELL_AURA_MOD_REGEN_DURING_COMBAT = 116,
|
||||||
SPELL_AURA_MOD_MECHANIC_RESISTANCE = 117,
|
SPELL_AURA_MOD_MECHANIC_RESISTANCE = 117,
|
||||||
SPELL_AURA_MOD_HEALING_PCT = 118,
|
SPELL_AURA_MOD_HEALING_PCT = 118,
|
||||||
SPELL_AURA_119 = 119, // old SPELL_AURA_SHARE_PET_TRACKING
|
SPELL_AURA_119 = 119, // old SPELL_AURA_SHARE_PET_TRACKING
|
||||||
SPELL_AURA_UNTRACKABLE = 120,
|
SPELL_AURA_UNTRACKABLE = 120,
|
||||||
SPELL_AURA_EMPATHY = 121,
|
SPELL_AURA_EMPATHY = 121,
|
||||||
SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT = 122,
|
SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT = 122,
|
||||||
SPELL_AURA_MOD_TARGET_RESISTANCE = 123,
|
SPELL_AURA_MOD_TARGET_RESISTANCE = 123,
|
||||||
SPELL_AURA_MOD_RANGED_ATTACK_POWER = 124,
|
SPELL_AURA_MOD_RANGED_ATTACK_POWER = 124,
|
||||||
SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN = 125,
|
SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN = 125,
|
||||||
SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT = 126,
|
SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT = 126,
|
||||||
SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS = 127,
|
SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS = 127,
|
||||||
SPELL_AURA_MOD_POSSESS_PET = 128,
|
SPELL_AURA_MOD_POSSESS_PET = 128,
|
||||||
SPELL_AURA_MOD_SPEED_ALWAYS = 129,
|
SPELL_AURA_MOD_SPEED_ALWAYS = 129,
|
||||||
SPELL_AURA_MOD_MOUNTED_SPEED_ALWAYS = 130,
|
SPELL_AURA_MOD_MOUNTED_SPEED_ALWAYS = 130,
|
||||||
SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS = 131,
|
SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS = 131,
|
||||||
SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT = 132,
|
SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT = 132,
|
||||||
SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT = 133,
|
SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT = 133,
|
||||||
SPELL_AURA_MOD_MANA_REGEN_INTERRUPT = 134,
|
SPELL_AURA_MOD_MANA_REGEN_INTERRUPT = 134,
|
||||||
SPELL_AURA_MOD_HEALING_DONE = 135,
|
SPELL_AURA_MOD_HEALING_DONE = 135,
|
||||||
SPELL_AURA_MOD_HEALING_DONE_PERCENT = 136,
|
SPELL_AURA_MOD_HEALING_DONE_PERCENT = 136,
|
||||||
SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE = 137,
|
SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE = 137,
|
||||||
SPELL_AURA_MOD_MELEE_HASTE = 138,
|
SPELL_AURA_MOD_MELEE_HASTE = 138,
|
||||||
SPELL_AURA_FORCE_REACTION = 139,
|
SPELL_AURA_FORCE_REACTION = 139,
|
||||||
SPELL_AURA_MOD_RANGED_HASTE = 140,
|
SPELL_AURA_MOD_RANGED_HASTE = 140,
|
||||||
SPELL_AURA_MOD_RANGED_AMMO_HASTE = 141,
|
SPELL_AURA_MOD_RANGED_AMMO_HASTE = 141,
|
||||||
SPELL_AURA_MOD_BASE_RESISTANCE_PCT = 142,
|
SPELL_AURA_MOD_BASE_RESISTANCE_PCT = 142,
|
||||||
SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE = 143,
|
SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE = 143,
|
||||||
SPELL_AURA_SAFE_FALL = 144,
|
SPELL_AURA_SAFE_FALL = 144,
|
||||||
SPELL_AURA_MOD_PET_TALENT_POINTS = 145,
|
SPELL_AURA_MOD_PET_TALENT_POINTS = 145,
|
||||||
SPELL_AURA_ALLOW_TAME_PET_TYPE = 146,
|
SPELL_AURA_ALLOW_TAME_PET_TYPE = 146,
|
||||||
SPELL_AURA_MECHANIC_IMMUNITY_MASK = 147,
|
SPELL_AURA_MECHANIC_IMMUNITY_MASK = 147,
|
||||||
SPELL_AURA_RETAIN_COMBO_POINTS = 148,
|
SPELL_AURA_RETAIN_COMBO_POINTS = 148,
|
||||||
SPELL_AURA_REDUCE_PUSHBACK = 149, // Reduce Pushback
|
SPELL_AURA_REDUCE_PUSHBACK = 149, // Reduce Pushback
|
||||||
SPELL_AURA_MOD_SHIELD_BLOCKDAMAGE = 150,
|
SPELL_AURA_MOD_SHIELD_BLOCKDAMAGE = 150,
|
||||||
SPELL_AURA_TRACK_STEALTHED = 151, // Track Stealthed
|
SPELL_AURA_TRACK_STEALTHED = 151, // Track Stealthed
|
||||||
SPELL_AURA_MOD_DETECTED_RANGE = 152, // Mod Detected Range
|
SPELL_AURA_MOD_DETECTED_RANGE = 152, // Mod Detected Range
|
||||||
SPELL_AURA_153 = 153, // old SPELL_AURA_SPLIT_DAMAGE_FLAT
|
SPELL_AURA_153 = 153, // old SPELL_AURA_SPLIT_DAMAGE_FLAT
|
||||||
SPELL_AURA_MOD_STEALTH_LEVEL = 154, // Stealth Level Modifier
|
SPELL_AURA_MOD_STEALTH_LEVEL = 154, // Stealth Level Modifier
|
||||||
SPELL_AURA_MOD_WATER_BREATHING = 155, // Mod Water Breathing
|
SPELL_AURA_MOD_WATER_BREATHING = 155, // Mod Water Breathing
|
||||||
SPELL_AURA_MOD_REPUTATION_GAIN = 156, // Mod Reputation Gain
|
SPELL_AURA_MOD_REPUTATION_GAIN = 156, // Mod Reputation Gain
|
||||||
SPELL_AURA_PET_DAMAGE_MULTI = 157, // Mod Pet Damage
|
SPELL_AURA_PET_DAMAGE_MULTI = 157, // Mod Pet Damage
|
||||||
SPELL_AURA_MOD_SHIELD_BLOCKVALUE = 158,
|
SPELL_AURA_MOD_SHIELD_BLOCKVALUE = 158,
|
||||||
SPELL_AURA_NO_PVP_CREDIT = 159,
|
SPELL_AURA_NO_PVP_CREDIT = 159,
|
||||||
SPELL_AURA_160 = 160, // old SPELL_AURA_MOD_AOE_AVOIDANCE
|
SPELL_AURA_160 = 160, // old SPELL_AURA_MOD_AOE_AVOIDANCE
|
||||||
SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT = 161,
|
SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT = 161,
|
||||||
SPELL_AURA_POWER_BURN_MANA = 162,
|
SPELL_AURA_POWER_BURN_MANA = 162,
|
||||||
SPELL_AURA_MOD_CRIT_DAMAGE_BONUS = 163,
|
SPELL_AURA_MOD_CRIT_DAMAGE_BONUS = 163,
|
||||||
SPELL_AURA_164 = 164,
|
SPELL_AURA_164 = 164,
|
||||||
SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS = 165,
|
SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS = 165,
|
||||||
SPELL_AURA_MOD_ATTACK_POWER_PCT = 166,
|
SPELL_AURA_MOD_ATTACK_POWER_PCT = 166,
|
||||||
SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT = 167,
|
SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT = 167,
|
||||||
SPELL_AURA_MOD_DAMAGE_DONE_VERSUS = 168,
|
SPELL_AURA_MOD_DAMAGE_DONE_VERSUS = 168,
|
||||||
SPELL_AURA_169 = 169, // old SPELL_AURA_MOD_CRIT_PERCENT_VERSUS
|
SPELL_AURA_169 = 169, // old SPELL_AURA_MOD_CRIT_PERCENT_VERSUS
|
||||||
SPELL_AURA_DETECT_AMORE = 170,
|
SPELL_AURA_DETECT_AMORE = 170,
|
||||||
SPELL_AURA_MOD_SPEED_NOT_STACK = 171,
|
SPELL_AURA_MOD_SPEED_NOT_STACK = 171,
|
||||||
SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK = 172,
|
SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK = 172,
|
||||||
SPELL_AURA_173 = 173, // old SPELL_AURA_ALLOW_CHAMPION_SPELLS
|
SPELL_AURA_173 = 173, // old SPELL_AURA_ALLOW_CHAMPION_SPELLS
|
||||||
SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT = 174, // by defeult intelect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT
|
SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT = 174, // by defeult intelect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT
|
||||||
SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT = 175,
|
SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT = 175,
|
||||||
SPELL_AURA_SPIRIT_OF_REDEMPTION = 176,
|
SPELL_AURA_SPIRIT_OF_REDEMPTION = 176,
|
||||||
SPELL_AURA_AOE_CHARM = 177,
|
SPELL_AURA_AOE_CHARM = 177,
|
||||||
SPELL_AURA_178 = 178, // old SPELL_AURA_MOD_DEBUFF_RESISTANCE
|
SPELL_AURA_178 = 178, // old SPELL_AURA_MOD_DEBUFF_RESISTANCE
|
||||||
SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE = 179,
|
SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE = 179,
|
||||||
SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS = 180,
|
SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS = 180,
|
||||||
SPELL_AURA_181 = 181, // old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS - possible flat spell crit damage versus
|
SPELL_AURA_181 = 181, // old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS - possible flat spell crit damage versus
|
||||||
SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT = 182,
|
SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT = 182,
|
||||||
SPELL_AURA_MOD_CRITICAL_THREAT = 183,
|
SPELL_AURA_MOD_CRITICAL_THREAT = 183,
|
||||||
SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE = 184,
|
SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE = 184,
|
||||||
SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE = 185,
|
SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE = 185,
|
||||||
SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE = 186,
|
SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE = 186,
|
||||||
SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE = 187,
|
SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE = 187,
|
||||||
SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE = 188,
|
SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE = 188,
|
||||||
SPELL_AURA_MOD_RATING = 189,
|
SPELL_AURA_MOD_RATING = 189,
|
||||||
SPELL_AURA_MOD_FACTION_REPUTATION_GAIN = 190,
|
SPELL_AURA_MOD_FACTION_REPUTATION_GAIN = 190,
|
||||||
SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED = 191,
|
SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED = 191,
|
||||||
SPELL_AURA_MOD_MELEE_RANGED_HASTE = 192,
|
SPELL_AURA_MOD_MELEE_RANGED_HASTE = 192,
|
||||||
SPELL_AURA_HASTE_ALL = 193,
|
SPELL_AURA_HASTE_ALL = 193,
|
||||||
SPELL_AURA_MOD_IGNORE_ABSORB_SCHOOL = 194,
|
SPELL_AURA_MOD_IGNORE_ABSORB_SCHOOL = 194,
|
||||||
SPELL_AURA_MOD_IGNORE_ABSORB_FOR_SPELL = 195,
|
SPELL_AURA_MOD_IGNORE_ABSORB_FOR_SPELL = 195,
|
||||||
SPELL_AURA_MOD_COOLDOWN = 196, // only 24818 Noxious Breath
|
SPELL_AURA_MOD_COOLDOWN = 196, // only 24818 Noxious Breath
|
||||||
SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE = 197,
|
SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE = 197,
|
||||||
SPELL_AURA_198 = 198, // old SPELL_AURA_MOD_ALL_WEAPON_SKILLS
|
SPELL_AURA_198 = 198, // old SPELL_AURA_MOD_ALL_WEAPON_SKILLS
|
||||||
SPELL_AURA_199 = 199, // old SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT
|
SPELL_AURA_199 = 199, // old SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT
|
||||||
SPELL_AURA_MOD_KILL_XP_PCT = 200,
|
SPELL_AURA_MOD_KILL_XP_PCT = 200,
|
||||||
SPELL_AURA_FLY = 201,
|
SPELL_AURA_FLY = 201,
|
||||||
SPELL_AURA_IGNORE_COMBAT_RESULT = 202,
|
SPELL_AURA_IGNORE_COMBAT_RESULT = 202,
|
||||||
SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE = 203,
|
SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE = 203,
|
||||||
SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE = 204,
|
SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE = 204,
|
||||||
SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_DAMAGE = 205,
|
SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_DAMAGE = 205,
|
||||||
SPELL_AURA_MOD_FLIGHT_SPEED = 206,
|
SPELL_AURA_MOD_FLIGHT_SPEED = 206,
|
||||||
SPELL_AURA_MOD_FLIGHT_SPEED_MOUNTED = 207,
|
SPELL_AURA_MOD_FLIGHT_SPEED_MOUNTED = 207,
|
||||||
SPELL_AURA_MOD_FLIGHT_SPEED_STACKING = 208,
|
SPELL_AURA_MOD_FLIGHT_SPEED_STACKING = 208,
|
||||||
SPELL_AURA_MOD_FLIGHT_SPEED_MOUNTED_STACKING = 209,
|
SPELL_AURA_MOD_FLIGHT_SPEED_MOUNTED_STACKING = 209,
|
||||||
SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACKING = 210,
|
SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACKING = 210,
|
||||||
SPELL_AURA_MOD_FLIGHT_SPEED_MOUNTED_NOT_STACKING = 211,
|
SPELL_AURA_MOD_FLIGHT_SPEED_MOUNTED_NOT_STACKING = 211,
|
||||||
SPELL_AURA_212 = 212, // old SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT
|
SPELL_AURA_212 = 212, // old SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT
|
||||||
SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT = 213,
|
SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT = 213,
|
||||||
SPELL_AURA_214 = 214,
|
SPELL_AURA_214 = 214,
|
||||||
SPELL_AURA_ARENA_PREPARATION = 215,
|
SPELL_AURA_ARENA_PREPARATION = 215,
|
||||||
SPELL_AURA_HASTE_SPELLS = 216,
|
SPELL_AURA_HASTE_SPELLS = 216,
|
||||||
SPELL_AURA_217 = 217,
|
SPELL_AURA_217 = 217,
|
||||||
SPELL_AURA_HASTE_RANGED = 218,
|
SPELL_AURA_HASTE_RANGED = 218,
|
||||||
SPELL_AURA_MOD_MANA_REGEN_FROM_STAT = 219,
|
SPELL_AURA_MOD_MANA_REGEN_FROM_STAT = 219,
|
||||||
SPELL_AURA_MOD_RATING_FROM_STAT = 220,
|
SPELL_AURA_MOD_RATING_FROM_STAT = 220,
|
||||||
SPELL_AURA_IGNORED = 221,
|
SPELL_AURA_IGNORED = 221,
|
||||||
SPELL_AURA_222 = 222,
|
SPELL_AURA_222 = 222,
|
||||||
SPELL_AURA_223 = 223,
|
SPELL_AURA_223 = 223,
|
||||||
SPELL_AURA_224 = 224,
|
SPELL_AURA_224 = 224,
|
||||||
SPELL_AURA_PRAYER_OF_MENDING = 225,
|
SPELL_AURA_PRAYER_OF_MENDING = 225,
|
||||||
SPELL_AURA_PERIODIC_DUMMY = 226,
|
SPELL_AURA_PERIODIC_DUMMY = 226,
|
||||||
SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE = 227,
|
SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE = 227,
|
||||||
SPELL_AURA_DETECT_STEALTH = 228,
|
SPELL_AURA_DETECT_STEALTH = 228,
|
||||||
SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE = 229,
|
SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE = 229,
|
||||||
SPELL_AURA_230 = 230,
|
SPELL_AURA_230 = 230,
|
||||||
SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE = 231,
|
SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE = 231,
|
||||||
SPELL_AURA_MECHANIC_DURATION_MOD = 232,
|
SPELL_AURA_MECHANIC_DURATION_MOD = 232,
|
||||||
SPELL_AURA_233 = 233,
|
SPELL_AURA_233 = 233,
|
||||||
SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK = 234,
|
SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK = 234,
|
||||||
SPELL_AURA_MOD_DISPEL_RESIST = 235,
|
SPELL_AURA_MOD_DISPEL_RESIST = 235,
|
||||||
SPELL_AURA_CONTROL_VEHICLE = 236,
|
SPELL_AURA_CONTROL_VEHICLE = 236,
|
||||||
SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER = 237,
|
SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER = 237,
|
||||||
SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER = 238,
|
SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER = 238,
|
||||||
SPELL_AURA_MOD_SCALE_2 = 239,
|
SPELL_AURA_MOD_SCALE_2 = 239,
|
||||||
SPELL_AURA_MOD_EXPERTISE = 240,
|
SPELL_AURA_MOD_EXPERTISE = 240,
|
||||||
SPELL_AURA_FORCE_MOVE_FORWARD = 241,
|
SPELL_AURA_FORCE_MOVE_FORWARD = 241,
|
||||||
SPELL_AURA_MOD_SPELL_DAMAGE_FROM_HEALING = 242,
|
SPELL_AURA_MOD_SPELL_DAMAGE_FROM_HEALING = 242,
|
||||||
SPELL_AURA_243 = 243,
|
SPELL_AURA_FACTION_OVERRIDE = 243,
|
||||||
SPELL_AURA_COMPREHEND_LANGUAGE = 244,
|
SPELL_AURA_COMPREHEND_LANGUAGE = 244,
|
||||||
SPELL_AURA_MOD_DURATION_OF_MAGIC_EFFECTS = 245,
|
SPELL_AURA_MOD_DURATION_OF_MAGIC_EFFECTS = 245,
|
||||||
SPELL_AURA_MOD_DURATION_OF_EFFECTS_BY_DISPEL = 246,
|
SPELL_AURA_MOD_DURATION_OF_EFFECTS_BY_DISPEL = 246,
|
||||||
SPELL_AURA_MIRROR_IMAGE = 247,
|
SPELL_AURA_MIRROR_IMAGE = 247,
|
||||||
SPELL_AURA_MOD_COMBAT_RESULT_CHANCE = 248,
|
SPELL_AURA_MOD_COMBAT_RESULT_CHANCE = 248,
|
||||||
SPELL_AURA_CONVERT_RUNE = 249,
|
SPELL_AURA_CONVERT_RUNE = 249,
|
||||||
SPELL_AURA_MOD_INCREASE_HEALTH_2 = 250,
|
SPELL_AURA_MOD_INCREASE_HEALTH_2 = 250,
|
||||||
SPELL_AURA_MOD_ENEMY_DODGE = 251,
|
SPELL_AURA_MOD_ENEMY_DODGE = 251,
|
||||||
SPELL_AURA_SLOW_ALL = 252,
|
SPELL_AURA_SLOW_ALL = 252,
|
||||||
SPELL_AURA_MOD_BLOCK_CRIT_CHANCE = 253,
|
SPELL_AURA_MOD_BLOCK_CRIT_CHANCE = 253,
|
||||||
SPELL_AURA_MOD_DISARM_OFFHAND = 254,
|
SPELL_AURA_MOD_DISARM_OFFHAND = 254,
|
||||||
SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT = 255,
|
SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT = 255,
|
||||||
SPELL_AURA_NO_REAGENT_USE = 256,
|
SPELL_AURA_NO_REAGENT_USE = 256,
|
||||||
SPELL_AURA_MOD_TARGET_RESIST_BY_SPELL_CLASS = 257,
|
SPELL_AURA_MOD_TARGET_RESIST_BY_SPELL_CLASS = 257,
|
||||||
SPELL_AURA_258 = 258,
|
SPELL_AURA_258 = 258,
|
||||||
SPELL_AURA_259 = 259, // old SPELL_AURA_MOD_PERIODIC_HEAL
|
SPELL_AURA_259 = 259, // old SPELL_AURA_MOD_PERIODIC_HEAL
|
||||||
SPELL_AURA_SCREEN_EFFECT = 260,
|
SPELL_AURA_SCREEN_EFFECT = 260,
|
||||||
SPELL_AURA_PHASE = 261,
|
SPELL_AURA_PHASE = 261,
|
||||||
SPELL_AURA_IGNORE_UNIT_STATE = 262,
|
SPELL_AURA_IGNORE_UNIT_STATE = 262,
|
||||||
SPELL_AURA_ALLOW_ONLY_ABILITY = 263,
|
SPELL_AURA_ALLOW_ONLY_ABILITY = 263,
|
||||||
SPELL_AURA_264 = 264,
|
SPELL_AURA_264 = 264,
|
||||||
SPELL_AURA_265 = 265,
|
SPELL_AURA_265 = 265,
|
||||||
SPELL_AURA_266 = 266,
|
SPELL_AURA_266 = 266,
|
||||||
SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL = 267,
|
SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL = 267,
|
||||||
SPELL_AURA_268 = 268, // old SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT
|
SPELL_AURA_268 = 268, // old SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT
|
||||||
SPELL_AURA_MOD_IGNORE_DAMAGE_REDUCTION_SCHOOL = 269,
|
SPELL_AURA_MOD_IGNORE_DAMAGE_REDUCTION_SCHOOL = 269,
|
||||||
SPELL_AURA_270 = 270, // old SPELL_AURA_MOD_IGNORE_TARGET_RESIST
|
SPELL_AURA_270 = 270, // old SPELL_AURA_MOD_IGNORE_TARGET_RESIST
|
||||||
SPELL_AURA_MOD_DAMAGE_FROM_CASTER = 271,
|
SPELL_AURA_MOD_DAMAGE_FROM_CASTER = 271,
|
||||||
SPELL_AURA_MAELSTROM_WEAPON = 272,
|
SPELL_AURA_MAELSTROM_WEAPON = 272,
|
||||||
SPELL_AURA_X_RAY = 273,
|
SPELL_AURA_X_RAY = 273,
|
||||||
SPELL_AURA_274 = 274,
|
SPELL_AURA_274 = 274,
|
||||||
SPELL_AURA_MOD_IGNORE_SHAPESHIFT = 275,
|
SPELL_AURA_MOD_IGNORE_SHAPESHIFT = 275,
|
||||||
SPELL_AURA_MOD_DAMAGE_DONE_BY_MECHANIC = 276,
|
SPELL_AURA_MOD_DAMAGE_DONE_BY_MECHANIC = 276,
|
||||||
SPELL_AURA_277 = 277, // SPELL_AURA_MOD_MAX_AFFECTED_TARGETS
|
SPELL_AURA_277 = 277, // SPELL_AURA_MOD_MAX_AFFECTED_TARGETS
|
||||||
SPELL_AURA_MOD_DISARM_RANGED = 278,
|
SPELL_AURA_MOD_DISARM_RANGED = 278,
|
||||||
SPELL_AURA_INITIALIZE_IMAGES = 279,
|
SPELL_AURA_MIRROR_NAME = 279,
|
||||||
SPELL_AURA_280 = 280, // old SPELL_AURA_MOD_TARGET_ARMOR_PCT
|
SPELL_AURA_280 = 280, // old SPELL_AURA_MOD_TARGET_ARMOR_PCT
|
||||||
SPELL_AURA_MOD_HONOR_GAIN = 281,
|
SPELL_AURA_MOD_HONOR_GAIN = 281,
|
||||||
SPELL_AURA_MOD_BASE_HEALTH_PCT = 282,
|
SPELL_AURA_MOD_BASE_HEALTH_PCT = 282,
|
||||||
SPELL_AURA_MOD_HEALING_RECEIVED = 283, // Possibly only for some spell family class spells
|
SPELL_AURA_MOD_HEALING_RECEIVED = 283, // Possibly only for some spell family class spells
|
||||||
SPELL_AURA_284 = 284,
|
SPELL_AURA_TRIGGER_LINKED_AURA = 284,
|
||||||
SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR = 285,
|
SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR = 285,
|
||||||
SPELL_AURA_ABILITY_PERIODIC_CRIT = 286,
|
SPELL_AURA_ABILITY_PERIODIC_CRIT = 286,
|
||||||
SPELL_AURA_DEFLECT_SPELLS = 287,
|
SPELL_AURA_DEFLECT_SPELLS = 287,
|
||||||
SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT = 288,
|
SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT = 288,
|
||||||
SPELL_AURA_289 = 289,
|
SPELL_AURA_289 = 289,
|
||||||
SPELL_AURA_MOD_ALL_CRIT_CHANCE = 290,
|
SPELL_AURA_MOD_ALL_CRIT_CHANCE = 290,
|
||||||
SPELL_AURA_MOD_QUEST_XP_PCT = 291,
|
SPELL_AURA_MOD_QUEST_XP_PCT = 291,
|
||||||
SPELL_AURA_OPEN_STABLE = 292,
|
SPELL_AURA_OPEN_STABLE = 292,
|
||||||
SPELL_AURA_ADD_MECHANIC_ABILITIES = 293,
|
SPELL_AURA_ADD_MECHANIC_ABILITIES = 293,
|
||||||
SPELL_AURA_STOP_NATURAL_MANA_REGEN = 294,
|
SPELL_AURA_STOP_NATURAL_MANA_REGEN = 294,
|
||||||
SPELL_AURA_295 = 295,
|
SPELL_AURA_295 = 295,
|
||||||
SPELL_AURA_SET_VEHICLE_ID = 296,
|
SPELL_AURA_SET_VEHICLE_ID = 296,
|
||||||
SPELL_AURA_297 = 297,
|
SPELL_AURA_297 = 297,
|
||||||
SPELL_AURA_298 = 298,
|
SPELL_AURA_298 = 298,
|
||||||
SPELL_AURA_299 = 299,
|
SPELL_AURA_299 = 299,
|
||||||
SPELL_AURA_SHARE_DAMAGE_PCT = 300,
|
SPELL_AURA_SHARE_DAMAGE_PCT = 300,
|
||||||
SPELL_AURA_HEAL_ABSORB = 301,
|
SPELL_AURA_HEAL_ABSORB = 301,
|
||||||
SPELL_AURA_302 = 302,
|
SPELL_AURA_302 = 302,
|
||||||
SPELL_AURA_MOD_DAMAGE_DONE_VERSUS_AURASTATE = 303,
|
SPELL_AURA_MOD_DAMAGE_DONE_VERSUS_AURASTATE = 303,
|
||||||
SPELL_AURA_FAKE_INEBRIATE = 304,
|
SPELL_AURA_FAKE_INEBRIATE = 304,
|
||||||
SPELL_AURA_MOD_MINIMUM_SPEED = 305,
|
SPELL_AURA_MOD_MINIMUM_SPEED = 305,
|
||||||
SPELL_AURA_306 = 306,
|
SPELL_AURA_306 = 306,
|
||||||
SPELL_AURA_307 = 307,
|
SPELL_AURA_307 = 307,
|
||||||
SPELL_AURA_MOD_CRIT_FROM_CASTER = 308,
|
SPELL_AURA_MOD_CRIT_FROM_CASTER = 308,
|
||||||
SPELL_AURA_309 = 309,
|
SPELL_AURA_309 = 309,
|
||||||
SPELL_AURA_MOD_PET_AOE_DAMAGE_AVOIDANCE = 310,
|
SPELL_AURA_MOD_PET_AOE_DAMAGE_AVOIDANCE = 310,
|
||||||
SPELL_AURA_311 = 311,
|
SPELL_AURA_311 = 311,
|
||||||
SPELL_AURA_312 = 312,
|
SPELL_AURA_312 = 312,
|
||||||
SPELL_AURA_313 = 313,
|
SPELL_AURA_313 = 313,
|
||||||
SPELL_AURA_PREVENT_RESURRECTION = 314,
|
SPELL_AURA_PREVENT_RESURRECTION = 314,
|
||||||
SPELL_AURA_UNDERWATER_WALKING = 315,
|
SPELL_AURA_UNDERWATER_WALKING = 315,
|
||||||
SPELL_AURA_316 = 316, // old SPELL_AURA_MOD_PERIODIC_HASTE
|
SPELL_AURA_316 = 316, // old SPELL_AURA_MOD_PERIODIC_HASTE
|
||||||
SPELL_AURA_MOD_INCREASE_SPELL_POWER_PCT = 317,
|
SPELL_AURA_MOD_INCREASE_SPELL_POWER_PCT = 317,
|
||||||
SPELL_AURA_MASTERY = 318,
|
SPELL_AURA_MASTERY = 318,
|
||||||
SPELL_AURA_MOD_MELEE_ATTACK_SPEED = 319,
|
SPELL_AURA_MOD_MELEE_ATTACK_SPEED = 319,
|
||||||
SPELL_AURA_MOD_RANGED_ATTACK_SPEED = 320,
|
SPELL_AURA_MOD_RANGED_ATTACK_SPEED = 320,
|
||||||
SPELL_AURA_321 = 321,
|
SPELL_AURA_321 = 321,
|
||||||
SPELL_AURA_INTERFERE_TARGETING = 322,
|
SPELL_AURA_INTERFERE_TARGETING = 322,
|
||||||
SPELL_AURA_323 = 323,
|
SPELL_AURA_323 = 323,
|
||||||
SPELL_AURA_324 = 324,
|
SPELL_AURA_324 = 324,
|
||||||
SPELL_AURA_325 = 325,
|
SPELL_AURA_325 = 325,
|
||||||
SPELL_AURA_PHASE_2 = 326,
|
SPELL_AURA_PHASE_2 = 326,
|
||||||
SPELL_AURA_327 = 327,
|
SPELL_AURA_327 = 327,
|
||||||
SPELL_AURA_PROC_ON_POWER_AMOUNT = 328,
|
SPELL_AURA_PROC_ON_POWER_AMOUNT = 328,
|
||||||
SPELL_AURA_MOD_RUNIC_POWER_REGEN = 329,
|
SPELL_AURA_MOD_RUNIC_POWER_REGEN = 329,
|
||||||
SPELL_AURA_ALLOW_CAST_WHILE_MOVING = 330,
|
SPELL_AURA_ALLOW_CAST_WHILE_MOVING = 330,
|
||||||
SPELL_AURA_MOD_WEATHER = 331,
|
SPELL_AURA_MOD_WEATHER = 331,
|
||||||
SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS = 332,
|
SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS = 332,
|
||||||
SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 = 333,
|
SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 = 333,
|
||||||
SPELL_AURA_BLIND_SIGHT = 334,
|
SPELL_AURA_BLIND_SIGHT = 334,
|
||||||
SPELL_AURA_SEE_WHILE_INVISIBLE = 335,
|
SPELL_AURA_SEE_WHILE_INVISIBLE = 335,
|
||||||
SPELL_AURA_FLIGHT_RESTRICTIONS = 336,
|
SPELL_AURA_FLIGHT_RESTRICTIONS = 336,
|
||||||
SPELL_AURA_MOD_VENDOR_PRICE = 337,
|
SPELL_AURA_MOD_VENDOR_PRICE = 337,
|
||||||
SPELL_AURA_MOD_DURABILITY_LOSS = 338,
|
SPELL_AURA_MOD_DURABILITY_LOSS = 338,
|
||||||
SPELL_AURA_MOD_SKILLCHANCE = 339,
|
SPELL_AURA_MOD_SKILLCHANCE = 339,
|
||||||
SPELL_AURA_MOD_RESSURECTED_HEALTH = 340,
|
SPELL_AURA_MOD_RESSURECTED_HEALTH = 340,
|
||||||
SPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN = 341,
|
SPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN = 341,
|
||||||
SPELL_AURA_MOD_ATTACKSPEED_2 = 342,
|
SPELL_AURA_MOD_ATTACKSPEED_2 = 342,
|
||||||
SPELL_AURA_MOD_ALL_DAMAGE_FROM_CASTER = 343,
|
SPELL_AURA_MOD_ALL_DAMAGE_FROM_CASTER = 343,
|
||||||
SPELL_AURA_MOD_AUTOATTACK_DAMAGE = 344,
|
SPELL_AURA_MOD_AUTOATTACK_DAMAGE = 344,
|
||||||
SPELL_AURA_MOD_IGNORE_ARMOR_PCT = 345,
|
SPELL_AURA_MOD_IGNORE_ARMOR_PCT = 345,
|
||||||
SPELL_AURA_ALT_POWER_INDICATOR = 346,
|
SPELL_AURA_ALT_POWER_INDICATOR = 346,
|
||||||
SPELL_AURA_MOD_CD_FROM_HASTE = 347,
|
SPELL_AURA_MOD_CD_FROM_HASTE = 347,
|
||||||
SPELL_AURA_MOD_MONEY_TO_GUILD_BANK = 348,
|
SPELL_AURA_MOD_MONEY_TO_GUILD_BANK = 348,
|
||||||
SPELL_AURA_MOD_CURRENCY_GAIN = 349,
|
SPELL_AURA_MOD_CURRENCY_GAIN = 349,
|
||||||
SPELL_AURA_MOD_ITEM_LOOT = 350,
|
SPELL_AURA_MOD_ITEM_LOOT = 350,
|
||||||
SPELL_AURA_MOD_CURRENCY_LOOT = 351,
|
SPELL_AURA_MOD_CURRENCY_LOOT = 351,
|
||||||
SPELL_AURA_ALLOW_WORGEN_TRANSFORM = 352,
|
SPELL_AURA_ALLOW_WORGEN_TRANSFORM = 352,
|
||||||
SPELL_AURA_CAMOUFLAGE = 353,
|
SPELL_AURA_CAMOUFLAGE = 353,
|
||||||
SPELL_AURA_MOD_HEALING_DONE_FROM_PCT_HEALTH = 354,
|
SPELL_AURA_MOD_HEALING_DONE_FROM_PCT_HEALTH = 354,
|
||||||
SPELL_AURA_355 = 355,
|
SPELL_AURA_355 = 355,
|
||||||
SPELL_AURA_MOD_DAMAGE_DONE_FROM_PCT_POWER = 356,
|
SPELL_AURA_MOD_DAMAGE_DONE_FROM_PCT_POWER = 356,
|
||||||
SPELL_AURA_357 = 357,
|
SPELL_AURA_357 = 357,
|
||||||
SPELL_AURA_WORGEN_TRANSFORM = 358,
|
SPELL_AURA_WORGEN_TRANSFORM = 358,
|
||||||
SPELL_AURA_359 = 359,
|
SPELL_AURA_359 = 359,
|
||||||
SPELL_AURA_PROC_DUPLICATE_SPELLS = 360,
|
SPELL_AURA_PROC_DUPLICATE_SPELLS = 360,
|
||||||
SPELL_AURA_PROC_TRIGGER_SPELL_2 = 361,
|
SPELL_AURA_PROC_TRIGGER_SPELL_2 = 361,
|
||||||
SPELL_AURA_362 = 362,
|
SPELL_AURA_362 = 362,
|
||||||
SPELL_AURA_363 = 363,
|
SPELL_AURA_363 = 363,
|
||||||
SPELL_AURA_364 = 364,
|
SPELL_AURA_364 = 364,
|
||||||
SPELL_AURA_365 = 365,
|
SPELL_AURA_365 = 365,
|
||||||
SPELL_AURA_OVERRIDE_SPELL_POWER_BY_AP_PCT = 366,
|
SPELL_AURA_OVERRIDE_SPELL_POWER_BY_AP_PCT = 366,
|
||||||
SPELL_AURA_367 = 367,
|
SPELL_AURA_367 = 367,
|
||||||
SPELL_AURA_368 = 368,
|
SPELL_AURA_368 = 368,
|
||||||
SPELL_AURA_369 = 369,
|
SPELL_AURA_369 = 369,
|
||||||
SPELL_AURA_370 = 370,
|
SPELL_AURA_370 = 370,
|
||||||
TOTAL_AURAS = 371,
|
TOTAL_AURAS = 371,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum AreaAuraType
|
enum AreaAuraType
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -414,6 +414,10 @@ class Aura
|
||||||
void HandleAuraModBlockCritChance(bool apply, bool Real);
|
void HandleAuraModBlockCritChance(bool apply, bool Real);
|
||||||
void HandleModIncreaseSpellPowerPct(bool apply, bool Real);
|
void HandleModIncreaseSpellPowerPct(bool apply, bool Real);
|
||||||
void HandleOverrideSpellPowerByAp(bool apply, bool Real);
|
void HandleOverrideSpellPowerByAp(bool apply, bool Real);
|
||||||
|
void HandleMirrorName(bool apply, bool Real);
|
||||||
|
void HandlePreventResurrection(bool apply, bool Real);
|
||||||
|
void HandleFactionOverride(bool apply, bool Real);
|
||||||
|
void HandleTriggerLinkedAura(bool apply, bool Real);
|
||||||
|
|
||||||
virtual ~Aura();
|
virtual ~Aura();
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue