[Server] Add stackingState arg to script functions adding active spells

This commit is contained in:
David Cernat 2021-10-03 01:39:07 +02:00
parent 06451c13d5
commit 7193d1dca5
4 changed files with 8 additions and 4 deletions

View File

@ -489,10 +489,11 @@ void ActorFunctions::UnequipActorItem(unsigned short slot) noexcept
ActorFunctions::EquipActorItem(slot, "", 0, -1, -1); ActorFunctions::EquipActorItem(slot, "", 0, -1, -1);
} }
void ActorFunctions::AddActorSpellActive(const char* spellId, const char* displayName) noexcept void ActorFunctions::AddActorSpellActive(const char* spellId, const char* displayName, bool stackingState) noexcept
{ {
mwmp::ActiveSpell spell; mwmp::ActiveSpell spell;
spell.id = spellId; spell.id = spellId;
spell.isStackingSpell = stackingState;
spell.params.mDisplayName = displayName; spell.params.mDisplayName = displayName;
spell.params.mEffects = storedActorActiveEffects; spell.params.mEffects = storedActorActiveEffects;

View File

@ -879,9 +879,10 @@ public:
* *
* \param spellId The spellId of the spell. * \param spellId The spellId of the spell.
* \param displayName The displayName of the spell. * \param displayName The displayName of the spell.
* \param stackingState Whether the spell should stack with other instances of itself.
* \return void * \return void
*/ */
static void AddActorSpellActive(const char* spellId, const char* displayName) noexcept; static void AddActorSpellActive(const char* spellId, const char* displayName, bool stackingState) noexcept;
/** /**
* \brief Add a new effect to the next active spell that will be added to the temporary actor * \brief Add a new effect to the next active spell that will be added to the temporary actor

View File

@ -101,13 +101,14 @@ void SpellFunctions::AddSpell(unsigned short pid, const char* spellId) noexcept
player->spellbookChanges.spells.push_back(spell); player->spellbookChanges.spells.push_back(spell);
} }
void SpellFunctions::AddSpellActive(unsigned short pid, const char* spellId, const char* displayName) noexcept void SpellFunctions::AddSpellActive(unsigned short pid, const char* spellId, const char* displayName, bool stackingState) noexcept
{ {
Player* player; Player* player;
GET_PLAYER(pid, player, ); GET_PLAYER(pid, player, );
mwmp::ActiveSpell spell; mwmp::ActiveSpell spell;
spell.id = spellId; spell.id = spellId;
spell.isStackingSpell = stackingState;
spell.params.mDisplayName = displayName; spell.params.mDisplayName = displayName;
spell.params.mEffects = storedActiveEffects; spell.params.mEffects = storedActiveEffects;

View File

@ -155,9 +155,10 @@ public:
* \param pid The player ID whose spells active changes should be used. * \param pid The player ID whose spells active changes should be used.
* \param spellId The spellId of the spell. * \param spellId The spellId of the spell.
* \param displayName The displayName of the spell. * \param displayName The displayName of the spell.
* \param stackingState Whether the spell should stack with other instances of itself.
* \return void * \return void
*/ */
static void AddSpellActive(unsigned short pid, const char* spellId, const char* displayName) noexcept; static void AddSpellActive(unsigned short pid, const char* spellId, const char* displayName, bool stackingState) noexcept;
/** /**
* \brief Add a new effect to the next active spell that will be added to a player. * \brief Add a new effect to the next active spell that will be added to a player.