SetPlayerMana: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Automatyczna aktualizacja dokumentacji funkcji
 
Release 0.1.9 / BUILD264 / Protocol42: availability and download setup; preserve experimental limits
 
(2 intermediate revisions by the same user not shown)
Line 30: Line 30:
* This is a convenience wrapper around <code>setPlayerStat(playerId, "mana", value)</code>.
* This is a convenience wrapper around <code>setPlayerStat(playerId, "mana", value)</code>.


[[Category:Lua Functions]]
[[Category:Server Functions]]
[[Category:Server Functions]]
[[Category:Progression Functions]]
[[Category:Progression Functions]]
[[Category:Player Functions]]
[[Category:Player Functions]]
<!-- upcoming019:start -->
== Mana-state correction (from 0.1.9) ==
The 0.1.9 client clears a stale out-of-mana condition after a successful, verified positive mana assignment. This addresses casting remaining blocked despite the updated mana display, without requiring a game restart. Zero/insufficient mana still blocks ordinary paid casts; rune ownership, equipment, circle and other eligibility checks remain. This improves the existing mana setter; it is not a new Lua function. Separate custom rune manaCost profiles are described in [[Item type stats]] and remain under in-game qualification.
<!-- upcoming019:end -->

Latest revision as of 13:29, 20 October 2026

setPlayerMana

Sets a player's authoritative current mana value.

Syntax

bool setPlayerMana(int playerId, number value)

Parameters

Name Type Required Description
playerId int yes The connected player to update.
value number yes The new current mana value.

Returns

Returns true when the value is accepted; otherwise returns false.

Examples

Set a player's current mana:

setPlayerMana(playerId, 50)

Notes

  • Available only in server-side resource scripts.
  • This is a convenience wrapper around setPlayerStat(playerId, "mana", value).

Mana-state correction (from 0.1.9)

The 0.1.9 client clears a stale out-of-mana condition after a successful, verified positive mana assignment. This addresses casting remaining blocked despite the updated mana display, without requiring a game restart. Zero/insufficient mana still blocks ordinary paid casts; rune ownership, equipment, circle and other eligibility checks remain. This improves the existing mana setter; it is not a new Lua function. Separate custom rune manaCost profiles are described in Item type stats and remain under in-game qualification.