I'm looking for an easy way to reset the cooldowns on all my party's abilities. My thinking was basically get creature, get an array of its abilties, iterate through array, setting cooldown to 0. However, I can't locate something that will give me the creature's current abilities. I happen to know what they all are, so I could just enter the IDs manually, but that seems pretty messy.
Alternatively, if there is a function that just straight up resets all cooldowns, that would work too.
Function to return all of a creature's abilities?
Débuté par
FergusM
, févr. 22 2010 12:37
#1
Posté 22 février 2010 - 12:37
#2
Posté 22 février 2010 - 03:53
I still not used it but i think this should works: SetCooldown().
#3
Posté 22 février 2010 - 08:16
That will set the cooldown of a particular ability but the challenge is getting the ability ID to give to that function.
#4
Posté 22 février 2010 - 08:39
GetAbilityList should work for you.
#5
Posté 22 février 2010 - 10:16
I am hopeless. I cannot find GetAbilityList. What script is it from?
#6
Posté 23 février 2010 - 01:43
Hrm... it might be a function that is coming, but not in currently. I'm not spotting it in my toolset at home.
#7
Posté 23 février 2010 - 02:03
I suppose I'll just manually input the IDs for each ability. It would definitely be a handy function to have, though.
#8
Posté 23 février 2010 - 02:53
I haven't played with it, but this might (or might not) let you do what you want if you use ABILITY_CONDITION_NONE. From player_core:
// Disable modal abilities that have their condition changed. // #define ABILITY_CONDITION_NONE 0x0 // #define ABILITY_CONDITION_MELEEWEAPON 0x1 // #define ABILITY_CONDITION_SHIELD 0x2 // #define ABILITY_CONDITION_RANGEDWEAPON 0x4 // #define ABILITY_CONDITION_BEHINDTARGET 0x8 // #define ABILITY_CONDITION_DUALWEAPONS 0x040 // #define ABILITY_CONDITION_2HWEAPON 0x080 // ------------------------------------------------------------------------- int[] abi = GetConditionedAbilities(OBJECT_SELF, 0xC7);
Modifié par Craig Graff, 23 février 2010 - 02:54 .
#9
Posté 23 février 2010 - 03:48
object oGuy = GetObjectByTag("guy");
int[] abilities = GetConditionedAbilities(oGuy,0x0);
DisplayStatusMessage(IntToString(GetArraySize(abilities)));
Tells me that its a size 0 array. Tried it with 0x4 (he has ranged talents), but same result. Given that it's used in player_core, it's obviously working but I can't see what I'm doing wrong. I'm definitely getting the creature object.
int[] abilities = GetConditionedAbilities(oGuy,0x0);
DisplayStatusMessage(IntToString(GetArraySize(abilities)));
Tells me that its a size 0 array. Tried it with 0x4 (he has ranged talents), but same result. Given that it's used in player_core, it's obviously working but I can't see what I'm doing wrong. I'm definitely getting the creature object.
#10
Posté 23 février 2010 - 02:43
I don't know if is it possible to extract all the abilities of abi_base, but if possible, then you can test if the follower has the abilities you extracted with the function int HasAbility( object oCreature, int nABI_base_Ability ) and set its cooldown with the SetCooldown().
#11
Posté 23 février 2010 - 03:34
Here is a function I use to learn all abilities. You can take inspiration from it :
[color="#99ccff"]int[/color] nSpells = GetM2DARows(TABLE_ABILITIES_SPELLS);
[color="#99ccff"]int[/color] nRow;
[color="#99ccff"]int[/color] nID;
[color="#99ccff"]int[/color] nGuitype;
[color="#99ccff"]int[/color] i;
[color="#99ccff"]for[/color] (i = [color="#cc99ff"]0[/color]; i < nSpells; i++)
{
nRow = GetM2DARowIdFromRowIndex(TABLE_ABILITIES_SPELLS, i);
nID = GetM2DAInt(TABLE_ABILITIES_SPELLS, [color="#3366ff"]"ID"[/color], nRow);
nGuitype = GetM2DAInt(TABLE_ABILITIES_SPELLS, [color="#3366ff"]"guitype"[/color], nRow);
[color="#99ccff"]switch[/color](nGuitype)
{
[color="#99ccff"]case[/color] [color="#cc99ff"]1[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]2[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]3[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]4[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]8[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]9[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]10[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]11[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]12[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]101[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]102[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]103[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]104[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]105[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]106[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]107[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]108[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]109[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]110[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]111[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]112[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]113[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]114[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]115[/color]:
[color="#99ccff"]case[/color] [color="#cc99ff"]117[/color]:
{
AddAbility([color="#99ccff"]OBJECT_SELF[/color], nID);
[color="#99ccff"]break[/color];
}
[color="#99ccff"]default[/color]:
{
[color="#99ccff"]if[/color] (nID >= [color="#cc99ff"]300000[/color])
AddAbility([color="#99ccff"]OBJECT_SELF[/color], nID);
[color="#99ccff"]break[/color];
}
}
}
Modifié par anakin5, 23 février 2010 - 03:34 .
#12
Posté 23 février 2010 - 07:52
Before you check for all abilities, maybe you can simply check your level up template? That's what I did for the quickslots, since my followers don't rebuild on hiring. It's probably slower if you have to use 2da access, I guess - might still be easier though. The 2da functions' comments say they should be avoided but on the other hand they're heavily used in combat scripts, so I'm not really sure.
#13
Posté 07 avril 2010 - 09:46
See http://social.biowar...71/index/621100. Special thanks to Craig Graff, Sunjammer and Anakin5 for the help.
Modifié par FanfanVilperdue, 13 avril 2010 - 04:08 .





Retour en haut






