Merge branch 'azerothcore:master' into Playerbot
This commit is contained in:
@@ -37,6 +37,13 @@ namespace VMAP
|
||||
VMAP_LOAD_RESULT_IGNORED
|
||||
};
|
||||
|
||||
enum class LoadResult : uint8
|
||||
{
|
||||
Success,
|
||||
FileNotFound,
|
||||
VersionMismatch
|
||||
};
|
||||
|
||||
#define VMAP_INVALID_HEIGHT -100000.0f // for check
|
||||
#define VMAP_INVALID_HEIGHT_VALUE -200000.0f // real assigned value in unknown height case
|
||||
|
||||
@@ -79,7 +86,7 @@ namespace VMAP
|
||||
|
||||
virtual int loadMap(const char* pBasePath, unsigned int pMapId, int x, int y) = 0;
|
||||
|
||||
virtual bool existsMap(const char* pBasePath, unsigned int pMapId, int x, int y) = 0;
|
||||
virtual LoadResult existsMap(const char* pBasePath, unsigned int pMapId, int x, int y) = 0;
|
||||
|
||||
virtual void unloadMap(unsigned int pMapId, int x, int y) = 0;
|
||||
virtual void unloadMap(unsigned int pMapId) = 0;
|
||||
|
||||
@@ -379,7 +379,7 @@ namespace VMAP
|
||||
}
|
||||
}
|
||||
|
||||
bool VMapMgr2::existsMap(const char* basePath, unsigned int mapId, int x, int y)
|
||||
LoadResult VMapMgr2::existsMap(const char* basePath, unsigned int mapId, int x, int y)
|
||||
{
|
||||
return StaticMapTree::CanLoadMap(std::string(basePath), mapId, x, y);
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace VMAP
|
||||
{
|
||||
return getMapFileName(mapId);
|
||||
}
|
||||
bool existsMap(const char* basePath, unsigned int mapId, int x, int y) override;
|
||||
LoadResult existsMap(const char* basePath, unsigned int mapId, int x, int y) override;
|
||||
void GetInstanceMapTree(InstanceTreeMap& instanceMapTree);
|
||||
|
||||
typedef uint32(*GetLiquidFlagsFn)(uint32 liquidType);
|
||||
|
||||
@@ -249,7 +249,7 @@ namespace VMAP
|
||||
|
||||
//=========================================================
|
||||
|
||||
bool StaticMapTree::CanLoadMap(const std::string& vmapPath, uint32 mapID, uint32 tileX, uint32 tileY)
|
||||
LoadResult StaticMapTree::CanLoadMap(const std::string& vmapPath, uint32 mapID, uint32 tileX, uint32 tileY)
|
||||
{
|
||||
std::string basePath = vmapPath;
|
||||
if (basePath.length() > 0 && basePath[basePath.length() - 1] != '/' && basePath[basePath.length() - 1] != '\\')
|
||||
@@ -257,19 +257,21 @@ namespace VMAP
|
||||
basePath.push_back('/');
|
||||
}
|
||||
std::string fullname = basePath + VMapMgr2::getMapFileName(mapID);
|
||||
bool success = true;
|
||||
|
||||
LoadResult result = LoadResult::Success;
|
||||
|
||||
FILE* rf = fopen(fullname.c_str(), "rb");
|
||||
if (!rf)
|
||||
{
|
||||
return false;
|
||||
return LoadResult::FileNotFound;
|
||||
}
|
||||
// TODO: check magic number when implemented...
|
||||
|
||||
char tiled;
|
||||
char chunk[8];
|
||||
if (!readChunk(rf, chunk, VMAP_MAGIC, 8) || fread(&tiled, sizeof(char), 1, rf) != 1)
|
||||
{
|
||||
fclose(rf);
|
||||
return false;
|
||||
return LoadResult::VersionMismatch;
|
||||
}
|
||||
if (tiled)
|
||||
{
|
||||
@@ -277,19 +279,19 @@ namespace VMAP
|
||||
FILE* tf = fopen(tilefile.c_str(), "rb");
|
||||
if (!tf)
|
||||
{
|
||||
success = false;
|
||||
result = LoadResult::FileNotFound;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!readChunk(tf, chunk, VMAP_MAGIC, 8))
|
||||
{
|
||||
success = false;
|
||||
result = LoadResult::VersionMismatch;
|
||||
}
|
||||
fclose(tf);
|
||||
}
|
||||
}
|
||||
fclose(rf);
|
||||
return success;
|
||||
return result;
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace VMAP
|
||||
class ModelInstance;
|
||||
class GroupModel;
|
||||
class VMapMgr2;
|
||||
enum class LoadResult : uint8;
|
||||
|
||||
struct LocationInfo
|
||||
{
|
||||
@@ -63,7 +64,7 @@ namespace VMAP
|
||||
static std::string getTileFileName(uint32 mapID, uint32 tileX, uint32 tileY);
|
||||
static uint32 packTileID(uint32 tileX, uint32 tileY) { return tileX << 16 | tileY; }
|
||||
static void unpackTileID(uint32 ID, uint32& tileX, uint32& tileY) { tileX = ID >> 16; tileY = ID & 0xFF; }
|
||||
static bool CanLoadMap(const std::string& basePath, uint32 mapID, uint32 tileX, uint32 tileY);
|
||||
static LoadResult CanLoadMap(const std::string& basePath, uint32 mapID, uint32 tileX, uint32 tileY);
|
||||
|
||||
StaticMapTree(uint32 mapID, const std::string& basePath);
|
||||
~StaticMapTree();
|
||||
|
||||
@@ -48,14 +48,14 @@ void PossessedAI::UpdateAI(uint32 /*diff*/)
|
||||
void PossessedAI::JustDied(Unit* /*u*/)
|
||||
{
|
||||
// We died while possessed, disable our loot
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
|
||||
void PossessedAI::KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
// We killed a creature, disable victim's loot
|
||||
//if (victim->GetTypeId() == TYPEID_UNIT)
|
||||
// victim->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
// victim->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
|
||||
void CritterAI::DamageTaken(Unit*, uint32&, DamageEffectType, SpellSchoolMask)
|
||||
|
||||
@@ -2428,7 +2428,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (IsUnit(*itr))
|
||||
(*itr)->ToUnit()->SetUInt32Value(UNIT_DYNAMIC_FLAGS, e.action.flag.flag);
|
||||
(*itr)->ToUnit()->ReplaceAllDynamicFlags(e.action.flag.flag);
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
@@ -2441,7 +2441,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (IsUnit(*itr))
|
||||
(*itr)->ToUnit()->SetFlag(UNIT_DYNAMIC_FLAGS, e.action.flag.flag);
|
||||
(*itr)->ToUnit()->SetDynamicFlag(e.action.flag.flag);
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
@@ -2454,7 +2454,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (IsUnit(*itr))
|
||||
(*itr)->ToUnit()->RemoveFlag(UNIT_DYNAMIC_FLAGS, e.action.flag.flag);
|
||||
(*itr)->ToUnit()->RemoveDynamicFlag(e.action.flag.flag);
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
|
||||
@@ -662,7 +662,10 @@ enum BG_AV_CreaturePlace
|
||||
AV_CPLACE_TRIGGER18 = 319,
|
||||
AV_CPLACE_TRIGGER19 = 320,
|
||||
|
||||
AV_CPLACE_MAX = 321
|
||||
AV_CPLACE_MAX = 321,
|
||||
|
||||
AV_CPLACE_A_BOSS = 381,
|
||||
AV_CPLACE_H_BOSS = 445
|
||||
};
|
||||
|
||||
//x, y, z, o
|
||||
|
||||
@@ -504,7 +504,7 @@ bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changele
|
||||
ReplaceAllUnitFlags(UnitFlags(unit_flags));
|
||||
ReplaceAllUnitFlags2(UnitFlags2(cInfo->unit_flags2));
|
||||
|
||||
SetUInt32Value(UNIT_DYNAMIC_FLAGS, dynamicflags);
|
||||
ReplaceAllDynamicFlags(dynamicflags);
|
||||
|
||||
SetAttackTime(BASE_ATTACK, cInfo->BaseAttackTime);
|
||||
SetAttackTime(OFF_ATTACK, cInfo->BaseAttackTime);
|
||||
@@ -1214,7 +1214,7 @@ void Creature::SetLootRecipient(Unit* unit, bool withGroup)
|
||||
{
|
||||
m_lootRecipient.Clear();
|
||||
m_lootRecipientGroup = 0;
|
||||
RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE | UNIT_DYNFLAG_TAPPED);
|
||||
RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE | UNIT_DYNFLAG_TAPPED);
|
||||
ResetAllowedLooters();
|
||||
return;
|
||||
}
|
||||
@@ -1261,7 +1261,7 @@ void Creature::SetLootRecipient(Unit* unit, bool withGroup)
|
||||
else
|
||||
m_lootRecipientGroup = 0;
|
||||
|
||||
SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED);
|
||||
SetDynamicFlag(UNIT_DYNFLAG_TAPPED);
|
||||
}
|
||||
|
||||
// return true if this creature is tapped by the player or by a member of his group.
|
||||
@@ -1304,7 +1304,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||
uint32 displayId = GetNativeDisplayId();
|
||||
uint32 npcflag = GetUInt32Value(UNIT_NPC_FLAGS);
|
||||
uint32 unit_flags = GetUnitFlags();
|
||||
uint32 dynamicflags = GetUInt32Value(UNIT_DYNAMIC_FLAGS);
|
||||
uint32 dynamicflags = GetDynamicFlags();
|
||||
|
||||
// check if it's a custom model and if not, use 0 for displayId
|
||||
CreatureTemplate const* cinfo = GetCreatureTemplate();
|
||||
|
||||
@@ -772,6 +772,9 @@ public:
|
||||
void RemoveFromWorld() override;
|
||||
void CleanupsBeforeDelete(bool finalCleanup = true) override;
|
||||
|
||||
uint32 GetDynamicFlags() const override { return GetUInt32Value(GAMEOBJECT_DYNAMIC); }
|
||||
void ReplaceAllDynamicFlags(uint32 flag) override { SetUInt32Value(GAMEOBJECT_DYNAMIC, flag); }
|
||||
|
||||
virtual bool Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, G3D::Quat const& rotation, uint32 animprogress, GOState go_state, uint32 artKit = 0);
|
||||
void Update(uint32 p_time) override;
|
||||
[[nodiscard]] GameObjectTemplate const* GetGOInfo() const { return m_goInfo; }
|
||||
|
||||
@@ -583,7 +583,7 @@ uint32 Object::GetUpdateFieldData(Player const* target, uint32*& flags) const
|
||||
if (ToUnit()->GetOwnerGUID() == target->GetGUID())
|
||||
visibleFlag |= UF_FLAG_OWNER;
|
||||
|
||||
if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO))
|
||||
if (HasDynamicFlag(UNIT_DYNFLAG_SPECIALINFO))
|
||||
if (ToUnit()->HasAuraTypeWithCaster(SPELL_AURA_EMPATHY, target->GetGUID()))
|
||||
visibleFlag |= UF_FLAG_SPECIAL_INFO;
|
||||
|
||||
|
||||
@@ -105,6 +105,12 @@ public:
|
||||
[[nodiscard]] float GetObjectScale() const { return GetFloatValue(OBJECT_FIELD_SCALE_X); }
|
||||
virtual void SetObjectScale(float scale) { SetFloatValue(OBJECT_FIELD_SCALE_X, scale); }
|
||||
|
||||
virtual uint32 GetDynamicFlags() const { return 0; }
|
||||
bool HasDynamicFlag(uint32 flag) const { return (GetDynamicFlags() & flag) != 0; }
|
||||
virtual void SetDynamicFlag(uint32 flag) { ReplaceAllDynamicFlags(GetDynamicFlags() | flag); }
|
||||
virtual void RemoveDynamicFlag(uint32 flag) { ReplaceAllDynamicFlags(GetDynamicFlags() & ~flag); }
|
||||
virtual void ReplaceAllDynamicFlags([[maybe_unused]] uint32 flag) { }
|
||||
|
||||
[[nodiscard]] TypeID GetTypeId() const { return m_objectTypeId; }
|
||||
[[nodiscard]] bool isType(uint16 mask) const { return (mask & m_objectType); }
|
||||
|
||||
|
||||
@@ -621,7 +621,7 @@ void Pet::setDeathState(DeathState s, bool /*despawn = false*/)
|
||||
if (getPetType() == HUNTER_PET)
|
||||
{
|
||||
// pet corpse non lootable and non skinnable
|
||||
SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
|
||||
ReplaceAllDynamicFlags(UNIT_DYNFLAG_NONE);
|
||||
RemoveUnitFlag(UNIT_FLAG_SKINNABLE);
|
||||
|
||||
//lose happiness when died and not in BG/Arena
|
||||
|
||||
@@ -4363,7 +4363,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
|
||||
RemoveAurasDueToSpell(8326); // SPELL_AURA_GHOST
|
||||
|
||||
if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0))
|
||||
SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_REFER_A_FRIEND);
|
||||
SetDynamicFlag(UNIT_DYNFLAG_REFER_A_FRIEND);
|
||||
|
||||
setDeathState(ALIVE);
|
||||
SetMovement(MOVE_LAND_WALK);
|
||||
@@ -4435,7 +4435,7 @@ void Player::KillPlayer()
|
||||
setDeathState(CORPSE);
|
||||
//SetUnitFlag(UNIT_FLAG_NOT_IN_PVP);
|
||||
|
||||
SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
|
||||
ReplaceAllDynamicFlags(UNIT_DYNFLAG_NONE);
|
||||
ApplyModFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(GetMapId())->Instanceable() && !HasAuraType(SPELL_AURA_PREVENT_RESURRECTION));
|
||||
|
||||
// 6 minutes until repop at graveyard
|
||||
@@ -7868,7 +7868,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
|
||||
else
|
||||
{
|
||||
// Xinef: Exploit fix
|
||||
if (!creature->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE))
|
||||
if (!creature->HasDynamicFlag(UNIT_DYNFLAG_LOOTABLE))
|
||||
{
|
||||
SendLootError(guid, LOOT_ERROR_DIDNT_KILL);
|
||||
return;
|
||||
|
||||
@@ -5595,7 +5595,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
|
||||
// RaF stuff.
|
||||
m_grantableLevels = fields[71].Get<uint8>();
|
||||
if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0))
|
||||
SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_REFER_A_FRIEND);
|
||||
SetDynamicFlag(UNIT_DYNFLAG_REFER_A_FRIEND);
|
||||
|
||||
if (m_grantableLevels > 0)
|
||||
SetByteValue(PLAYER_FIELD_BYTES, 1, 0x01);
|
||||
|
||||
@@ -1194,6 +1194,11 @@ void Player::UpdateArea(uint32 newArea)
|
||||
|
||||
void Player::UpdateZone(uint32 newZone, uint32 newArea)
|
||||
{
|
||||
if (!newZone)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_zoneUpdateId != newZone)
|
||||
{
|
||||
sOutdoorPvPMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
|
||||
|
||||
@@ -13178,8 +13178,8 @@ void Unit::ClearInCombat()
|
||||
SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); // set immunity state to the one from db on evade
|
||||
|
||||
ClearUnitState(UNIT_STATE_ATTACK_PLAYER);
|
||||
if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED))
|
||||
SetUInt32Value(UNIT_DYNAMIC_FLAGS, creature->GetCreatureTemplate()->dynamicflags);
|
||||
if (HasDynamicFlag(UNIT_DYNFLAG_TAPPED))
|
||||
ReplaceAllDynamicFlags(creature->GetCreatureTemplate()->dynamicflags);
|
||||
|
||||
creature->SetAssistanceTimer(0);
|
||||
|
||||
@@ -17430,7 +17430,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
||||
// must be after setDeathState which resets dynamic flags
|
||||
if (!creature->loot.isLooted())
|
||||
{
|
||||
creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
creature->SetDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -20197,7 +20197,7 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
|
||||
if (GetOwnerGUID() == target->GetGUID())
|
||||
visibleFlag |= UF_FLAG_OWNER;
|
||||
|
||||
if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO))
|
||||
if (HasDynamicFlag(UNIT_DYNFLAG_SPECIALINFO))
|
||||
if (HasAuraTypeWithCaster(SPELL_AURA_EMPATHY, target->GetGUID()))
|
||||
visibleFlag |= UF_FLAG_SPECIAL_INFO;
|
||||
|
||||
|
||||
@@ -1296,6 +1296,9 @@ public:
|
||||
void CleanupBeforeRemoveFromMap(bool finalCleanup);
|
||||
void CleanupsBeforeDelete(bool finalCleanup = true) override; // used in ~Creature/~Player (or before mass creature delete to remove cross-references to already deleted units)
|
||||
|
||||
uint32 GetDynamicFlags() const override { return GetUInt32Value(UNIT_DYNAMIC_FLAGS); }
|
||||
void ReplaceAllDynamicFlags(uint32 flag) override { SetUInt32Value(UNIT_DYNAMIC_FLAGS, flag); }
|
||||
|
||||
DiminishingLevels GetDiminishing(DiminishingGroup group);
|
||||
void IncrDiminishing(DiminishingGroup group);
|
||||
float ApplyDiminishingToDuration(DiminishingGroup group, int32& duration, Unit* caster, DiminishingLevels Level, int32 limitduration);
|
||||
|
||||
@@ -380,7 +380,7 @@ void WorldSession::DoLootRelease(ObjectGuid lguid)
|
||||
if (!creature->IsAlive())
|
||||
creature->AllLootRemovedFromCorpse();
|
||||
|
||||
creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
creature->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
||||
loot->clear();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -121,12 +121,20 @@ bool Map::ExistVMap(uint32 mapid, int gx, int gy)
|
||||
{
|
||||
if (vmgr->isMapLoadingEnabled())
|
||||
{
|
||||
bool exists = vmgr->existsMap((sWorld->GetDataPath() + "vmaps").c_str(), mapid, gx, gy);
|
||||
if (!exists)
|
||||
VMAP::LoadResult result = vmgr->existsMap((sWorld->GetDataPath() + "vmaps").c_str(), mapid, gx, gy);
|
||||
std::string name = vmgr->getDirFileName(mapid, gx, gy);
|
||||
switch (result)
|
||||
{
|
||||
std::string name = vmgr->getDirFileName(mapid, gx, gy);
|
||||
LOG_ERROR("maps", "VMap file '{}' is missing or points to wrong version of vmap file. Redo vmaps with latest version of vmap_assembler.exe.", (sWorld->GetDataPath() + "vmaps/" + name));
|
||||
return false;
|
||||
case VMAP::LoadResult::Success:
|
||||
break;
|
||||
case VMAP::LoadResult::FileNotFound:
|
||||
LOG_ERROR("maps", "VMap file '{}' does not exist", (sWorld->GetDataPath() + "vmaps/" + name));
|
||||
LOG_ERROR("maps", "Please place VMAP files (*.vmtree and *.vmtile) in the vmap directory ({}), or correct the DataDir setting in your worldserver.conf file.", (sWorld->GetDataPath() + "vmaps/"));
|
||||
return false;
|
||||
case VMAP::LoadResult::VersionMismatch:
|
||||
LOG_ERROR("maps", "VMap file '{}' couldn't be loaded", (sWorld->GetDataPath() + "vmaps/" + name));
|
||||
LOG_ERROR("maps", "This is because the version of the VMap file and the version of this module are different, please re-extract the maps with the tools compiled with this module.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -635,6 +635,11 @@ public:
|
||||
_updateObjects.erase(obj);
|
||||
}
|
||||
|
||||
size_t GetActiveNonPlayersCount() const
|
||||
{
|
||||
return m_activeNonPlayers.size();
|
||||
}
|
||||
|
||||
private:
|
||||
void LoadMapAndVMap(int gx, int gy);
|
||||
void LoadVMap(int gx, int gy);
|
||||
|
||||
@@ -2483,7 +2483,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo
|
||||
// blizz like 2.0.x
|
||||
target->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
// blizz like 2.0.x
|
||||
target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
target->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
|
||||
target->AddUnitState(UNIT_STATE_DIED);
|
||||
}
|
||||
@@ -2500,7 +2500,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo
|
||||
// blizz like 2.0.x
|
||||
target->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
// blizz like 2.0.x
|
||||
target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
target->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
|
||||
target->ClearUnitState(UNIT_STATE_DIED);
|
||||
}
|
||||
@@ -2746,12 +2746,12 @@ void AuraEffect::HandleAuraModStalked(AuraApplication const* aurApp, uint8 mode,
|
||||
|
||||
// used by spells: Hunter's Mark, Mind Vision, Syndicate Tracker (MURP) DND
|
||||
if (apply)
|
||||
target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TRACK_UNIT);
|
||||
target->SetDynamicFlag(UNIT_DYNFLAG_TRACK_UNIT);
|
||||
else
|
||||
{
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
if (!target->HasAuraType(GetAuraType()))
|
||||
target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TRACK_UNIT);
|
||||
target->RemoveDynamicFlag(UNIT_DYNFLAG_TRACK_UNIT);
|
||||
}
|
||||
|
||||
// call functions which may have additional effects after chainging state of unit
|
||||
|
||||
@@ -1508,6 +1508,16 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (target->HasAura(58039)) // Glyph of Blurred Speed
|
||||
target->CastSpell(target, 61922, true); // Sprint (waterwalk)
|
||||
break;
|
||||
case SPELLFAMILY_SHAMAN:
|
||||
{
|
||||
// Ghost Wolf Speed (PvP 58 lvl set)
|
||||
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00000800 && target->HasAura(22801) && target->getLevel() <= 60)
|
||||
{
|
||||
int32 bp0 = 15;
|
||||
target->CastCustomSpell(target, 47017, &bp0, 0, 0, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_DEATHKNIGHT:
|
||||
if (!caster)
|
||||
break;
|
||||
@@ -1812,7 +1822,15 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case SPELLFAMILY_SHAMAN:
|
||||
{
|
||||
// Ghost Wolf Speed (PvP 58 lvl set)
|
||||
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00000800)
|
||||
{
|
||||
target->RemoveAurasDueToSpell(47017);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_DEATHKNIGHT:
|
||||
// Blood of the North
|
||||
// Reaping
|
||||
|
||||
@@ -2925,8 +2925,9 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
|
||||
if (m_originalCaster)
|
||||
{
|
||||
bool refresh = false;
|
||||
bool refreshPeriodic = m_spellInfo->StackAmount < 2 && !(_triggeredCastFlags & TRIGGERED_NO_PERIODIC_RESET);
|
||||
m_spellAura = Aura::TryRefreshStackOrCreate(aurSpellInfo, effectMask, unit, m_originalCaster,
|
||||
(aurSpellInfo == m_spellInfo) ? &m_spellValue->EffectBasePoints[0] : &basePoints[0], m_CastItem, ObjectGuid::Empty, &refresh, !(_triggeredCastFlags & TRIGGERED_NO_PERIODIC_RESET));
|
||||
(aurSpellInfo == m_spellInfo) ? &m_spellValue->EffectBasePoints[0] : &basePoints[0], m_CastItem, ObjectGuid::Empty, &refresh, refreshPeriodic);
|
||||
|
||||
// xinef: if aura was not refreshed, add proc ex
|
||||
if (!refresh)
|
||||
|
||||
@@ -3782,14 +3782,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
switch (m_spellInfo->Id)
|
||||
{
|
||||
// Brittle Armor - need remove one 24575 Brittle Armor aura
|
||||
case 24590:
|
||||
unitTarget->RemoveAuraFromStack(24575);
|
||||
return;
|
||||
// Mercurial Shield - need remove one 26464 Mercurial Shield aura
|
||||
case 26465:
|
||||
unitTarget->RemoveAuraFromStack(26464);
|
||||
return;
|
||||
// Shadow Flame (All script effects, not just end ones to prevent player from dodging the last triggered spell)
|
||||
case 22539:
|
||||
case 22972:
|
||||
@@ -3923,19 +3915,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
m_caster->TextEmote(buf);
|
||||
break;
|
||||
}
|
||||
// Deathbolt from Thalgran Blightbringer
|
||||
// reflected by Freya's Ward
|
||||
// Retribution by Sevenfold Retribution
|
||||
case 51854:
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
if (unitTarget->HasAura(51845))
|
||||
unitTarget->CastSpell(m_caster, 51856, true);
|
||||
else
|
||||
m_caster->CastSpell(unitTarget, 51855, true);
|
||||
break;
|
||||
}
|
||||
case 52173: // Coyote Spirit Despawn
|
||||
case 60243: // Blood Parrot Despawn
|
||||
if (unitTarget->GetTypeId() == TYPEID_UNIT && unitTarget->ToCreature()->IsSummon())
|
||||
@@ -3972,26 +3951,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
if (unitTarget->ToPlayer()->GetQuestStatus(questID) == QUEST_STATUS_COMPLETE)
|
||||
unitTarget->CastSpell(unitTarget, spellID, true);
|
||||
|
||||
return;
|
||||
}
|
||||
case 59317: // Teleporting
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
Player* player = unitTarget->ToPlayer();
|
||||
if (!player)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// return from top
|
||||
if (player->GetAreaId() == 4637)
|
||||
unitTarget->CastSpell(unitTarget, 59316, true);
|
||||
// teleport atop
|
||||
else
|
||||
unitTarget->CastSpell(unitTarget, 59314, true);
|
||||
|
||||
return;
|
||||
}
|
||||
// Stoneclaw Totem
|
||||
@@ -4895,7 +4854,7 @@ void Spell::EffectSkinning(SpellEffIndex /*effIndex*/)
|
||||
uint32 skill = creature->GetCreatureTemplate()->GetRequiredLootSkill();
|
||||
|
||||
creature->RemoveUnitFlag(UNIT_FLAG_SKINNABLE);
|
||||
creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
creature->SetDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
||||
m_caster->ToPlayer()->SendLoot(creature->GetGUID(), LOOT_SKINNING);
|
||||
|
||||
int32 reqValue = targetLevel < 10 ? 0 : targetLevel < 20 ? (targetLevel - 10) * 10 : targetLevel * 5;
|
||||
@@ -5245,7 +5204,7 @@ void Spell::EffectResurrectPet(SpellEffIndex /*effIndex*/)
|
||||
player->GetClosePoint(x, y, z, pet->GetCombatReach(), PET_FOLLOW_DIST, pet->GetFollowAngle());
|
||||
pet->NearTeleportTo(x, y, z, player->GetOrientation());
|
||||
pet->Relocate(x, y, z, player->GetOrientation()); // This is needed so SaveStayPosition() will get the proper coords.
|
||||
pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
|
||||
pet->ReplaceAllDynamicFlags(UNIT_DYNFLAG_NONE);
|
||||
pet->RemoveUnitFlag(UNIT_FLAG_SKINNABLE);
|
||||
pet->setDeathState(ALIVE);
|
||||
pet->ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~(UNIT_STATE_POSSESSED))); // xinef: just in case
|
||||
|
||||
@@ -1499,7 +1499,7 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
|
||||
}
|
||||
|
||||
// continent limitation (virtual continent)
|
||||
if (HasAttribute(SPELL_ATTR4_ONLY_FLYING_AREAS))
|
||||
if (HasAttribute(SPELL_ATTR4_ONLY_FLYING_AREAS) && (area_id || zone_id))
|
||||
{
|
||||
AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(area_id);
|
||||
if (!areaEntry)
|
||||
|
||||
@@ -103,6 +103,7 @@ public:
|
||||
{ "los", HandleDebugLoSCommand, SEC_ADMINISTRATOR, Console::No },
|
||||
{ "moveflags", HandleDebugMoveflagsCommand, SEC_ADMINISTRATOR, Console::No },
|
||||
{ "unitstate", HandleDebugUnitStateCommand, SEC_ADMINISTRATOR, Console::No },
|
||||
{ "objectcount", HandleDebugObjectCountCommand, SEC_ADMINISTRATOR, Console::Yes},
|
||||
{ "dummy", HandleDebugDummyCommand, SEC_ADMINISTRATOR, Console::No }
|
||||
};
|
||||
static ChatCommandTable commandTable =
|
||||
@@ -1244,6 +1245,84 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleDebugObjectCountCommand(ChatHandler* handler, Optional<uint32> mapId)
|
||||
{
|
||||
if (mapId)
|
||||
{
|
||||
sMapMgr->DoForAllMapsWithMapId(mapId.value(),
|
||||
[handler](Map* map) -> void
|
||||
{
|
||||
HandleDebugObjectCountMap(handler, map);
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
sMapMgr->DoForAllMaps(
|
||||
[handler](Map* map) -> void
|
||||
{
|
||||
HandleDebugObjectCountMap(handler, map);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
class CreatureCountWorker
|
||||
{
|
||||
public:
|
||||
CreatureCountWorker() { }
|
||||
|
||||
void Visit(std::unordered_map<ObjectGuid, Creature*>& creatureMap)
|
||||
{
|
||||
for (auto const& p : creatureMap)
|
||||
{
|
||||
uint32& count = creatureIds[p.second->GetEntry()];
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void Visit(std::unordered_map<ObjectGuid, T*>&) { }
|
||||
|
||||
std::vector<std::pair<uint32, uint32>> GetTopCreatureCount(uint32 count)
|
||||
{
|
||||
auto comp = [](std::pair<uint32, uint32> const& a, std::pair<uint32, uint32> const& b)
|
||||
{
|
||||
return a.second > b.second;
|
||||
};
|
||||
std::set<std::pair<uint32, uint32>, decltype(comp)> set(creatureIds.begin(), creatureIds.end(), comp);
|
||||
|
||||
count = std::min(count, uint32(set.size()));
|
||||
std::vector<std::pair<uint32, uint32>> result(count);
|
||||
std::copy_n(set.begin(), count, result.begin());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private:
|
||||
std::unordered_map<uint32, uint32> creatureIds;
|
||||
};
|
||||
|
||||
static void HandleDebugObjectCountMap(ChatHandler* handler, Map* map)
|
||||
{
|
||||
handler->PSendSysMessage("Map Id: %u Name: '%s' Instance Id: %u Creatures: %u GameObjects: %u SetActive Objects: %u",
|
||||
map->GetId(), map->GetMapName(), map->GetInstanceId(),
|
||||
uint64(map->GetObjectsStore().Size<Creature>()),
|
||||
uint64(map->GetObjectsStore().Size<GameObject>()),
|
||||
uint64(map->GetActiveNonPlayersCount()));
|
||||
|
||||
CreatureCountWorker worker;
|
||||
TypeContainerVisitor<CreatureCountWorker, MapStoredObjectTypesContainer> visitor(worker);
|
||||
visitor.Visit(map->GetObjectsStore());
|
||||
|
||||
handler->PSendSysMessage("Top Creatures count:");
|
||||
|
||||
for (auto&& p : worker.GetTopCreatureCount(5))
|
||||
handler->PSendSysMessage("Entry: %u Count: %u", p.first, p.second);
|
||||
}
|
||||
|
||||
static bool HandleDebugDummyCommand(ChatHandler* handler)
|
||||
{
|
||||
handler->SendSysMessage("This command does nothing right now. Edit your local core (cs_debug.cpp) to make it do whatever you need for testing.");
|
||||
|
||||
@@ -267,7 +267,7 @@ public:
|
||||
uint32 factionid = target->GetFaction();
|
||||
uint32 flag = target->GetUnitFlags();
|
||||
uint32 npcflag = target->GetUInt32Value(UNIT_NPC_FLAGS);
|
||||
uint32 dyflag = target->GetUInt32Value(UNIT_DYNAMIC_FLAGS);
|
||||
uint32 dyflag = target->GetDynamicFlags();
|
||||
handler->PSendSysMessage(LANG_CURRENT_FACTION, target->GetGUID().GetCounter(), factionid, flag, npcflag, dyflag);
|
||||
return true;
|
||||
}
|
||||
@@ -291,7 +291,7 @@ public:
|
||||
|
||||
auto pdyflag = dynamicFlagID;
|
||||
if (!pdyflag)
|
||||
dyflag = target->GetUInt32Value(UNIT_DYNAMIC_FLAGS);
|
||||
dyflag = target->GetDynamicFlags();
|
||||
else
|
||||
dyflag = *dynamicFlagID;
|
||||
|
||||
@@ -307,7 +307,7 @@ public:
|
||||
target->SetFaction(factionid);
|
||||
target->ReplaceAllUnitFlags(flag);
|
||||
target->SetUInt32Value(UNIT_NPC_FLAGS, npcflag);
|
||||
target->SetUInt32Value(UNIT_DYNAMIC_FLAGS, dyflag);
|
||||
target->ReplaceAllDynamicFlags(dyflag);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -615,7 +615,7 @@ public:
|
||||
handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->getLevel());
|
||||
handler->PSendSysMessage(LANG_NPCINFO_EQUIPMENT, target->GetCurrentEquipmentId(), target->GetOriginalEquipmentId());
|
||||
handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth());
|
||||
handler->PSendSysMessage(LANG_NPCINFO_FLAGS, target->GetUnitFlags(), target->GetUnitFlags2(), target->GetUInt32Value(UNIT_DYNAMIC_FLAGS), target->GetFaction());
|
||||
handler->PSendSysMessage(LANG_NPCINFO_FLAGS, target->GetUnitFlags(), target->GetUnitFlags2(), target->GetDynamicFlags(), target->GetFaction());
|
||||
handler->PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(), curRespawnDelayStr.c_str());
|
||||
handler->PSendSysMessage(LANG_NPCINFO_LOOT, cInfo->lootid, cInfo->pickpocketLootId, cInfo->SkinLootId);
|
||||
handler->PSendSysMessage(LANG_NPCINFO_DUNGEON_ID, target->GetInstanceId());
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "BattlegroundAV.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
@@ -77,6 +78,11 @@ SpellPair const _auraPairs[MAX_SPELL_PAIRS] =
|
||||
{ NPC_ICEBLOOD_WARMASTER, SPELL_ICEBLOOD_WARMASTER }
|
||||
};
|
||||
|
||||
enum Factions
|
||||
{
|
||||
FACTION_AV_ALLIANCE = 1534
|
||||
};
|
||||
|
||||
class npc_av_marshal_or_warmaster : public CreatureScript
|
||||
{
|
||||
public:
|
||||
@@ -104,6 +110,46 @@ public:
|
||||
Reset();
|
||||
}
|
||||
|
||||
void AttackStart(Unit* victim) override
|
||||
{
|
||||
ScriptedAI::AttackStart(victim);
|
||||
|
||||
// Boss should attack as well
|
||||
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
|
||||
{
|
||||
if (Battleground* bg = bgMap->GetBG())
|
||||
{
|
||||
if (Creature* mainBoss = bg->GetBGCreature((me->GetFaction() == FACTION_AV_ALLIANCE ? AV_CPLACE_A_BOSS : AV_CPLACE_H_BOSS)))
|
||||
{
|
||||
if (mainBoss->IsAIEnabled && !mainBoss->GetVictim())
|
||||
{
|
||||
mainBoss->AI()->AttackStart(victim);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
|
||||
// Evade boss
|
||||
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
|
||||
{
|
||||
if (Battleground* bg = bgMap->GetBG())
|
||||
{
|
||||
if (Creature* mainBoss = bg->GetBGCreature((me->GetFaction() == FACTION_AV_ALLIANCE ? AV_CPLACE_A_BOSS : AV_CPLACE_H_BOSS)))
|
||||
{
|
||||
if (mainBoss->IsAIEnabled && !mainBoss->IsInEvadeMode())
|
||||
{
|
||||
mainBoss->AI()->EnterEvadeMode();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
// I have a feeling this isn't blizzlike, but owell, I'm only passing by and cleaning up.
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "BattlegroundAV.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
@@ -75,6 +76,52 @@ public:
|
||||
Talk(YELL_RESPAWN);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* victim) override
|
||||
{
|
||||
ScriptedAI::AttackStart(victim);
|
||||
|
||||
// Mini bosses should attack as well
|
||||
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
|
||||
{
|
||||
if (Battleground* bg = bgMap->GetBG())
|
||||
{
|
||||
for (uint8 i = AV_CPLACE_H_MARSHAL_ICE; i <= AV_CPLACE_H_MARSHAL_WTOWER; ++i)
|
||||
{
|
||||
if (Creature* marshall = bg->GetBGCreature(i))
|
||||
{
|
||||
if (marshall->IsAIEnabled && !marshall->GetVictim())
|
||||
{
|
||||
marshall->AI()->AttackStart(victim);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
|
||||
// Evade mini bosses
|
||||
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
|
||||
{
|
||||
if (Battleground* bg = bgMap->GetBG())
|
||||
{
|
||||
for (uint8 i = AV_CPLACE_H_MARSHAL_ICE; i <= AV_CPLACE_H_MARSHAL_WTOWER; ++i)
|
||||
{
|
||||
if (Creature* marshall = bg->GetBGCreature(i))
|
||||
{
|
||||
if (marshall->IsAIEnabled && !marshall->IsInEvadeMode())
|
||||
{
|
||||
marshall->AI()->EnterEvadeMode();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "BattlegroundAV.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
@@ -64,6 +65,52 @@ public:
|
||||
Talk(YELL_AGGRO);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* victim) override
|
||||
{
|
||||
ScriptedAI::AttackStart(victim);
|
||||
|
||||
// Mini bosses should attack as well
|
||||
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
|
||||
{
|
||||
if (Battleground* bg = bgMap->GetBG())
|
||||
{
|
||||
for (uint8 i = AV_CPLACE_A_MARSHAL_SOUTH; i <= AV_CPLACE_A_MARSHAL_STONE; ++i)
|
||||
{
|
||||
if (Creature* marshall = bg->GetBGCreature(i))
|
||||
{
|
||||
if (marshall->IsAIEnabled && !marshall->GetVictim())
|
||||
{
|
||||
marshall->AI()->AttackStart(victim);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode() override
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
|
||||
// Evade mini bosses
|
||||
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
|
||||
{
|
||||
if (Battleground* bg = bgMap->GetBG())
|
||||
{
|
||||
for (uint8 i = AV_CPLACE_A_MARSHAL_SOUTH; i <= AV_CPLACE_A_MARSHAL_STONE; ++i)
|
||||
{
|
||||
if (Creature* marshall = bg->GetBGCreature(i))
|
||||
{
|
||||
if (marshall->IsAIEnabled && !marshall->IsInEvadeMode())
|
||||
{
|
||||
marshall->AI()->EnterEvadeMode();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
}
|
||||
|
||||
creatureTarget->CastSpell(creatureTarget, SPELL_PLAY_DEAD_PACIFY, true);
|
||||
creatureTarget->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
creatureTarget->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
creatureTarget->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
//creatureTarget->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
creatureTarget->SetReactState(REACT_PASSIVE);
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
}
|
||||
|
||||
creatureTarget->RemoveAurasDueToSpell(SPELL_PLAY_DEAD_PACIFY);
|
||||
creatureTarget->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
creatureTarget->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
creatureTarget->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
//creatureTarget->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
creatureTarget->SetControlled(false, UNIT_STATE_ROOT);
|
||||
|
||||
@@ -1244,7 +1244,7 @@ public:
|
||||
Julianne->setDeathState(JUST_DIED);
|
||||
Julianne->CombatStop(true);
|
||||
Julianne->DeleteThreatList();
|
||||
Julianne->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
Julianne->ReplaceAllDynamicFlags(UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1547,7 +1547,7 @@ void boss_julianne::boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32& dama
|
||||
Romulo->setDeathState(JUST_DIED);
|
||||
Romulo->CombatStop(true);
|
||||
Romulo->DeleteThreatList();
|
||||
Romulo->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
Romulo->ReplaceAllDynamicFlags(UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
me->loot.clear();
|
||||
me->loot.FillLoot(me->GetCreatureTemplate()->lootid, LootTemplates_Creature, me->GetLootRecipient(), false, false, 1, me);
|
||||
instance->SetData(DATA_DELRISSA_EVENT, DONE);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
me->SetDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
++HelpersKilled;
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ public:
|
||||
bool appear = instance->GetBossState(DATA_BRUTALLUS) != DONE && instance->GetBossState(DATA_MADRIGOSA) == DONE;
|
||||
creature->SetVisible(appear);
|
||||
creature->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
creature->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
@@ -229,7 +229,7 @@ public:
|
||||
{
|
||||
me->SetDisableGravity(true);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->NearTeleportTo(1570.97f, 725.51f, 79.77f, 3.82f);
|
||||
events.ScheduleEvent(EVENT_MAD_1, 2000);
|
||||
}
|
||||
@@ -361,7 +361,7 @@ public:
|
||||
break;
|
||||
case EVENT_MAD_18:
|
||||
Talk(SAY_MAD_5);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
events.ScheduleEvent(EVENT_MAD_19, 6000);
|
||||
break;
|
||||
|
||||
@@ -642,7 +642,7 @@ public:
|
||||
me->SetDisplayId(MODEL_HARRISON_JONES_2);
|
||||
me->SetTarget();
|
||||
me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_DEAD);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
instance->SetData(DATA_GONGEVENT, DONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ void hyjal_trashAI::JustDied(Unit* /*killer*/)
|
||||
instance->SetData(DATA_TRASH, 0);//signal trash is dead
|
||||
|
||||
if ((instance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !me->isWorldBoss()) || (damageTaken < me->GetMaxHealth() / 4 && me->isWorldBoss()))
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);//no loot
|
||||
}
|
||||
|
||||
class npc_giant_infernal : public CreatureScript
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)// Unlootable if death
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
||||
|
||||
instance->SetData(DATA_BUG_TRIO_DEATH, 1);
|
||||
}
|
||||
@@ -173,7 +173,7 @@ public:
|
||||
{
|
||||
instance->SetData(DATA_VEM_DEATH, 0);
|
||||
if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)// Unlootable if death
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
||||
instance->SetData(DATA_BUG_TRIO_DEATH, 1);
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ public:
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)// Unlootable if death
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
||||
instance->SetData(DATA_BUG_TRIO_DEATH, 1);
|
||||
|
||||
for (uint8 i = 0; i < 10; ++i)
|
||||
|
||||
@@ -115,7 +115,7 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
if (ohealth <= 0)
|
||||
{
|
||||
pOtherBoss->setDeathState(JUST_DIED);
|
||||
pOtherBoss->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
pOtherBoss->SetDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
{
|
||||
pOtherBoss->SetHealth(0);
|
||||
pOtherBoss->setDeathState(JUST_DIED);
|
||||
pOtherBoss->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
pOtherBoss->SetDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
||||
CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->DontYellWhenDead = true;
|
||||
}
|
||||
if (!DontYellWhenDead) // I hope AI is not threaded
|
||||
|
||||
+2
-2
@@ -156,7 +156,7 @@ public:
|
||||
me->CastSpell(me, SPELL_BK_FEIGN_DEATH, true);
|
||||
me->SetUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT);
|
||||
me->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->AddUnitState(UNIT_STATE_DIED);
|
||||
}
|
||||
}
|
||||
@@ -198,7 +198,7 @@ public:
|
||||
|
||||
me->RemoveUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT);
|
||||
me->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->ClearUnitState(UNIT_STATE_DIED);
|
||||
|
||||
++Phase;
|
||||
|
||||
@@ -420,7 +420,7 @@ public:
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->AddUnitState(UNIT_STATE_DIED);
|
||||
|
||||
me->CastSpell(me, SPELL_KRICK_KILL_CREDIT, true);
|
||||
|
||||
@@ -210,7 +210,7 @@ public:
|
||||
c->CastSpell(c, SPELL_FEIGN_DEATH, true);
|
||||
}
|
||||
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
@@ -368,7 +368,7 @@ public:
|
||||
case ACTION_STAND_UP:
|
||||
summons.DespawnEntry(WORLD_TRIGGER);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->ForceValuesUpdateAtIndex(UNIT_NPC_FLAGS); // was in sniff. don't ask why
|
||||
@@ -469,7 +469,7 @@ public:
|
||||
c->CastSpell(c, SPELL_FEIGN_DEATH, true);
|
||||
}
|
||||
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
@@ -637,7 +637,7 @@ public:
|
||||
case ACTION_STAND_UP:
|
||||
summons.DespawnEntry(WORLD_TRIGGER);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->ForceValuesUpdateAtIndex(UNIT_NPC_FLAGS); // was in sniff. don't ask why
|
||||
@@ -753,7 +753,7 @@ public:
|
||||
c->CastSpell(c, SPELL_FEIGN_DEATH, true);
|
||||
}
|
||||
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
@@ -930,7 +930,7 @@ public:
|
||||
case ACTION_STAND_UP:
|
||||
summons.DespawnEntry(WORLD_TRIGGER);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->ForceValuesUpdateAtIndex(UNIT_NPC_FLAGS); // was in sniff. don't ask why
|
||||
|
||||
@@ -744,7 +744,7 @@ public:
|
||||
break;
|
||||
case EVENT_CULTIST_DARK_MARTYRDOM_REVIVE:
|
||||
me->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH);
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->UpdateEntry(NPC_REANIMATED_FANATIC);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_STUNNED | UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE);
|
||||
@@ -759,7 +759,7 @@ public:
|
||||
me->CastSpell(me, SPELL_PERMANENT_FEIGN_DEATH, true);
|
||||
me->CastSpell(me, SPELL_CLEAR_ALL_DEBUFFS, true);
|
||||
me->CastSpell(me, SPELL_FULL_HEAL, true);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->SetUnitFlag(UNIT_FLAG_STUNNED | UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE);
|
||||
Reset();
|
||||
@@ -865,7 +865,7 @@ public:
|
||||
break;
|
||||
case EVENT_CULTIST_DARK_MARTYRDOM_REVIVE:
|
||||
me->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH);
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->UpdateEntry(NPC_REANIMATED_ADHERENT);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_STUNNED | UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE);
|
||||
@@ -880,7 +880,7 @@ public:
|
||||
me->CastSpell(me, SPELL_PERMANENT_FEIGN_DEATH, true);
|
||||
me->CastSpell(me, SPELL_CLEAR_ALL_DEBUFFS, true);
|
||||
me->CastSpell(me, SPELL_FULL_HEAL, true);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->SetUnitFlag(UNIT_FLAG_STUNNED | UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT | UNIT_FLAG_NOT_SELECTABLE);
|
||||
Reset();
|
||||
|
||||
@@ -1733,26 +1733,42 @@ class boss_yoggsaron_descend_portal : public CreatureScript
|
||||
public:
|
||||
boss_yoggsaron_descend_portal() : CreatureScript("boss_yoggsaron_descend_portal") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
struct boss_yoggsaron_descend_portalAI : public PassiveAI
|
||||
{
|
||||
if (!creature->GetUInt32Value(UNIT_NPC_FLAGS))
|
||||
return true;
|
||||
switch (creature->GetArmor())
|
||||
boss_yoggsaron_descend_portalAI(Creature* creature) : PassiveAI(creature), _instance(creature->GetInstanceScript()) {}
|
||||
|
||||
void OnSpellClick(Unit* clicker, bool& spellClickHandled) override
|
||||
{
|
||||
case ACTION_ILLUSION_DRAGONS:
|
||||
player->CastSpell(player, SPELL_TELEPORT_TO_CHAMBER, true);
|
||||
break;
|
||||
case ACTION_ILLUSION_ICECROWN:
|
||||
player->CastSpell(player, SPELL_TELEPORT_TO_ICECROWN, true);
|
||||
break;
|
||||
case ACTION_ILLUSION_STORMWIND:
|
||||
player->CastSpell(player, SPELL_TELEPORT_TO_STORMWIND, true);
|
||||
break;
|
||||
if (!spellClickHandled)
|
||||
return;
|
||||
|
||||
if (!me->GetUInt32Value(UNIT_NPC_FLAGS))
|
||||
return;
|
||||
|
||||
switch (me->GetArmor())
|
||||
{
|
||||
case ACTION_ILLUSION_DRAGONS:
|
||||
clicker->CastSpell(clicker, SPELL_TELEPORT_TO_CHAMBER, true);
|
||||
break;
|
||||
case ACTION_ILLUSION_ICECROWN:
|
||||
clicker->CastSpell(clicker, SPELL_TELEPORT_TO_ICECROWN, true);
|
||||
break;
|
||||
case ACTION_ILLUSION_STORMWIND:
|
||||
clicker->CastSpell(clicker, SPELL_TELEPORT_TO_STORMWIND, true);
|
||||
break;
|
||||
}
|
||||
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, 0);
|
||||
me->DespawnOrUnsummon(1000);
|
||||
}
|
||||
|
||||
creature->SetUInt32Value(UNIT_NPC_FLAGS, 0);
|
||||
creature->DespawnOrUnsummon(1000);
|
||||
return true;
|
||||
private:
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetUlduarAI<boss_yoggsaron_descend_portalAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -328,7 +328,10 @@ public:
|
||||
break;
|
||||
case NPC_HODIR:
|
||||
m_uiHodirGUID = creature->GetGUID();
|
||||
SpawnHodirChests(instance->GetDifficulty(), creature);
|
||||
if (m_auiEncounter[TYPE_HODIR] != DONE)
|
||||
{
|
||||
SpawnHodirChests(instance->GetDifficulty(), creature);
|
||||
}
|
||||
break;
|
||||
case NPC_THORIM:
|
||||
m_uiThorimGUID = creature->GetGUID();
|
||||
|
||||
@@ -209,14 +209,14 @@ public:
|
||||
me->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
me->SetUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT);
|
||||
me->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
}
|
||||
else
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT);
|
||||
me->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ public:
|
||||
me->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
me->SetUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT);
|
||||
me->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
events.RescheduleEvent(EVENT_RESURRECT, 12000);
|
||||
}
|
||||
}
|
||||
@@ -326,7 +326,7 @@ public:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT);
|
||||
me->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
events.RescheduleEvent(EVENT_RESURRECT_2, 3000);
|
||||
break;
|
||||
case EVENT_RESURRECT_2:
|
||||
|
||||
@@ -220,7 +220,7 @@ public:
|
||||
case DATA_UNLOCK_SKARVALD_LOOT:
|
||||
if( Creature* c = instance->GetCreature(NPC_SkarvaldGUID) )
|
||||
{
|
||||
c->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE | UNIT_DYNFLAG_TAPPED | UNIT_DYNFLAG_TAPPED_BY_PLAYER);
|
||||
c->SetDynamicFlag(UNIT_DYNFLAG_LOOTABLE | UNIT_DYNFLAG_TAPPED | UNIT_DYNFLAG_TAPPED_BY_PLAYER);
|
||||
c->SetLootMode(1);
|
||||
c->loot.clear();
|
||||
if (uint32 lootid = c->GetCreatureTemplate()->lootid)
|
||||
@@ -235,7 +235,7 @@ public:
|
||||
if( Creature* c = instance->GetCreature(NPC_DalronnGUID) )
|
||||
{
|
||||
c->AI()->DoAction(-1);
|
||||
c->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE | UNIT_DYNFLAG_TAPPED | UNIT_DYNFLAG_TAPPED_BY_PLAYER);
|
||||
c->SetDynamicFlag(UNIT_DYNFLAG_LOOTABLE | UNIT_DYNFLAG_TAPPED | UNIT_DYNFLAG_TAPPED_BY_PLAYER);
|
||||
c->SetLootMode(1);
|
||||
c->loot.clear();
|
||||
if (uint32 lootid = c->GetCreatureTemplate()->lootid)
|
||||
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
if (Unit* worm = me->FindNearestCreature(NPC_SCOURGED_BURROWER, 3.0f))
|
||||
{
|
||||
Unit::Kill(me, worm);
|
||||
worm->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
worm->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
phaseTimer = 2000;
|
||||
phase = 7;
|
||||
|
||||
@@ -417,7 +417,7 @@ public:
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
|
||||
me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->ReplaceAllDynamicFlags(UNIT_DYNFLAG_DEAD);
|
||||
}
|
||||
_phase = 0;
|
||||
}
|
||||
|
||||
@@ -15,19 +15,6 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Sholazar_Basin
|
||||
SD%Complete: 100
|
||||
SDComment: Quest support: 12570, 12573, 12621.
|
||||
SDCategory: Sholazar_Basin
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
npc_injured_rainspeaker_oracle
|
||||
npc_vekjik
|
||||
avatar_of_freya
|
||||
EndContentData */
|
||||
|
||||
#include "CombatAI.h"
|
||||
#include "PassiveAI.h"
|
||||
#include "Player.h"
|
||||
@@ -1505,6 +1492,38 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
enum ReturnedSevenfold
|
||||
{
|
||||
SPELL_FREYAS_WARD = 51845,
|
||||
SPELL_SEVENFOLD_RETRIBUTION = 51856,
|
||||
SPELL_DEATHBOLT = 51855
|
||||
};
|
||||
|
||||
class spell_q12611_deathbolt : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q12611_deathbolt);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
Unit* target = GetHitUnit();
|
||||
|
||||
if (target->HasAura(SPELL_FREYAS_WARD))
|
||||
{
|
||||
target->CastSpell(caster, SPELL_SEVENFOLD_RETRIBUTION, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
caster->CastSpell(target, SPELL_DEATHBOLT, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12611_deathbolt::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_sholazar_basin()
|
||||
{
|
||||
// Ours
|
||||
@@ -1526,4 +1545,6 @@ void AddSC_sholazar_basin()
|
||||
new spell_q12589_shoot_rjr();
|
||||
new npc_vics_flying_machine();
|
||||
new spell_shango_tracks();
|
||||
|
||||
RegisterSpellScript(spell_q12611_deathbolt);
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
{
|
||||
me->loot.clear();
|
||||
me->loot.FillLoot(me->GetCreatureTemplate()->lootid, LootTemplates_Creature, me->GetLootRecipient(), false, false, 1, me);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
me->SetDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
||||
_JustDied();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ public:
|
||||
_Reset();
|
||||
me->setActive(false);
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->CastSpell((Unit*)nullptr, SPELL_TARGET_OMEGA, false);
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_WARDENS_SHIELD), true);
|
||||
@@ -558,7 +558,7 @@ public:
|
||||
|
||||
case EVENT_WARDEN_INTRO29:
|
||||
events.Reset();
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
me->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
if (Creature* creature = summons.GetCreatureWithEntry(NPC_HARBINGER_SKYRISS))
|
||||
{
|
||||
|
||||
@@ -1802,7 +1802,7 @@ class spell_gen_creature_permanent_feign_death : public AuraScript
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
target->SetDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
target->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
target->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
|
||||
@@ -1813,7 +1813,7 @@ class spell_gen_creature_permanent_feign_death : public AuraScript
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
target->RemoveDynamicFlag(UNIT_DYNFLAG_DEAD);
|
||||
target->RemoveUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
|
||||
target->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
|
||||
@@ -1828,6 +1828,38 @@ class spell_gen_creature_permanent_feign_death : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
enum Teleporting
|
||||
{
|
||||
AREA_VIOLET_CITADEL_SPIRE = 4637,
|
||||
|
||||
SPELL_TELEPORT_SPIRE_DOWN = 59316,
|
||||
SPELL_TELEPORT_SPIRE_UP = 59314
|
||||
};
|
||||
|
||||
class spell_gen_teleporting : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_teleporting);
|
||||
|
||||
void HandleScript(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
Unit* target = GetHitUnit();
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
// return from top
|
||||
if (target->ToPlayer()->GetAreaId() == AREA_VIOLET_CITADEL_SPIRE)
|
||||
target->CastSpell(target, SPELL_TELEPORT_SPIRE_DOWN, true);
|
||||
// teleport atop
|
||||
else
|
||||
target->CastSpell(target, SPELL_TELEPORT_SPIRE_UP, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_teleporting::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
enum PvPTrinketTriggeredSpells
|
||||
{
|
||||
SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER = 72752,
|
||||
@@ -3827,7 +3859,7 @@ public:
|
||||
AreaTableEntry const* area = sAreaTableStore.LookupEntry(target->GetAreaId());
|
||||
// Xinef: add battlefield check
|
||||
Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId());
|
||||
if (!area || (canFly && ((area->flags & AREA_FLAG_NO_FLY_ZONE) || (Bf && !Bf->CanFlyIn()))))
|
||||
if ((area && canFly && (area->flags & AREA_FLAG_NO_FLY_ZONE)) || (Bf && !Bf->CanFlyIn()))
|
||||
canFly = false;
|
||||
|
||||
uint32 mount = 0;
|
||||
@@ -4452,6 +4484,7 @@ void AddSC_generic_spell_scripts()
|
||||
RegisterSpellScript(spell_gen_throw_shield);
|
||||
RegisterSpellScript(spell_gen_on_tournament_mount);
|
||||
RegisterSpellScript(spell_gen_tournament_pennant);
|
||||
RegisterSpellScript(spell_gen_teleporting);
|
||||
RegisterSpellScript(spell_gen_ds_flush_knockback);
|
||||
RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_default_count_pct_from_max_hp");
|
||||
RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_50pct_count_pct_from_max_hp", 50);
|
||||
|
||||
@@ -1369,6 +1369,27 @@ class spell_item_valanyr_hammer_of_ancient_kings : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
// 24590 - Brittle Armor
|
||||
enum BrittleArmor
|
||||
{
|
||||
SPELL_BRITTLE_ARMOR = 24575
|
||||
};
|
||||
|
||||
class spell_item_brittle_armor : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_item_brittle_armor);
|
||||
|
||||
void HandleScript(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
GetHitUnit()->RemoveAuraFromStack(SPELL_BRITTLE_ARMOR);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_item_brittle_armor::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
// 64411 - Blessing of Ancient Kings (Val'anyr, Hammer of Ancient Kings)
|
||||
enum BlessingOfAncientKings
|
||||
{
|
||||
@@ -1811,6 +1832,27 @@ std::array<uint32, 20> const CreateFortuneSpells =
|
||||
SPELL_CREATE_FORTUNE_16, SPELL_CREATE_FORTUNE_17, SPELL_CREATE_FORTUNE_18, SPELL_CREATE_FORTUNE_19, SPELL_CREATE_FORTUNE_20
|
||||
};
|
||||
|
||||
// 26465 - Mercurial Shield
|
||||
enum MercurialShield
|
||||
{
|
||||
SPELL_MERCURIAL_SHIELD = 26464
|
||||
};
|
||||
|
||||
class spell_item_mercurial_shield : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_item_mercurial_shield);
|
||||
|
||||
void HandleScript(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
GetHitUnit()->RemoveAuraFromStack(SPELL_MERCURIAL_SHIELD);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_item_mercurial_shield::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
// http://www.wowhead.com/item=32686 Mingo's Fortune Giblets
|
||||
// 40802 Mingo's Fortune Generator
|
||||
class spell_item_mingos_fortune_generator : public SpellScript
|
||||
@@ -3642,6 +3684,7 @@ void AddSC_item_spell_scripts()
|
||||
RegisterSpellScriptWithArgs(spell_item_trigger_spell, "spell_item_mithril_mechanical_dragonling", SPELL_MITHRIL_MECHANICAL_DRAGONLING);
|
||||
RegisterSpellScript(spell_item_aegis_of_preservation);
|
||||
RegisterSpellScript(spell_item_arcane_shroud);
|
||||
RegisterSpellScript(spell_item_brittle_armor);
|
||||
RegisterSpellScript(spell_item_blessing_of_ancient_kings);
|
||||
RegisterSpellScript(spell_item_valanyr_hammer_of_ancient_kings);
|
||||
RegisterSpellScriptWithArgs(spell_item_defibrillate, "spell_item_goblin_jumper_cables", 67, SPELL_GOBLIN_JUMPER_CABLES_FAIL);
|
||||
@@ -3655,6 +3698,7 @@ void AddSC_item_spell_scripts()
|
||||
RegisterSpellScript(spell_item_flask_of_the_north);
|
||||
RegisterSpellScript(spell_item_gnomish_death_ray);
|
||||
RegisterSpellScript(spell_item_make_a_wish);
|
||||
RegisterSpellScript(spell_item_mercurial_shield);
|
||||
RegisterSpellScript(spell_item_mingos_fortune_generator);
|
||||
RegisterSpellScript(spell_item_necrotic_touch);
|
||||
RegisterSpellScript(spell_item_net_o_matic);
|
||||
|
||||
@@ -1467,7 +1467,7 @@ class spell_symbol_of_life_dummy : public SpellScript
|
||||
if (target->HasAura(SPELL_PERMANENT_FEIGN_DEATH))
|
||||
{
|
||||
target->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH);
|
||||
target->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
|
||||
target->ReplaceAllDynamicFlags(0);
|
||||
target->ReplaceAllUnitFlags2(UNIT_FLAG2_NONE);
|
||||
target->SetHealth(target->GetMaxHealth() / 2);
|
||||
target->SetPower(POWER_MANA, uint32(target->GetMaxPower(POWER_MANA) * 0.75f));
|
||||
|
||||
@@ -1142,7 +1142,7 @@ public:
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IN_COMBAT);
|
||||
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->setDeathState(JUST_DIED);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, 32);
|
||||
me->SetDynamicFlag(32);
|
||||
|
||||
if (DoctorGUID)
|
||||
if (Creature* doctor = ObjectAccessor::GetCreature((*me), DoctorGUID))
|
||||
|
||||
@@ -1814,7 +1814,7 @@ NpcRegenHPTimeIfTargetIsUnreachable = 10
|
||||
# Racial Trait Swap, NPC - All Mounts Modules
|
||||
# Default: ""
|
||||
|
||||
Creatures.CustomIDs = "190010,55005,999991,25462,98888,601014"
|
||||
Creatures.CustomIDs = "190010,55005,999991,25462,98888,601014,34567,34568"
|
||||
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
Reference in New Issue
Block a user