Attack¶
This module contains ctypes and functions required for interacting with Solstice’s and NWN’s internal combat attack data structures.
ctypes¶
Warning
The following ctypes must be syncronized with nwnx_solstice. If not bad, bad things will happen. Good news is it’s unlikely that will every be necessary.
-
DamageResult¶ Constructor
damage_result_tThis struct is used by the combat engine to when determining a damage roll. The length of the arrays is determined by the global DAMAGE_INDEX_NUM constant.
-
int32_t damages[DAMAGE_INDEX_NUM] Normal damage.
-
int32_t damages_unblocked[DAMAGE_INDEX_NUM] Unblockable damages.
-
int32_t immunity[DAMAGE_INDEX_NUM] Damage immunity adjustments.
-
int32_t resist[DAMAGE_INDEX_NUM] Damage resistance adjustments.
-
int32_t resist_remaining[DAMAGE_INDEX_NUM] Damage resistance remaining. This is to provide feedback for DamageResistance effects with limits.
-
int32_t
reduction¶ Damage reduction adjustment.
-
int32_t
reduction_remaining¶ Damage reduction remaining. This is to provide feedback for DamageReduction effects with limits.
-
int32_t
parry¶ Parry adjustment for servers using the Critical Hit Parry reduction designed by Higher Ground.
-
-
Attack¶ Information for an attack.
-
CNWSCreature*
attacker_nwn¶ Internal attacker object, unused in Lua.
-
CNWSObject*
target_nwn¶ Internal target object, unused in Lua.
-
CNWSCombatAttackData*
attack¶ Internal NWN attack data.
-
int32_t
weapon¶ EQUIP_TYPE_* of current weapon.
-
int32_t
ranged_type¶ RANGED_TYPE_*
-
uint32_t
target_state¶ Target state bitmask.
-
uint32_t
situational_flags¶ Situational bitmask.
-
double
target_distance¶ Distance to target.
-
bool
is_offhand¶ Is offhand attack.
-
bool
is_sneak¶ Is sneak attack.
-
bool
is_death¶ Is death attack.
-
bool
is_killing¶ Is killing blow.
-
int32_t
damage_total¶ Total damage done.
-
DamageResult
dmg_result¶ DamageResult ctype.
-
int32_t effects_to_remove[]
-
int32_t
effects_to_remove_len¶
-
CNWSCreature*
Functions¶
Note
When using these functions in performance critical code, you should cache them in local variables.
-
AddCCMessage(info, type, objs, ints, str)¶ Adds combat message to an attack.
Parameters: - info (
Attack) – Attack info.
- info (
-
AddDamageToResult(info, dmg, mult)¶ Add damage.
Parameters: - info (
Attack) – Attack info. - dmg –
DamageRoll - mult (int) – Multiplier for crits, etc.
- info (
-
AddEffect(info, attacker, eff)¶ Adds an onhit effect to an attack.
Parameters:
-
AddVFX(info, attacker, vfx)¶ Parameters:
-
CopyDamageToNWNAttackData(info, attacker, target)¶ Parameters:
-
SetConcealment(info, conceal)¶ Parameters: - info (
Attack) – Attack info. - conceal (int) – Concealment.
- info (