What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

Cast a spell only if a buff is active?

Unknown Buddy

Member
Joined
May 20, 2015
Messages
603
Reaction score
17
The only example i see of this in OldRoutine is:

Code:
if (_rfSlot != -1)
{
	// See if we can use the skill.
	var skill = LokiPoe.InGameState.SkillBarPanel.Slot(_rfSlot);
	if (skill.CanUse() && !LokiPoe.Me.[COLOR="#FF0000"]HasRighteousFireBuff[/COLOR])
	{
		var err1 = LokiPoe.InGameState.SkillBarPanel.Use(_rfSlot, true);
		if (err1 == LokiPoe.InGameState.UseError.None)
		{
			await Coroutine.Sleep(Utility.LatencySafeValue(250));

			await Coroutines.FinishCurrentAction(false);

			await Coroutine.Sleep(Utility.LatencySafeValue(50));

			return true;
		}

	        Log.ErrorFormat("[Logic] Use returned {0} for {1}.", err1, skill.Name);
	}
}

Where is it getting the return for HasRighteousFireBuff? I am simply looking for a way to check if my character has VaalHasteBuff on. I was hoping it would be as simple as:

Code:
if (skill.CanUse() && LokiPoe.Me.[COLOR="#FF0000"]HasVaalHasteBuff[/COLOR])

But its not that simple! HALP! Please :D
 
The only example i see of this in OldRoutine is:

Code:
if (_rfSlot != -1)
{
	// See if we can use the skill.
	var skill = LokiPoe.InGameState.SkillBarPanel.Slot(_rfSlot);
	if (skill.CanUse() && !LokiPoe.Me.[COLOR="#FF0000"]HasRighteousFireBuff[/COLOR])
	{
		var err1 = LokiPoe.InGameState.SkillBarPanel.Use(_rfSlot, true);
		if (err1 == LokiPoe.InGameState.UseError.None)
		{
			await Coroutine.Sleep(Utility.LatencySafeValue(250));

			await Coroutines.FinishCurrentAction(false);

			await Coroutine.Sleep(Utility.LatencySafeValue(50));

			return true;
		}

	        Log.ErrorFormat("[Logic] Use returned {0} for {1}.", err1, skill.Name);
	}
}

Where is it getting the return for HasRighteousFireBuff? I am simply looking for a way to check if my character has VaalHasteBuff on. I was hoping it would be as simple as:

Code:
if (skill.CanUse() && LokiPoe.Me.[COLOR="#FF0000"]HasVaalHasteBuff[/COLOR])

But its not that simple! HALP! Please :D


Cast vaal haste, dump char data, check aura name, and do Me.HasAura("aura_name")
 
Cast vaal haste, dump char data, check aura name, and do Me.HasAura("aura_name")
Ok, so the dump is:

Code:
		[Aura]
		BaseAddress: 0x436745435
		SubInfo: 0x34543534543
		Name: [COLOR="#FF0000"]Vaal Haste Aura[/COLOR]
		InternalName: [COLOR="#FF0000"]vaal_aura_speed[/COLOR]
		Description: Grants increased Cast, Attack and Movement Speeds.
		CasterId: 1234
		OwnerId: 0
		BuffType: 30
		TimeLeft: 00:00:00.5220000
		MaxTimeLeft: 00:00:06
		Charges: 0
		IsInvisible: False
		IsRemovable: True
I believe "if (skill.CanUse() && LokiPoe.Me.HasAura("Vaal Haste Aura"))" is going to work. Will give it a whirl. Thanks toNyx! If not i may have to use the internal name. Trial and error time!
 
Last edited:
Basically the code for that convenience property is
Code:
/// <summary>Returns true if this actor has this buff and false otherwise.</summary>
public bool HasRighteousFireBuff
{
	get
	{
		return HasAura("righteous_fire");
	}
}

So you want to use InternalName instead, since it's easier to keep track of.

Basically, earlier on in the API, we added a bunch of convenience properties for various buffs and skills, but the rate that GGG added new buffs/skills far outpaced our ability to keep it up-to-date. I want to change that system, as a whole, but it'd break all code, so I can't for now.

The new system in place revolves around using BuffDefinitionsEnum (which you can get by dumping the data files with the scripts via DevTab).

Code:
/// <summary>Returns true if this actor has this buff and false otherwise.</summary>
public bool HasClarityBuff
{
	get
	{
		return HasBuff(BuffDefinitionsEnum.player_aura_mana_regen);
	}
}

I'll see about doing another pass and add the Vaal convenience stuff for an upcoming version though.
 
Back
Top