mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-10-05 11:56:31 +00:00
[Server] Add GetSpellsActiveStackingState() script function
This commit is contained in:
parent
014e4ab01f
commit
ad3cd5e5fa
2 changed files with 21 additions and 0 deletions
|
@ -148,6 +148,17 @@ const char* SpellFunctions::GetSpellsActiveDisplayName(unsigned short pid, unsig
|
||||||
return player->spellsActiveChanges.activeSpells.at(index).params.mDisplayName.c_str();
|
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
|
unsigned int SpellFunctions::GetSpellsActiveEffectCount(unsigned short pid, unsigned int index) noexcept
|
||||||
{
|
{
|
||||||
Player* player;
|
Player* player;
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
{"GetSpellId", SpellFunctions::GetSpellId},\
|
{"GetSpellId", SpellFunctions::GetSpellId},\
|
||||||
{"GetSpellsActiveId", SpellFunctions::GetSpellsActiveId},\
|
{"GetSpellsActiveId", SpellFunctions::GetSpellsActiveId},\
|
||||||
{"GetSpellsActiveDisplayName", SpellFunctions::GetSpellsActiveDisplayName},\
|
{"GetSpellsActiveDisplayName", SpellFunctions::GetSpellsActiveDisplayName},\
|
||||||
|
{"GetSpellsActiveStackingState", SpellFunctions::GetSpellsActiveStackingState},\
|
||||||
{"GetSpellsActiveEffectCount", SpellFunctions::GetSpellsActiveEffectCount},\
|
{"GetSpellsActiveEffectCount", SpellFunctions::GetSpellsActiveEffectCount},\
|
||||||
{"GetSpellsActiveEffectId", SpellFunctions::GetSpellsActiveEffectId},\
|
{"GetSpellsActiveEffectId", SpellFunctions::GetSpellsActiveEffectId},\
|
||||||
{"GetSpellsActiveEffectArg", SpellFunctions::GetSpellsActiveEffectArg},\
|
{"GetSpellsActiveEffectArg", SpellFunctions::GetSpellsActiveEffectArg},\
|
||||||
|
@ -167,6 +168,15 @@ public:
|
||||||
*/
|
*/
|
||||||
static const char* GetSpellsActiveDisplayName(unsigned short pid, unsigned int index) noexcept;
|
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.
|
* \brief Get the number of effects at an index in a player's latest spells active changes.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue