Compare commits

...

8 Commits

Author SHA1 Message Date
tabooo
080f28ccad
Merge ca10c7cbe245745719395be58077b8b5bd14dd6e into 9f99e89bc325c1a102a042eb07ccfdeb49625048 2025-02-25 01:30:34 -03:00
SaW
9f99e89bc3
fix(Core/Threading): Refactored Map class - some code optimization (#21288) 2025-02-24 15:49:54 -03:00
vrachv
b83071388c
fix(Scripts/SunwellPlateau) Fix flame touched stacking (#21594) 2025-02-24 11:49:33 -03:00
Andrew
f234f034a1
fix(Scripts/SunwellPlateau): Fix twins respawn (#21598) 2025-02-24 11:48:44 -03:00
tabooo
ca10c7cbe2 ### TITLE
## Type(Scope/Subscope): Commit ultra short explanation
## |---- Write below the examples with a maximum of 50 characters ----|
## Example 1: fix(DB/SAI): Missing spell to NPC Hogger
## Example 2: fix(CORE/Raid): Phase 2 of Ragnaros
## Example 3: feat(CORE/Commands): New GM command to do something
remove the brackets on one line if statements :)

### DESCRIPTION
## Explain why this change is being made, what does it fix etc...
## |---- Write below the examples with a maximum of 72 characters per lines ----|
## Example: Hogger (id: 492) was not charging player when being engaged.

## Provide links to any issue, commit, pull request or other resource
## Example 1: Closes AzerothCore issue #23
## Example 2: Ported from other project's commit (link)
## Example 3: References taken from wowpedia / wowhead / wowwiki / https://wowgaming.altervista.org/aowow/

### CO-AUTHOR(S)
## If there are more authors they can be mentioned like this
## Co-authored-by: name <name@example.com>

## =======================================================
##                     EXTRA INFOS
## =======================================================
## "Type" can be:
##    feat     (new feature)
##    fix      (bug fix)
##    refactor (refactoring production code)
##    style    (formatting, missing semi colons, etc; no code change)
##    docs     (changes to documentation)
##    test     (adding or refactoring tests; no production code change)
##    chore    (updating bash scripts, git files etc; no production code change)
## --------------------
## Remember to
##    Capitalize the subject line
##    Use the imperative mood in the subject line
##    Do not end the subject line with a period
##    Separate subject from body with a blank line
##    Use the body to explain what and why rather than how
##    Can use multiple lines with "-" for bullet points in body
## --------------------
## More info here https://www.conventionalcommits.org/en/v1.0.0-beta.2/
## =======================================================
## "Scope" can be:
##    CORE     (core related, c++)
##    DB       (database related, sql)
## =======================================================
## "Subscope" is optional and depends on the nature of the commit.
## =======================================================
2025-02-11 23:14:48 +04:00
tabooo
82a573699b ### TITLE
## Type(Scope/Subscope): Commit ultra short explanation
## |---- Write below the examples with a maximum of 50 characters ----|
## Example 1: fix(DB/SAI): Missing spell to NPC Hogger
## Example 2: fix(CORE/Raid): Phase 2 of Ragnaros
## Example 3: feat(CORE/Commands): New GM command to do something
whitespace remove

### DESCRIPTION
## Explain why this change is being made, what does it fix etc...
## |---- Write below the examples with a maximum of 72 characters per lines ----|
## Example: Hogger (id: 492) was not charging player when being engaged.

## Provide links to any issue, commit, pull request or other resource
## Example 1: Closes AzerothCore issue #23
## Example 2: Ported from other project's commit (link)
## Example 3: References taken from wowpedia / wowhead / wowwiki / https://wowgaming.altervista.org/aowow/

### CO-AUTHOR(S)
## If there are more authors they can be mentioned like this
## Co-authored-by: name <name@example.com>

## =======================================================
##                     EXTRA INFOS
## =======================================================
## "Type" can be:
##    feat     (new feature)
##    fix      (bug fix)
##    refactor (refactoring production code)
##    style    (formatting, missing semi colons, etc; no code change)
##    docs     (changes to documentation)
##    test     (adding or refactoring tests; no production code change)
##    chore    (updating bash scripts, git files etc; no production code change)
## --------------------
## Remember to
##    Capitalize the subject line
##    Use the imperative mood in the subject line
##    Do not end the subject line with a period
##    Separate subject from body with a blank line
##    Use the body to explain what and why rather than how
##    Can use multiple lines with "-" for bullet points in body
## --------------------
## More info here https://www.conventionalcommits.org/en/v1.0.0-beta.2/
## =======================================================
## "Scope" can be:
##    CORE     (core related, c++)
##    DB       (database related, sql)
## =======================================================
## "Subscope" is optional and depends on the nature of the commit.
## =======================================================
2025-02-11 22:59:48 +04:00
tabooo
8f30a36823 ### TITLE
## Type(Scope/Subscope): Commit ultra short explanation
## |---- Write below the examples with a maximum of 50 characters ----|
## Example 1: fix(DB/SAI): Missing spell to NPC Hogger
## Example 2: fix(CORE/Raid): Phase 2 of Ragnaros
## Example 3: feat(CORE/Commands): New GM command to do something
fix codestyle

### DESCRIPTION
## Explain why this change is being made, what does it fix etc...
## |---- Write below the examples with a maximum of 72 characters per lines ----|
## Example: Hogger (id: 492) was not charging player when being engaged.

## Provide links to any issue, commit, pull request or other resource
## Example 1: Closes AzerothCore issue #23
## Example 2: Ported from other project's commit (link)
## Example 3: References taken from wowpedia / wowhead / wowwiki / https://wowgaming.altervista.org/aowow/

### CO-AUTHOR(S)
## If there are more authors they can be mentioned like this
## Co-authored-by: name <name@example.com>

## =======================================================
##                     EXTRA INFOS
## =======================================================
## "Type" can be:
##    feat     (new feature)
##    fix      (bug fix)
##    refactor (refactoring production code)
##    style    (formatting, missing semi colons, etc; no code change)
##    docs     (changes to documentation)
##    test     (adding or refactoring tests; no production code change)
##    chore    (updating bash scripts, git files etc; no production code change)
## --------------------
## Remember to
##    Capitalize the subject line
##    Use the imperative mood in the subject line
##    Do not end the subject line with a period
##    Separate subject from body with a blank line
##    Use the body to explain what and why rather than how
##    Can use multiple lines with "-" for bullet points in body
## --------------------
## More info here https://www.conventionalcommits.org/en/v1.0.0-beta.2/
## =======================================================
## "Scope" can be:
##    CORE     (core related, c++)
##    DB       (database related, sql)
## =======================================================
## "Subscope" is optional and depends on the nature of the commit.
## =======================================================
2025-02-11 22:57:15 +04:00
tabooo
4fc4646d73 fix(Core/Spells): Druid Shapeshifting procs Omen of Clatiry
Druid talent Omen of Clatiry is proced by shapeshifting.

https://github.com/azerothcore/azerothcore-wotlk/issues/21401
2025-02-11 22:11:50 +04:00
3 changed files with 86 additions and 70 deletions

View File

@ -588,16 +588,20 @@ void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/)
if (t_diff)
_dynamicTree.update(t_diff);
/// update worldsessions for existing players
// Update world sessions and players
for (m_mapRefIter = m_mapRefMgr.begin(); m_mapRefIter != m_mapRefMgr.end(); ++m_mapRefIter)
{
Player* player = m_mapRefIter->GetSource();
if (player && player->IsInWorld())
{
//player->Update(t_diff);
// Update session
WorldSession* session = player->GetSession();
MapSessionFilter updater(session);
session->Update(s_diff, updater);
// update players at tick
if (!t_diff)
player->Update(s_diff);
}
}
@ -605,17 +609,6 @@ void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/)
if (!t_diff)
{
for (m_mapRefIter = m_mapRefMgr.begin(); m_mapRefIter != m_mapRefMgr.end(); ++m_mapRefIter)
{
Player* player = m_mapRefIter->GetSource();
if (!player || !player->IsInWorld())
continue;
// update players at tick
player->Update(s_diff);
}
HandleDelayedVisibility();
return;
}
@ -624,36 +617,35 @@ void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/)
resetMarkedCells();
resetMarkedCellsLarge();
// Prepare object updaters
Acore::ObjectUpdater updater(t_diff, false);
// for creature
TypeContainerVisitor<Acore::ObjectUpdater, GridTypeMapContainer > grid_object_update(updater);
// for pets
TypeContainerVisitor<Acore::ObjectUpdater, WorldTypeMapContainer > world_object_update(updater);
// For creature
TypeContainerVisitor<Acore::ObjectUpdater, GridTypeMapContainer> grid_object_update(updater);
// for large creatures
// For pets
TypeContainerVisitor<Acore::ObjectUpdater, WorldTypeMapContainer> world_object_update(updater);
// For large creatures
Acore::ObjectUpdater largeObjectUpdater(t_diff, true);
TypeContainerVisitor<Acore::ObjectUpdater, GridTypeMapContainer > grid_large_object_update(largeObjectUpdater);
TypeContainerVisitor<Acore::ObjectUpdater, WorldTypeMapContainer > world_large_object_update(largeObjectUpdater);
TypeContainerVisitor<Acore::ObjectUpdater, GridTypeMapContainer> grid_large_object_update(largeObjectUpdater);
TypeContainerVisitor<Acore::ObjectUpdater, WorldTypeMapContainer> world_large_object_update(largeObjectUpdater);
// pussywizard: container for far creatures in combat with players
std::vector<Creature*> updateList;
updateList.reserve(10);
// non-player active objects, increasing iterator in the loop in case of object removal
// Update non-player active objects
for (m_activeNonPlayersIter = m_activeNonPlayers.begin(); m_activeNonPlayersIter != m_activeNonPlayers.end();)
{
WorldObject* obj = *m_activeNonPlayersIter;
++m_activeNonPlayersIter;
if (!obj || !obj->IsInWorld())
continue;
VisitNearbyCellsOf(obj, grid_object_update, world_object_update, grid_large_object_update, world_large_object_update);
if (obj && obj->IsInWorld())
VisitNearbyCellsOf(obj, grid_object_update, world_object_update, grid_large_object_update, world_large_object_update);
}
// the player iterator is stored in the map object
// to make sure calls to Map::Remove don't invalidate it
// Update players and their associated objects
for (m_mapRefIter = m_mapRefMgr.begin(); m_mapRefIter != m_mapRefMgr.end(); ++m_mapRefIter)
{
Player* player = m_mapRefIter->GetSource();
@ -661,12 +653,10 @@ void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/)
if (!player || !player->IsInWorld())
continue;
// update players at tick
player->Update(s_diff);
VisitNearbyCellsOfPlayer(player, grid_object_update, world_object_update, grid_large_object_update, world_large_object_update);
// If player is using far sight, visit that object too
// If player is using far sight, update viewpoint
if (WorldObject* viewPoint = player->GetViewpoint())
{
if (Creature* viewCreature = viewPoint->ToCreature())
@ -684,7 +674,8 @@ void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/)
{
updateList.clear();
float rangeSq = player->GetGridActivationRange() - 1.0f;
rangeSq = rangeSq * rangeSq;
rangeSq *= rangeSq;
HostileReference* ref = player->getHostileRefMgr().getFirst();
while (ref)
{
@ -694,20 +685,20 @@ void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/)
updateList.push_back(cre);
ref = ref->next();
}
for (std::vector<Creature*>::const_iterator itr = updateList.begin(); itr != updateList.end(); ++itr)
VisitNearbyCellsOf(*itr, grid_object_update, world_object_update, grid_large_object_update, world_large_object_update);
for (Creature* cre : updateList)
VisitNearbyCellsOf(cre, grid_object_update, world_object_update, grid_large_object_update, world_large_object_update);
}
}
for (_transportsUpdateIter = _transports.begin(); _transportsUpdateIter != _transports.end();) // pussywizard: transports updated after VisitNearbyCellsOf, grids around are loaded, everything ok
// Update transports - pussywizard: transports updated after VisitNearbyCellsOf, grids around are loaded, everything ok
for (_transportsUpdateIter = _transports.begin(); _transportsUpdateIter != _transports.end();)
{
MotionTransport* transport = *_transportsUpdateIter;
++_transportsUpdateIter;
if (!transport->IsInWorld())
continue;
transport->Update(t_diff);
if (transport->IsInWorld())
transport->Update(t_diff);
}
SendObjectUpdates();
@ -1674,14 +1665,16 @@ bool Map::IsUnderWater(uint32 phaseMask, float x, float y, float z, float collis
bool Map::HasEnoughWater(WorldObject const* searcher, float x, float y, float z) const
{
LiquidData const& liquidData = const_cast<Map*>(this)->GetLiquidData(searcher->GetPhaseMask(), x, y, z, searcher->GetCollisionHeight(), MAP_ALL_LIQUIDS);
return (liquidData.Status & MAP_LIQUID_STATUS_SWIMMING) != 0 && HasEnoughWater(searcher, liquidData);
}
LiquidData const& liquidData = const_cast<Map*>(this)->GetLiquidData(
searcher->GetPhaseMask(), x, y, z, searcher->GetCollisionHeight(), MAP_ALL_LIQUIDS);
if ((liquidData.Status & MAP_LIQUID_STATUS_SWIMMING) == 0)
return false;
bool Map::HasEnoughWater(WorldObject const* searcher, LiquidData const& liquidData) const
{
float minHeightInWater = searcher->GetMinHeightInWater();
return liquidData.Level > INVALID_HEIGHT && liquidData.Level > liquidData.DepthLevel && liquidData.Level - liquidData.DepthLevel >= minHeightInWater;
return liquidData.Level > INVALID_HEIGHT &&
liquidData.Level > liquidData.DepthLevel &&
liquidData.Level - liquidData.DepthLevel >= minHeightInWater;
}
char const* Map::GetMapName() const

View File

@ -22,6 +22,7 @@
#include "SpellInfo.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "SpellAuraEffects.h"
#include "sunwell_plateau.h"
enum Quotes
@ -83,6 +84,10 @@ struct boss_sacrolash : public BossAI
_isSisterDead = false;
BossAI::Reset();
me->SetLootMode(0);
if (Creature* alythess = instance->GetCreature(DATA_ALYTHESS))
if (!alythess->IsAlive())
alythess->Respawn(true);
}
void DoAction(int32 param) override
@ -104,18 +109,6 @@ struct boss_sacrolash : public BossAI
}
}
void EnterEvadeMode(EvadeReason why) override
{
BossAI::EnterEvadeMode(why);
if (Creature* alythess = instance->GetCreature(DATA_ALYTHESS))
{
if (!alythess->IsAlive())
alythess->Respawn(true);
else if (!alythess->IsInEvadeMode())
alythess->AI()->EnterEvadeMode(why);
}
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
@ -191,6 +184,10 @@ struct boss_alythess : public BossAI
_isSisterDead = false;
BossAI::Reset();
me->SetLootMode(0);
if (Creature* sacrolash = instance->GetCreature(DATA_SACROLASH))
if (!sacrolash->IsAlive())
sacrolash->Respawn(true);
}
void DoAction(int32 param) override
@ -212,18 +209,6 @@ struct boss_alythess : public BossAI
}
}
void EnterEvadeMode(EvadeReason why) override
{
BossAI::EnterEvadeMode(why);
if (Creature* sacrolash = instance->GetCreature(DATA_SACROLASH))
{
if (!sacrolash->IsAlive())
sacrolash->Respawn(true);
else if (!sacrolash->IsInEvadeMode())
sacrolash->AI()->EnterEvadeMode(why);
}
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
@ -381,8 +366,15 @@ public:
return ValidateSpellInfo({ _touchSpell });
}
void OnPeriodic(AuraEffect const* /*aurEff*/)
void OnPeriodic(AuraEffect const* aurEff)
{
if (aurEff->GetId() == SPELL_FLAME_SEAR)
{
uint32 tick = aurEff->GetTickNumber();
if (tick % 2 != 0 || tick > 10)
return;
}
if (Unit* owner = GetOwner()->ToUnit())
owner->CastSpell(owner, _touchSpell, true);
}

