Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ https://github.com/nwnxee/unified/compare/build8193.37.13...HEAD
- Creature: GetNumberOfBonusSpells(), ModifyNumberBonusSpells()

### Changed
- N/A
- Damage: Added bRangedAttack to the NWNX_Damage_AttackEventData struct.

### Deprecated
- N/A
Expand Down
4 changes: 3 additions & 1 deletion Plugins/Damage/Damage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct AttackData
uint8_t nAttackResult;
uint8_t nWeaponAttackType;
uint8_t nSneakAttack;
uint8_t bRanged;
uint8_t bRangedAttack;
int32_t bKillingBlow;
uint16_t nAttackType;
uint8_t nToHitRoll;
Expand Down Expand Up @@ -98,6 +98,7 @@ static void OnCombatAttack(CNWSCreature *pThis, CNWSObject *pTarget, const std::
s_AttackData.nAttackResult = pCombatAttackData->m_nAttackResult;
s_AttackData.nWeaponAttackType = pCombatAttackData->m_nWeaponAttackType;
s_AttackData.nSneakAttack = pCombatAttackData->m_bSneakAttack + (pCombatAttackData->m_bDeathAttack << 1);
s_AttackData.bRangedAttack = pCombatAttackData->m_bRangedAttack;
s_AttackData.bKillingBlow = pCombatAttackData->m_bKillingBlow;
s_AttackData.nAttackType = pCombatAttackData->m_nAttackType;
s_AttackData.nToHitRoll = pCombatAttackData->m_nToHitRoll;
Expand Down Expand Up @@ -184,6 +185,7 @@ NWNX_EXPORT ArgumentStack GetAttackEventData(ArgumentStack&&)
{
ArgumentStack stack;

ScriptAPI::InsertArgument(stack, s_AttackData.bRangedAttack);
ScriptAPI::InsertArgument(stack, s_AttackData.nToHitModifier);
ScriptAPI::InsertArgument(stack, s_AttackData.nToHitRoll);
ScriptAPI::InsertArgument(stack, s_AttackData.nAttackType);
Expand Down
4 changes: 3 additions & 1 deletion Plugins/Damage/NWScript/nwnx_damage.nss
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ struct NWNX_Damage_AttackEventData
int iAttackResult; ///< 1=hit, 2=parried, 3=critical hit, 4=miss, 5=resisted, 7=automatic hit, 8=concealed, 9=miss chance, 10=devastating crit
int iWeaponAttackType; ///< 1=main hand, 2=offhand, 3-5=creature, 6=extra(haste), 7=unarmed, 8=unarmed extra
int iSneakAttack; ///< 0=neither, 1=sneak attack, 2=death attack, 3=both
int iAttackType; ///< 65002=Attack of Opportunity, 65003=Riposte or a FeatID like KnockDown or some other special attack.
int bRangedAttack; /// TRUE if it is a ranged attack
int bKillingBlow; ///< TRUE if the hit is a killing blow
int iAttackType; ///< 65002=Attack of Opportunity, 65003=Riposte or a FeatID like KnockDown or some other special attack.
int iToHitRoll; ///< The to hit roll of the attack
int iToHitModifier; ///< The to hit modifier of the attack
};
Expand Down Expand Up @@ -311,6 +312,7 @@ struct NWNX_Damage_AttackEventData NWNX_Damage_GetAttackEventData()
data.iAttackType = NWNXPopInt();
data.iToHitRoll = NWNXPopInt();
data.iToHitModifier = NWNXPopInt();
data.bRangedAttack = NWNXPopInt();
return data;
}

Expand Down