GetPlayerMana

From Gothic 2 Online: Wiki
Revision as of 15:06, 5 August 2019 by Marcinbar (talk | contribs) (Created page with "The function gets the hero or npc mana points. == Syntax == <syntaxhighlight lang="cpp"> int getPlayerMana(int id) </syntaxhighlight> === Required Arguments === * '''id''':...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The function gets the hero or npc mana points.

Syntax

int getPlayerMana(int id)

Required Arguments

  • id: The id of the npc or hero.

Returns

  • current mana value

Example

addEventHandler("onInit",function()
{
     setPlayerMana(heroId, 1000) // the function sets 1000 mana

     setPlayerMaxMana(heroId, getPlayerMana(heroId)) // the function sets max mana to get current mana.
});