View File

@ -64,7 +64,14 @@ enum DruidSpells
enum DruidIcons
{
SPELL_ICON_REVITALIZE = 2862
SPELL_ICON_REVITALIZE = 2862,
SPELL_ICON_FUROR = 210,
SPELL_ICON_MOONKINAURA = 46, // SpellId: 24907
SPELL_ICON_MASTER_SHAPESHIFTER = 2851, // SpellId: 48421
SPELL_ICON_NURTURING_INSTINCT = 2254, // SpellId: 47180
SPELL_ICON_FERAL_SWIFTNESS_PASSIVE_2A = 67, // SpellId: 24864
SPELL_ICON_LEADER_OF_THE_PACK = 312, //SpellId: 24932
SPELL_ICON_TREE_OF_LIFE = 2257 //SpellId: 34123
};
// 1178 - Bear Form (Passive)
@ -223,6 +230,24 @@ class spell_dru_omen_of_clarity : public AuraScript
if (spellInfo->SpellFamilyName == SPELLFAMILY_DRUID)
{
// Exclude shapeshifting
if (spellInfo->SpellIconID == SPELL_ICON_MOONKINAURA)
return false;
if (spellInfo->SpellIconID == SPELL_ICON_MASTER_SHAPESHIFTER)
return false;
if (spellInfo->SpellIconID == SPELL_ICON_NURTURING_INSTINCT)
return false;
if (spellInfo->SpellIconID == SPELL_ICON_FERAL_SWIFTNESS_PASSIVE_2A)
return false;
if (spellInfo->SpellIconID == SPELL_ICON_LEADER_OF_THE_PACK)
return false;
if (spellInfo->SpellIconID == SPELL_ICON_TREE_OF_LIFE)
return false;
return !spellInfo->HasAura(SPELL_AURA_MOD_SHAPESHIFT);
}
@ -235,6 +260,12 @@ class spell_dru_omen_of_clarity : public AuraScript
return false;
}
// Furor 210
if (spellInfo->SpellIconID == SPELL_ICON_FUROR)
{
return false;
}
return true;
}