[Server] Add GetSpellsActiveStackingState() script function

pull/593/head
David Cernat 4 years ago
parent 014e4ab01f
commit ad3cd5e5fa

@ -148,6 +148,17 @@ const char* SpellFunctions::GetSpellsActiveDisplayName(unsigned short pid, unsig
return player->spellsActiveChanges.activeSpells.at(index).params.mDisplayName.c_str();
}
bool SpellFunctions::GetSpellsActiveStackingState(unsigned short pid, unsigned int index) noexcept
{
Player* player;
GET_PLAYER(pid, player, "");
if (index >= player->spellsActiveChanges.activeSpells.size())
return "invalid";
return player->spellsActiveChanges.activeSpells.at(index).isStackingSpell;
}
unsigned int SpellFunctions::GetSpellsActiveEffectCount(unsigned short pid, unsigned int index) noexcept
{
Player* player;

@ -20,6 +20,7 @@
{"GetSpellId", SpellFunctions::GetSpellId},\
{"GetSpellsActiveId", SpellFunctions::GetSpellsActiveId},\
{"GetSpellsActiveDisplayName", SpellFunctions::GetSpellsActiveDisplayName},\
{"GetSpellsActiveStackingState", SpellFunctions::GetSpellsActiveStackingState},\
{"GetSpellsActiveEffectCount", SpellFunctions::GetSpellsActiveEffectCount},\
{"GetSpellsActiveEffectId", SpellFunctions::GetSpellsActiveEffectId},\
{"GetSpellsActiveEffectArg", SpellFunctions::GetSpellsActiveEffectArg},\
@ -167,6 +168,15 @@ public:
*/
static const char* GetSpellsActiveDisplayName(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the spell stacking state at a certain index in a player's latest spells active changes.
*
* \param pid The player ID whose spells active changes should be used.
* \param index The index of the spell.
* \return The spell stacking state.
*/
static bool GetSpellsActiveStackingState(unsigned short pid, unsigned int index) noexcept;
/**
* \brief Get the number of effects at an index in a player's latest spells active changes.
*

Loading…
Cancel
Save