Difference between revisions of "Ability ApplyUpkeepEffects"

From Dragon Age Toolset Wiki
Jump to: navigation, search
m (Flagging for my attention)
m (Cleaning up prior to review)
Line 1: Line 1:
 
{{ToDoListItem|Sunjammer}}
 
{{ToDoListItem|Sunjammer}}
 
{{dafunction
 
{{dafunction
|name = Ability_ApplyUpkeepEffects
+
|name         = Ability_ApplyUpkeepEffects
|brief = {{undocumented}}
+
|brief         = {{undocumented}}
|param1type = object
+
|param1type   = object
|param1name = oCaster
+
|param1name   = oCaster
|param1desc = The Caster of the Ability on which the upkeep will be applied.
+
|param1desc   = The Caster of the Ability on which the upkeep will be applied.
 
|param1default =
 
|param1default =
|param2type = int
+
|param2type   = int
|param2name = nAbility
+
|param2name   = nAbility
|param2desc = The Ability itself.
+
|param2desc   = The Ability itself.
 
|param2default =
 
|param2default =
|param3type = effect
+
|param3type   = effect
|param3arra=true
+
|param3arra   = yes
|param3name = eEffects
+
|param3name   = eEffects
|param3desc = The Effects on which the upkeep come from.
+
|param3desc   = The Effects on which the upkeep come from.
 
|param3default =
 
|param3default =
|param4type = object
+
|param4type   = object
|param4name = oTarget
+
|param4name   = oTarget
|param4desc = The Target is the Caster. It is not needed to change the default value.
+
|param4desc   = The Target is the Caster. It is not needed to change the default value.
|param4default =OBJECT_INVALID
+
|param4default = OBJECT_INVALID
|param5type = int
+
|param5type   = int
|param5name = bPartywide
+
|param5name   = bPartywide
|param5desc = Is the Effect Partywide or not.
+
|param5desc   = Is the Effect party wide or not.
|param5default =FALSE
+
|param5default = FALSE
|returntype = void
+
|returntype   = void
|returndesc =  
+
|returndesc   =  
|sourcefile = ability_h
+
|sourcefile   = ability_h
|sourcemodule = Core Resources
+
|sourcemodule = Core Game Resources
 
}}
 
}}
  
Line 36: Line 36:
 
<!-- == Remarks == -->
 
<!-- == Remarks == -->
 
<!-- This section contains additional comments, observations and known issues. -->
 
<!-- This section contains additional comments, observations and known issues. -->
Ability_ApplyUpkeepEffects is more a Wrapper for _ApplyUpkeepEffect than a Function.
+
Ability_ApplyUpkeepEffects is more a Wrapper for [[_ApplyUpkeepEffect]] than a Function.
See [[_ApplyUpkeepEffect]] for more Informations.
+
  
 
<!-- == Examples == -->
 
<!-- == Examples == -->
Line 43: Line 42:
 
Here is some code from the function itself:
 
Here is some code from the function itself:
  
 +
<dascript>
 
     // as explained above, the Target becomes the Caster.  
 
     // as explained above, the Target becomes the Caster.  
     if (!IsObjectValid(oTarget))
+
     if(!IsObjectValid(oTarget))
 
     {
 
     {
 
         oTarget = oCaster;
 
         oTarget = oCaster;
Line 50: Line 50:
  
 
     // now loop through the Effects[i]
 
     // now loop through the Effects[i]
     for (i = 0; i < nCount; i++)
+
     for(i = 0; i < nCount; i++)
 
     {
 
     {
 
         _ApplyUpkeepEffect( oCaster, eEffects[i], nAbility, oTarget, bPartywide);
 
         _ApplyUpkeepEffect( oCaster, eEffects[i], nAbility, oTarget, bPartywide);
 
     }
 
     }
  
     // define the spells mana cost and talents stamina cost
+
     // define the spell's mana cost or talent's stamina cost
 
     effect eUpkeep = EffectUpkeep(UPKEEP_TYPE_MANASTAMINA , fCost, nAbility, oTarget, bPartywide);
 
     effect eUpkeep = EffectUpkeep(UPKEEP_TYPE_MANASTAMINA , fCost, nAbility, oTarget, bPartywide);
  
     // the last step is to apply the effect on the target(caster)
+
     // apply the effect on the target (caster)
 
     ApplyEffectOnObject(EFFECT_DURATION_TYPE_PERMANENT, eUpkeep, oCaster, 0.0f, oCaster, nAbility);
 
     ApplyEffectOnObject(EFFECT_DURATION_TYPE_PERMANENT, eUpkeep, oCaster, 0.0f, oCaster, nAbility);
 +
</dascript>
  
 
== See also ==
 
== See also ==
 
<!-- This section contains links to articles, functions or constant groups. -->
 
<!-- This section contains links to articles, functions or constant groups. -->
 
[[Ability_ApplyUpkeepEffect]]
 
[[Ability_ApplyUpkeepEffect]]

Revision as of 12:42, 26 April 2012


[Undocumented]

void Ability_ApplyUpkeepEffects(
object oCaster,
int nAbility,
effect[] eEffects,
object oTarget = OBJECT_INVALID,
int bPartywide = FALSE
);
Parameters:
oCaster
The Caster of the Ability on which the upkeep will be applied.
nAbility
The Ability itself.
eEffects
The Effects on which the upkeep come from.
oTarget
The Target is the Caster. It is not needed to change the default value.
bPartywide
Is the Effect party wide or not.
Returns:

Nothing.

Source:

Core Game Resources.ability_h

Upkeep effects are permanent until the effect is removed. They also set the UI-icon toggle inside the effect based on the ability ID.

Ability_ApplyUpkeepEffects is more a Wrapper for _ApplyUpkeepEffect than a Function.

Here is some code from the function itself:

    // as explained above, the Target becomes the Caster. 
    if(!IsObjectValid(oTarget))
    {
        oTarget = oCaster;
    }
 
    // now loop through the Effects[i]
    for(i = 0; i < nCount; i++)
    {
        _ApplyUpkeepEffect( oCaster, eEffects[i], nAbility, oTarget, bPartywide);
    }
 
    // define the spell's mana cost or talent's stamina cost
    effect eUpkeep = EffectUpkeep(UPKEEP_TYPE_MANASTAMINA , fCost, nAbility, oTarget, bPartywide);
 
    // apply the effect on the target (caster)
    ApplyEffectOnObject(EFFECT_DURATION_TYPE_PERMANENT, eUpkeep, oCaster, 0.0f, oCaster, nAbility);

See also

Ability_ApplyUpkeepEffect