<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.datoolset.net/mw/index.php?action=history&amp;feed=atom&amp;title=Combat_PerformAttack</id>
		<title>Combat PerformAttack - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://www.datoolset.net/mw/index.php?action=history&amp;feed=atom&amp;title=Combat_PerformAttack"/>
		<link rel="alternate" type="text/html" href="https://www.datoolset.net/mw/index.php?title=Combat_PerformAttack&amp;action=history"/>
		<updated>2026-08-29T12:29:05Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.6</generator>

	<entry>
		<id>https://www.datoolset.net/mw/index.php?title=Combat_PerformAttack&amp;diff=16874&amp;oldid=prev</id>
		<title>Sunjammer: Fixing category</title>
		<link rel="alternate" type="text/html" href="https://www.datoolset.net/mw/index.php?title=Combat_PerformAttack&amp;diff=16874&amp;oldid=prev"/>
				<updated>2011-08-07T14:31:23Z</updated>
		
		<summary type="html">&lt;p&gt;Fixing category&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 14:31, 7 August 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L221&quot; &gt;Line 221:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 221:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/dascript&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/dascript&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Category: &lt;/del&gt;[[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Combat_H&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Category:Functions from combat_h&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sunjammer</name></author>	</entry>

	<entry>
		<id>https://www.datoolset.net/mw/index.php?title=Combat_PerformAttack&amp;diff=16539&amp;oldid=prev</id>
		<title>Mouser9169 at 05:56, 1 August 2011</title>
		<link rel="alternate" type="text/html" href="https://www.datoolset.net/mw/index.php?title=Combat_PerformAttack&amp;diff=16539&amp;oldid=prev"/>
				<updated>2011-08-01T05:56:47Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 05:56, 1 August 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L6&quot; &gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Variables:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Variables:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Returns:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Used for:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Used for:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mouser9169</name></author>	</entry>

	<entry>
		<id>https://www.datoolset.net/mw/index.php?title=Combat_PerformAttack&amp;diff=16525&amp;oldid=prev</id>
		<title>Mouser9169 at 05:28, 1 August 2011</title>
		<link rel="alternate" type="text/html" href="https://www.datoolset.net/mw/index.php?title=Combat_PerformAttack&amp;diff=16525&amp;oldid=prev"/>
				<updated>2011-08-01T05:28:43Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 05:28, 1 August 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Called by:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Called by:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Calls:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Parameters:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Parameters:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mouser9169</name></author>	</entry>

	<entry>
		<id>https://www.datoolset.net/mw/index.php?title=Combat_PerformAttack&amp;diff=16509&amp;oldid=prev</id>
		<title>Mouser9169: Created page with &quot;Called by:  Parameters:  Variables:  Used for: &lt;dascript&gt; /** *  @brief Handles processing an Attack Command * *  @param oAttacker       The command owner, usually OBJECT_SELF * ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.datoolset.net/mw/index.php?title=Combat_PerformAttack&amp;diff=16509&amp;oldid=prev"/>
				<updated>2011-08-01T04:50:40Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;Called by:  Parameters:  Variables:  Used for: &amp;lt;dascript&amp;gt; /** *  @brief Handles processing an Attack Command * *  @param oAttacker       The command owner, usually OBJECT_SELF * ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Called by:&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
&lt;br /&gt;
Variables:&lt;br /&gt;
&lt;br /&gt;
Used for:&lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
*  @brief Handles processing an Attack Command&lt;br /&gt;
*&lt;br /&gt;
*  @param oAttacker       The command owner, usually OBJECT_SELF&lt;br /&gt;
*  @param oTarget         The Target of the command&lt;br /&gt;
*&lt;br /&gt;
*  @returns CombatAttackResultStruct with damage and attackresult populated&lt;br /&gt;
*&lt;br /&gt;
*  &amp;quot;Don't touch this if you want to live&amp;quot;&lt;br /&gt;
*&lt;br /&gt;
*  @author Georg Zoeller&lt;br /&gt;
**/&lt;br /&gt;
struct CombatAttackResultStruct Combat_PerformAttack(object oAttacker, object oTarget, object oWeapon , float fDamageOverride = 0.0f, int nAbility = 0);&lt;br /&gt;
struct CombatAttackResultStruct Combat_PerformAttack(object oAttacker, object oTarget, object oWeapon ,  float fDamageOverride = 0.0f, int nAbility = 0)&lt;br /&gt;
{&lt;br /&gt;
    struct  CombatAttackResultStruct stRet;&lt;br /&gt;
    float   fDamage = 0.0f;&lt;br /&gt;
    int     nAttackType = Combat_GetAttackType(oAttacker, oWeapon);&lt;br /&gt;
&lt;br /&gt;
    stRet.fAttackDuration =    ATTACK_LOOP_DURATION_INVALID ;&lt;br /&gt;
&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    // Attack check happens here...&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
    stRet.nAttackResult = Combat_GetAttackResult(oAttacker, oTarget, oWeapon );&lt;br /&gt;
&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    // If attack result was not a miss, go on to calculate damage&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    if (stRet.nAttackResult != COMBAT_RESULT_MISS)&lt;br /&gt;
    {&lt;br /&gt;
        int bCriticalHit = (stRet.nAttackResult == COMBAT_RESULT_CRITICALHIT);&lt;br /&gt;
&lt;br /&gt;
        // -------------------------------------------------------------------------&lt;br /&gt;
        // If attack result was not a miss, check if we need to handle a deathblow&lt;br /&gt;
        // -------------------------------------------------------------------------&lt;br /&gt;
        fDamage = ( (fDamageOverride == 0.0f) ?&lt;br /&gt;
                          Combat_Damage_GetAttackDamage(oAttacker, oTarget, oWeapon, stRet.nAttackResult) : fDamageOverride);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        float fTargetHealth = GetCurrentHealth( oTarget );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        // -----------------------------------------------------------------&lt;br /&gt;
        //  Ranged weapons attacks are not synched and therefore we never&lt;br /&gt;
        //  need to worry about reporting deathblows to the engine.&lt;br /&gt;
        // ---------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
        // ---------------------------------------------------------------------&lt;br /&gt;
        // When not using a ranged weapon, there are synchronize death blows to handle&lt;br /&gt;
        // ---------------------------------------------------------------------&lt;br /&gt;
        if ( nAttackType != ATTACK_TYPE_RANGED &amp;amp;&amp;amp; nAbility == 0 &amp;amp;&amp;amp; stRet.nAttackResult != COMBAT_RESULT_MISS )&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
            // -----------------------------------------------------------------&lt;br /&gt;
            // Deathblows against doors look cool, but really...&lt;br /&gt;
            // -----------------------------------------------------------------&lt;br /&gt;
            if (  GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)&lt;br /&gt;
            {&lt;br /&gt;
&lt;br /&gt;
                // ---------------------------------------------------------&lt;br /&gt;
                // Special conditions.&lt;br /&gt;
                //&lt;br /&gt;
                // There are a few cases in the single player campaign&lt;br /&gt;
                // where we want the spectacular deathblow to occur if possible.&lt;br /&gt;
                //&lt;br /&gt;
                // The following logic defines these conditions&lt;br /&gt;
                // ---------------------------------------------------------&lt;br /&gt;
                int nAppearance =   GetAppearanceType(oTarget) ;&lt;br /&gt;
                int nRank       = GetCreatureRank(oTarget);&lt;br /&gt;
&lt;br /&gt;
                int bSpecial =   FALSE;&lt;br /&gt;
&lt;br /&gt;
                // ---------------------------------------------------------&lt;br /&gt;
                // ... all boss ogres (there's 1 in the official campaign) by request&lt;br /&gt;
                //     from Dr. Muzyka.&lt;br /&gt;
                // ... all elite bosses&lt;br /&gt;
                // ---------------------------------------------------------&lt;br /&gt;
                if ( (nAppearance == APR_TYPE_OGRE || (nRank == CREATURE_RANK_BOSS||nRank == CREATURE_RANK_ELITE_BOSS)  ) ||&lt;br /&gt;
                      nRank == CREATURE_RANK_ELITE_BOSS)&lt;br /&gt;
                {&lt;br /&gt;
                        // -------------------------------------------------&lt;br /&gt;
                        // ... but only if they are at the health threshold&lt;br /&gt;
                        //     required for deathblows to trigger&lt;br /&gt;
                        // -------------------------------------------------&lt;br /&gt;
                        if (IsHumanoid(oAttacker))&lt;br /&gt;
                        {&lt;br /&gt;
                            bSpecial = _GetRelativeResourceLevel(oTarget, PROPERTY_DEPLETABLE_HEALTH) &amp;lt; SPECIAL_BOSS_DEATHBLOW_THRESHOLD;&lt;br /&gt;
                        }&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                // ---------------------------------------------------------&lt;br /&gt;
                // Deathblows occur when&lt;br /&gt;
                //  ... target isn't immortal (duh) AND&lt;br /&gt;
                //      ... the damage of the hit exceeds the creature's health OR&lt;br /&gt;
                //      ... aforementioned 'special' conditions are met.&lt;br /&gt;
                // ---------------------------------------------------------&lt;br /&gt;
                if ( (!IsImmortal( oTarget ) &amp;amp;&amp;amp; (fDamage &amp;gt;= fTargetHealth || bSpecial)))&lt;br /&gt;
                {&lt;br /&gt;
&lt;br /&gt;
                    // -----------------------------------------------------&lt;br /&gt;
                    // ... only from party members AND&lt;br /&gt;
                    //    ... if we determine that a deathblow doesn't interrupt gameplay OR&lt;br /&gt;
                    //    ... aforementioned 'special' conditions are met&lt;br /&gt;
                    // -----------------------------------------------------&lt;br /&gt;
                    if (IsPartyMember(oAttacker) &amp;amp;&amp;amp; (CheckForDeathblow(oAttacker, oTarget) || bSpecial))&lt;br /&gt;
                    {&lt;br /&gt;
                        // -------------------------------------------------&lt;br /&gt;
                        // Verify some more conditions...&lt;br /&gt;
                        // -------------------------------------------------&lt;br /&gt;
                        int bDeathBlow = Combat_GetValidDeathblow(oAttacker, oTarget);&lt;br /&gt;
                        if (bDeathBlow)&lt;br /&gt;
                        {&lt;br /&gt;
                            stRet.nAttackResult = COMBAT_RESULT_DEATHBLOW ;&lt;br /&gt;
&lt;br /&gt;
                            // ---------------------------------------------&lt;br /&gt;
                            // Special treatment for ogre&lt;br /&gt;
                            // Reason: The ogre, unlike all other special bosses&lt;br /&gt;
                            //         has a second, non spectacular deathblow.&lt;br /&gt;
                            //         if we specify 0, there's a 50% chance that&lt;br /&gt;
                            //         one is played, which we don't want in this&lt;br /&gt;
                            //         case, so we're passing the id of the&lt;br /&gt;
                            //         spectacular one instead.&lt;br /&gt;
                            // ---------------------------------------------&lt;br /&gt;
                            if (bSpecial &amp;amp;&amp;amp; nAppearance == APR_TYPE_OGRE)&lt;br /&gt;
                            {&lt;br /&gt;
                                stRet.nDeathblowType = 5; // 5 - ogre slowmo deathblow&lt;br /&gt;
                            }&lt;br /&gt;
                            else&lt;br /&gt;
                            {&lt;br /&gt;
                                stRet.nDeathblowType = 0;  // 0 - auto select in engine;&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
                        }&lt;br /&gt;
                        else&lt;br /&gt;
                        {&lt;br /&gt;
                            // Failure to meet conditions: convert to hit.&lt;br /&gt;
                            if (stRet.nAttackResult != COMBAT_RESULT_BACKSTAB)&lt;br /&gt;
                            {&lt;br /&gt;
                                stRet.nAttackResult = COMBAT_RESULT_HIT;&lt;br /&gt;
                            }&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                    else&lt;br /&gt;
                    {&lt;br /&gt;
                        // Failure to meet conditions: convert to hit.&lt;br /&gt;
                        if (stRet.nAttackResult != COMBAT_RESULT_BACKSTAB)&lt;br /&gt;
                        {&lt;br /&gt;
                            stRet.nAttackResult = COMBAT_RESULT_HIT;&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                 } /* ishumanoid*/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            } /* obj_type creature*/&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
    int nDamageType = DAMAGE_TYPE_PHYSICAL;&lt;br /&gt;
&lt;br /&gt;
    if ( nAttackType == ATTACK_TYPE_RANGED)&lt;br /&gt;
    {&lt;br /&gt;
        // ---------------------------------------------------------------------&lt;br /&gt;
        // Certain projectiles modifyt the damage type done by a ranged weapon&lt;br /&gt;
        // This is defined in PRJ_BASE.&lt;br /&gt;
        // ---------------------------------------------------------------------&lt;br /&gt;
        int nProjectileIndex = GetLocalInt(oWeapon,PROJECTILE_OVERRIDE);&lt;br /&gt;
        if (nProjectileIndex)&lt;br /&gt;
        {&lt;br /&gt;
            int nDamageTypeOverride = GetM2DAInt(TABLE_PROJECTILES,&amp;quot;DamageType&amp;quot;,nProjectileIndex);&lt;br /&gt;
            if (nDamageTypeOverride&amp;gt;0)&lt;br /&gt;
            {&lt;br /&gt;
                nDamageType = nDamageTypeOverride;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // ---------------------------------------------------------------------&lt;br /&gt;
        // When using a ranged weapon, we need to report the duration of the&lt;br /&gt;
        // aim loop to the engine&lt;br /&gt;
        // ---------------------------------------------------------------------&lt;br /&gt;
        stRet.fAttackDuration = GetCreatureRangedDrawSpeed(oAttacker, oWeapon);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        float fSpeed = CalculateAttackTiming(oAttacker, oWeapon);&lt;br /&gt;
        if (fSpeed&amp;gt;0.0f)&lt;br /&gt;
        {&lt;br /&gt;
            stRet.fAttackDuration = fSpeed;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    // The Impact effect is not a real effect - it is not ever applied. Instead&lt;br /&gt;
    // it is used to marshal information about the attack back to the impact&lt;br /&gt;
    // event.&lt;br /&gt;
    // -------------------------------------------------------------------------&lt;br /&gt;
    stRet.eImpactEffect = EffectImpact(fDamage, oWeapon, 0, 0, nDamageType);&lt;br /&gt;
&lt;br /&gt;
    #ifdef DEBUG&lt;br /&gt;
    Log_Trace_Combat(&amp;quot;combat_h.Combat_PerformAttack&amp;quot;,&amp;quot; Attack Result: &amp;quot; + Log_GetAttackResultNameById(stRet.nAttackResult),  oAttacker, oTarget, LOG_CHANNEL_COMBAT_TOHIT );&lt;br /&gt;
    #endif&lt;br /&gt;
&lt;br /&gt;
    return stRet;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;br /&gt;
Category: [[Combat_H]]&lt;/div&gt;</summary>
		<author><name>Mouser9169</name></author>	</entry>

	</feed>