feat(Core/WorldState): improved WorldState scripting (#20141)

* implement world state script

based on
0b87ca9d9e

Co-authored-by: killerwife <killerwife@gmail.com>

* refactor to use onleave and onenter instead of spell_area

allows players to right click remove adal's buff

* add MapMgr.h

* refactor: use condition enum instead of uint32, prefix WORLD_STATE where needed

* remove lock from WorldState::Update

sWorldState->Update() is only called from World::Update

* remove unsafe SmartAI action of setWorldState

---------

Co-authored-by: killerwife <killerwife@gmail.com>
This commit is contained in:
Jelle Meeus
2024-11-12 16:15:27 +01:00
committed by GitHub
parent e80b0ce8b8
commit 3565e4a9eb
20 changed files with 785 additions and 37 deletions

View File

@@ -554,26 +554,6 @@ class spell_gen_rallying_cry_of_the_dragonslayer : public SpellScript
}
};
// 39953 - A'dal's Song of Battle
class spell_gen_adals_song_of_battle : public SpellScript
{
PrepareSpellScript(spell_gen_adals_song_of_battle);
void SelectTarget(std::list<WorldObject*>& targets)
{
targets.clear();
Map::PlayerList const& pList = GetCaster()->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
if (itr->GetSource()->GetZoneId() == 3703 /*Shattrath*/)
targets.push_back(itr->GetSource());
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gen_adals_song_of_battle::SelectTarget, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ALLY);
}
};
/* 15366 - Songflower Serenade
22888 - Rallying Cry of the Dragonslayer */
class spell_gen_disabled_above_63 : public AuraScript
@@ -5336,7 +5316,6 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_pet_hit_expertise_scalling);
RegisterSpellScript(spell_gen_grow_flower_patch);
RegisterSpellScript(spell_gen_rallying_cry_of_the_dragonslayer);
RegisterSpellScript(spell_gen_adals_song_of_battle);
RegisterSpellScript(spell_gen_disabled_above_63);
RegisterSpellScript(spell_gen_black_magic_enchant);
RegisterSpellScript(spell_gen_area_aura_select_players);