Skip to content

Commit

Permalink
Scripts: Implement SCRIPT_FLAG_COMMAND_ADDITIONAL for SCRIPT_COMMAND_…
Browse files Browse the repository at this point in the history
…CAST_SPELL to pass nullptr target
  • Loading branch information
killerwife committed Feb 14, 2024
1 parent 7fb0362 commit 98c85db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/script_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ Defining a buddy could be done in several way:
* datalong = spell id
* datalong2 = TriggerCastFlags
* dataint1-dataint4 optional. If some of these are set to a spell id, a random spell out of datalong, datint1, ..,dataintX is cast.
* data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL: do not pass target to spellcast

16 SCRIPT_COMMAND_PLAY_SOUND source = any object, target=any/player
* datalong = sound_id
Expand Down
4 changes: 3 additions & 1 deletion src/game/DBScripts/ScriptMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2120,7 +2120,9 @@ bool ScriptAction::ExecuteDbscriptCommand(WorldObject* pSource, WorldObject* pTa

SpellEntry const* spellInfo = sSpellTemplate.LookupEntry<SpellEntry>(spellId);
if (spellInfo->HasAttribute(SPELL_ATTR_EX_EXCLUDE_CASTER) && pTarget == pSource)
pTarget = nullptr; // TODO: Add mechanism to opt not sending target
pTarget = nullptr;
if (m_script->data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL)
pTarget = nullptr;

// TODO: when GO cast implemented, code below must be updated accordingly to also allow GO spell cast
if (pSource && pSource->IsGameObject())
Expand Down

0 comments on commit 98c85db

Please sign in to comment.