if (!Ability_IsModalAbility(nAbility) && (!bHasProjectile || (GetAbilityType(nAbility) == ABILITY_TYPE_ITEM)))
{
//---------------------------------------------------
// Insert code for character-specific potion cooldown
//---------------------------------------------------
int[] healthPotion;
healthPotion[0] = ABILITY_ITEM_LESSER_HEALTH_POULTICE;
healthPotion[1] = ABILITY_ITEM_HEALTH_POULTICE;
healthPotion[2] = ABILITY_ITEM_GREATER_HEALTH_POULTICE;
healthPotion[3] = ABILITY_ITEM_POTENT_HEALTH_POULTICE;
// checks if used ability is any of the above health potions
if (GetIntArrayIndex(healthPotion,nAbility) != -1) {
int nCount = 0;
int nMax = GetArraySize(healthPotion);
for (nCount = 0; nCount < nMax; nCount++) {
nAbility = healthPotion[nCount];
Ability_SetCooldown(oCaster, nAbility, oItem);
}
}
else {
Ability_SetCooldown(oCaster, nAbility, oItem); // this is normally the only line
}
For some reason its not applying the cooldown to anything but the potion I use.
A friend gave me a script which applies a cooldown of each potion, on each party member simultaneously (i.e. if Alistair uses a Lesser Health Poultice, it puts the LHP on cooldown for Morrigan, Dog and me at the same time), and it works fine. I can't figure out what the significant difference is between the two that would cause it not to work. That code is below
if (!Ability_IsModalAbility(nAbility) && (!bHasProjectile || (GetAbilityType(nAbility) == ABILITY_TYPE_ITEM)))
{
int[] potions;
potions[0] = ABILITY_ITEM_LESSER_HEALTH_POULTICE;
potions[1] = ABILITY_ITEM_HEALTH_POULTICE;
potions[2] = ABILITY_ITEM_GREATER_HEALTH_POULTICE;
potions[3] = ABILITY_ITEM_POTENT_HEALTH_POULTICE;
potions[4] = ABILITY_ITEM_LESSER_LYRIUM_POTION;
potions[5] = ABILITY_ITEM_LYRIUM_POTION;
potions[6] = ABILITY_ITEM_GREATER_LYRIUM_POTION;
potions[7] = ABILITY_ITEM_POTENT_LYRIUM_POTION;
// checks if used ability is any of the above potions
if (GetIntArrayIndex(potions,nAbility) != -1) {
// get party members
object[] oParty = GetPartyList(oCaster);
// cycle through party members
int nCount = 0;
int nMax = GetArraySize(oParty);
for (nCount = 0; nCount < nMax; nCount++) {
Ability_SetCooldown(oParty[nCount], nAbility, oItem);
}
}
else {
Ability_SetCooldown(oCaster, nAbility, oItem); // this is normally the only line
}
Is there something limiting being able to apply a cooldown to multiple abilities in the same function call?
Modifié par Bibdy, 12 décembre 2009 - 04:21 .





Retour en haut






