Aller au contenu

Photo

IsModalAbilityActive()


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
FergusM

FergusM
  • Members
  • 460 messages
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?

#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
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

#3
FergusM

FergusM
  • Members
  • 460 messages
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

#4
Phaenan

Phaenan
  • Members
  • 315 messages

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. And both the field and the modal ability status seem directly checked by the actionscripts in the ability / quickbar UI movies, rather than by the DAScript bits. At least, it's apparently not checked in talent/spell_singletarget etc.

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 .