Difference between revisions of "Combat h.nss"
From Dragon Age Toolset Wiki
Dom Queron (Talk | contribs) |
Dom Queron (Talk | contribs) m |
||
Line 78: | Line 78: | ||
− | [[Category: | + | [[Category: Scripts]] |
Revision as of 02:30, 28 October 2009
Overview
Combat_h.nss handles the core rule resolution logic for non-talent combat interaction.
Notable Functions
Combat_CheckBackstab
// ----------------------------------------------------------------------------- // Check if backstab conditions are true // ----------------------------------------------------------------------------- int Combat_CheckBackstab(object oAttacker, object oTarget, object oWeapon, float fFlankingBonus) { // ------------------------------------------------------------------------- // If we we are a rogue // ------------------------------------------------------------------------- if (!HasAbility(oAttacker, ABILITY_TALENT_HIDDEN_ROGUE)) { return FALSE; } // ------------------------------------------------------------------------- // Only humanoid rigs have the backstab anim // ------------------------------------------------------------------------- if (!IsHumanoid(oAttacker)) { return FALSE; } // ------------------------------------------------------------------------- // And target is not immune // ------------------------------------------------------------------------- if (HasAbility(oTarget, ABILITY_TRAIT_CRITICAL_HIT_IMMUNITY)) { return FALSE; } // ------------------------------------------------------------------------- // And attacker does not use double strike mode // ------------------------------------------------------------------------- if (IsModalAbilityActive(oAttacker, ABILITY_TALENT_DUAL_WEAPON_DOUBLE_STRIKE)) { return FALSE; } // ------------------------------------------------------------------------- // We can only backstab if we are flanking. // ------------------------------------------------------------------------- if (fFlankingBonus>0.0) { return TRUE; } else { /* Coup de grace*/ if (HasAbility(oAttacker, ABILITY_TALENT_BACKSTAB)) { if (GetHasEffects(oTarget, EFFECT_TYPE_STUN)) { return TRUE; } else if (GetHasEffects(oTarget, EFFECT_TYPE_PARALYZE)) { return TRUE; } } } return FALSE; }