SetNpcMaxMana: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Release G1R:MP 0.1.5 BUILD144 / Protocol 37; update availability and migration
Document planned 0.1.9 item stats, armor, runes and experimental map-editor seats/lights; not a release
Line 38: Line 38:
[[Category:Server Functions]]
[[Category:Server Functions]]
[[Category:NPC Functions]]
[[Category:NPC Functions]]
<!-- upcoming019:start -->
== Item-type armor bonuses (planned for 0.1.9) ==
[[Item type stats]] adds explicit armor bonusHealth/bonusMana/bonusStrength/bonusDexterity contributions for equipped scripted NPCs, plus the armor protection profile. Unconfigured native bonuses do not silently change existing NPC balance. Base stats and bonuses are separate; raising maxima does not heal/refill and lowering maxima clamps current values without reviving dead NPCs.
setNpcMaxHealth/setNpcMaxMana set BASE maxima; getNpcMaxHealth/getNpcMaxMana return EFFECTIVE maxima. setNpcCombatConfig/getNpcCombatConfig dexterity is BASE dexterity. getNpcData adds baseMaxHealth, baseMaxMana, baseDexterity, mana, maxMana, dexterity, armorHealthBonus, armorManaBonus, armorStrengthBonus and armorDexterityBonus.
NPC melee includes explicit armor strength and ranged combat uses effective dexterity. Numeric refresh preserves accepted attack/projectile snapshots; it does not reload ammo or restart prepared casts. NPC toughness and NPC jewelry are not implemented by this addition. These are extensions to existing APIs, not new names or a replacement for their earlier contracts. Not included in public 0.1.8.
<!-- upcoming019:end -->

Revision as of 20:11, 18 October 2026

setNpcMaxMana

AVAILABLE FROM UPDATE 0.1.5
This function is available in G1R:MP 0.1.5 and later. The contract below includes the compatibility guarantees introduced in that update.

Sets NPC maximum mana.

Syntax

setNpcMaxMana(npcId, maxMana)

Parameters

Name Type Required Description
npcId int yes Server-assigned NPC ID returned by spawnNpc; not a player ID.
maxMana number yes Finite 0..100000; clamps current mana, does not refill it.

Returns

Returns true when accepted, false for a rejected request. Acceptance is not proof of a rendered animation, projectile release or hit.

Examples

setNpcMaxMana(npcId, 100)

Notes

  • Server-side only. Mutations require the NPC to belong to the calling resource; getters do not grant control.
  • Since 0.1.5. Use the matching 0.1.5 client and server (Protocol 37).
  • Use matching updated client and server. See NPC scripting for lifecycle, defaults, combat examples and collision limitations.
  • May cancel pending preparation; increasing maximum does not refill current mana.

Item-type armor bonuses (planned for 0.1.9)

Item type stats adds explicit armor bonusHealth/bonusMana/bonusStrength/bonusDexterity contributions for equipped scripted NPCs, plus the armor protection profile. Unconfigured native bonuses do not silently change existing NPC balance. Base stats and bonuses are separate; raising maxima does not heal/refill and lowering maxima clamps current values without reviving dead NPCs.

setNpcMaxHealth/setNpcMaxMana set BASE maxima; getNpcMaxHealth/getNpcMaxMana return EFFECTIVE maxima. setNpcCombatConfig/getNpcCombatConfig dexterity is BASE dexterity. getNpcData adds baseMaxHealth, baseMaxMana, baseDexterity, mana, maxMana, dexterity, armorHealthBonus, armorManaBonus, armorStrengthBonus and armorDexterityBonus.

NPC melee includes explicit armor strength and ranged combat uses effective dexterity. Numeric refresh preserves accepted attack/projectile snapshots; it does not reload ammo or restart prepared casts. NPC toughness and NPC jewelry are not implemented by this addition. These are extensions to existing APIs, not new names or a replacement for their earlier contracts. Not included in public 0.1.8.