I was wondering how IsModalAbilityActive checks if a modal ability is active. The spellscripts for modal abilities apply effects (like stamina upkeep, damage buffs, etc) when a modal ability activate event is sent, then remove those effects when a deactivate event is sent. But how does the engine figure out what abilities are currently active?
IsModalAbilityActive()
Débuté par
FergusM
, nov. 30 2010 09:44
#1
Posté 30 novembre 2010 - 09:44
#2
Posté 02 décembre 2010 - 07:25
Every ability effect applied on an object is tied to the ability ID and modal abilities are applied with EFFECT_TYPE_UPKEEP effect on the caster (since the actual effects can be applied on other objects)
The below code will return all effects that are maintained by a given object (oCaster) and tied to an ability ID (if no nAbilityID is given, returns everything)
effect [] effects = GetEffects(oCaster, EFFECT_TYPE_UPKEEP, nAbilityId );
You can navigate the execution flow starting at talent_modal and going through effect_upkeep_h
The below code will return all effects that are maintained by a given object (oCaster) and tied to an ability ID (if no nAbilityID is given, returns everything)
effect [] effects = GetEffects(oCaster, EFFECT_TYPE_UPKEEP, nAbilityId );
You can navigate the execution flow starting at talent_modal and going through effect_upkeep_h
#3
Posté 02 décembre 2010 - 08:40
I meant more, how does the game know which modes are active for things like Beserk or Blood Magic, where certain abilities can only be used then; I didn't see any relevant effects.
Happily, it appears that the answer is using the function Engine_SetModalAbilityGUI
Happily, it appears that the answer is using the function Engine_SetModalAbilityGUI
#4
Posté 03 décembre 2010 - 06:46
FergusM wrote...
I meant more, how does the game know which modes are active for things like Beserk or Blood Magic, where certain abilities can only be used then; I didn't see any relevant effects.
Is the ABI_base condition_mode field what you're looking for ? It's the bit stating whether an ability requires a model ability to be active.
Edit :
Georg's comment in the ability_h Ability_CheckUseConditions() states the function was to be included directly in the engine at some point, but it seems to be used in ability_core, which is normally invoked by the engine each time an ability is used. So that may be where the check actually occurs.
Modifié par Phaenan, 03 décembre 2010 - 07:02 .





Retour en haut






