<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://datoolset.net/mw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Copyright+Theft</id>
		<title>Dragon Age Toolset Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://datoolset.net/mw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Copyright+Theft"/>
		<link rel="alternate" type="text/html" href="http://datoolset.net/wiki/Special:Contributions/Copyright_Theft"/>
		<updated>2026-07-16T11:42:14Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.25.6</generator>

	<entry>
		<id>http://datoolset.net/mw/index.php?title=Combat_Rules&amp;diff=7579</id>
		<title>Combat Rules</title>
		<link rel="alternate" type="text/html" href="http://datoolset.net/mw/index.php?title=Combat_Rules&amp;diff=7579"/>
				<updated>2009-11-10T22:31:08Z</updated>
		
		<summary type="html">&lt;p&gt;Copyright Theft: /* Defense Rating */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''This page is work in progress'''&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
This page describes the technical implementation and flow of combat logic in the game scripts.&lt;br /&gt;
It deals mostly with weapon based combat, for spells and abilities, please see [[Ability|Abilities]].&lt;br /&gt;
&lt;br /&gt;
Note: The term 'property' used on this page refers to [[Creature Properties]].&lt;br /&gt;
&lt;br /&gt;
=== Detailed Description ===&lt;br /&gt;
&lt;br /&gt;
Combat in Dragon Age: Origin is handled mainly through scripts - the game engine itself has little knowledge of rule concepts such as 'Strength', 'Damage Modifier' or 'Armor Penetration'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Hit Resolution  ====&lt;br /&gt;
&lt;br /&gt;
Hit resolution is implemented in the function [[combat_h.nss#Combat_GetAttackResult|Combat_GetAttackResult]] in the script library [[combat_h.nss]], which is invoked from the [[creature_core.nss]] script whenever an attack event is received. The function returns one of several [[COMBAT_RESULT|COMBAT_RESULT_*]] constants and handles messaging to the game engine which animation to play.&lt;br /&gt;
&lt;br /&gt;
Overall, Dragon Age: Origin's combat system is 'hit heavy' as a target's armor does not modify its chance of getting hit.&lt;br /&gt;
&lt;br /&gt;
The simplified decision tree for to hit resolution is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if Target Is Placeable Object&lt;br /&gt;
  return COMBAT_RESULT_HIT&lt;br /&gt;
&lt;br /&gt;
if Target Displacement/Dodge &amp;lt; RandomF(100.0)&lt;br /&gt;
  return COMBAT_RESULT_MISS  &lt;br /&gt;
&lt;br /&gt;
if Attacker Is Using BASE_ITEM_TYPE_STAFF&lt;br /&gt;
  return COMBAT_RESULT_HIT&lt;br /&gt;
&lt;br /&gt;
bHit = RandomF(100.0) &amp;lt; AttackRating - DefenseRating&lt;br /&gt;
bCrit = CheckCricital()&lt;br /&gt;
bBackstab = CheckBackstab()&lt;br /&gt;
&lt;br /&gt;
if bHit&lt;br /&gt;
  if  HasEffect(attacker, EFFECT_TYPE_MISDIRECTION_HEX)&lt;br /&gt;
    if bCrit &lt;br /&gt;
      return COMBAT_RESULT_HIT&lt;br /&gt;
    else&lt;br /&gt;
      return COMBAT_RESULT_MISS&lt;br /&gt;
&lt;br /&gt;
  if bBackstab&lt;br /&gt;
    return COMBAT_RESULT_BACKSTAB&lt;br /&gt;
  else&lt;br /&gt;
    if bCrit&lt;br /&gt;
      return COMBAT_RESULT_CRITICAL_HIT&lt;br /&gt;
    else&lt;br /&gt;
      return  COMBAT_RESULT_HIT&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
  return COMBAT_RESULT_MISS&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Attack Rating =====&lt;br /&gt;
&lt;br /&gt;
Attack rating includes:&lt;br /&gt;
&lt;br /&gt;
* Base attack value (54.0f)&lt;br /&gt;
* + [[#Flanking Bonus Determination|Flanking Bonus]] (position based, modified by attacker and enemy talents and effects as well as shields. Rogues have a bonus here).&lt;br /&gt;
* + Distance based penalties (for ranged attacks)&lt;br /&gt;
* + Attacker's attack property value (this includes modifiers from buffs, etc.)&lt;br /&gt;
* + Any +attack item bonuses on the weapon that performs the attack.&lt;br /&gt;
* + Any external bonuses or penalties passed into the function (from talent scripts, etc.)&lt;br /&gt;
* + Difficulty setting based modifications&lt;br /&gt;
&lt;br /&gt;
===== Defense Rating =====&lt;br /&gt;
&lt;br /&gt;
Defense rating includes:&lt;br /&gt;
&lt;br /&gt;
* Defender defense value (and missile deflection if attack was ranged). This includes items, effects and magical bonus.&lt;br /&gt;
* Difficulty setting based modifications&lt;br /&gt;
&lt;br /&gt;
===== Flanking Bonus Determination =====&lt;br /&gt;
&lt;br /&gt;
* Flanking bonus is a floating point value that applies to both AttackRating and to the chance to score a critical hit.&lt;br /&gt;
* It is essentially a representation of how close the character is to the best position when attacking the enemy (directly in the back)&lt;br /&gt;
* Various shield abilities on the target reduce or prevent the attacker from getting the bonus.&lt;br /&gt;
* The further away the character is from that position, the more the bonus is diluted.&lt;br /&gt;
* The magnitude of the bonus ranges from +0 to +15 (+20 with combat_movement) and is applied to AttackRating and partially (1+(FlankingBonus/5)) to critical hit chance.&lt;br /&gt;
* Most characters only flank 60 degrees in each direction, combat movement allows an increase to 90 degrees (the full back 180).&lt;br /&gt;
* Only rogues get the full flanking bonus, everyone else still gets half.&lt;br /&gt;
* The full logic is implemented in the function [[combat_h.nss#Combat_GetFlankingBonus|Combat_GetFlankingBonus]] in [[combat_h.nss]].&lt;br /&gt;
&lt;br /&gt;
===== Backstab Determination =====&lt;br /&gt;
&lt;br /&gt;
* Backstab is determined for each melee attack only.&lt;br /&gt;
* Backstab requires the attacker to have a flanking bonus &amp;gt; 0 (some talents waive this restriction)&lt;br /&gt;
* Only creatures with the Rogue [[Classes|Character Class]] may backstab. This is a class benefit.&lt;br /&gt;
* Only humanoid attackers can backstab (this includes darkspawn)&lt;br /&gt;
* The full logic is implemented in the function [[combat_h.nss#Combat_CheckBackstab|Combat_CheckBackstab]] in [[combat_h.nss]].&lt;br /&gt;
* The damage logic is implemented in [[combat_damage_h.nss#Combat_Damage_GetBackstabDamage|Combat_Damage_GetBackstabDamage]].&lt;br /&gt;
&lt;br /&gt;
===== Critical Hit Determination =====&lt;br /&gt;
&lt;br /&gt;
* Critical Hit Chance uses the attackers Melee or Ranged critical hit modifier based on attack type.&lt;br /&gt;
* + the attacking weapon's critical hit modifier stat.&lt;br /&gt;
* + 1.20x (1.1x for non rogues) the attacker's [[#Flanking Bonus Determination|Flanking Bonus]] in the current situation.&lt;br /&gt;
* + 3.5 for each enemy past the 2nd that is fighting a warriors with the bravery talent.&lt;br /&gt;
* A critical hit occurs when the resulting CriticalHitChance is smaller than RandomFloat()*100.0f.&lt;br /&gt;
* Certain effects and spells (e.g. Death Hex) can always override the result, as will attacking from stealth (always hits critical).&lt;br /&gt;
* The logic is  implemented in the function [[combat_h.nss#Combat_GetAttackResult|Combat_GetAttackResult]] in the script library [[combat_h.nss]]&lt;br /&gt;
&lt;br /&gt;
==== Damage Resolution ====&lt;br /&gt;
&lt;br /&gt;
Damage resolution logic is implemented in the script [[combat_damage_h.nss]].&lt;br /&gt;
&lt;br /&gt;
===== Critical Hit Damage Modification =====&lt;br /&gt;
&lt;br /&gt;
* Critical hits increase the amount of damage done by an attack by a fixed multiplier.&lt;br /&gt;
* The magnitude of the multiplier can be affected by items and effects, but is not affected by of the character's attributes.&lt;br /&gt;
* Historical Note: Critical damage used to be variable 'up to...', but was changed to constant to provide a more predictable flow of damage.&lt;br /&gt;
* The logic for critical damage is implemented in [[combat_damage_h.nss#GetCriticalDamageModifier]].&lt;br /&gt;
&lt;br /&gt;
===== Backstab Damage Modification =====&lt;br /&gt;
&lt;br /&gt;
* Backstab damage is essentially identical to critical damage, but modified by certain rogue talents.&lt;br /&gt;
* The full logic is implemented [[combat_damage_h.nss#Combat_Damage_GetBackstabDamage|Combat_Damage_GetBackstabDamage]] in [[combat_damage_h.nss]].&lt;br /&gt;
&lt;br /&gt;
[[Category: Scripts]]&lt;/div&gt;</summary>
		<author><name>Copyright Theft</name></author>	</entry>

	</feed>