What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

SpellCastInfo.Name broken on some enemies/abilities?

Ichiba

New Member
Joined
Jun 14, 2014
Messages
258
I am trying to track down how to fix a problem with some code I'm using to interrupt enemy abilities. Sorry if this is a little long.

Here is the code I am using to cast an interrupt and determine if it's needed

Code:
Spell.Cast("Blunt Arrow", r => settings.UseInterrupt && settings.Interrupt.Contains(((BattleCharacter)Core.Player.CurrentTarget).SpellCastInfo.Name))
If a setting is true, and the spell a monster is using is found, it casts blunt arrow. However, on some enemies and abilities it seems to be having some problems. I sat with a Wind Sprite attacking me with Aero in my interrupt list and it worked just as it should. It casted Blunt Arrow to interrupt Aero, and did other abilities if it wasn't or if UseInterrupt was false.

Then I went into Stone Vigil Hard mode, and every enemy ability there would cause the routine to stop until the enemy finished using their ability.

I tried out this code in the console to see if I could find what was happening
Code:
Log(((BattleCharacter)Core.Player.CurrentTarget).SpellCastInfo.Name);

On the Wind Sprite, it returns nothing if the sprite isn't casting, and Aero when the sprite is casting Aero. On the enemies in Stone Vigil Hard, it would usually log nothing if they weren't casting, but when they were casting, I got this

Code:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Driver.Run() in c:\Users\redacted\Desktop\RebornBuddy\Plugins\RebornConsole\Temp\151f0zh1.0.cs:line 36
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)
   at HighVoltz.CodeDriver.CompileAndRun(String input) in c:\Users\redacted\Desktop\RebornBuddy\Plugins\RebornConsole\RebornConsole.cs:line 452

Is my code wrong? Is SpellCastInfo.Name broken? How can I make this work consistently?
 
Try using SpellCastInfo.SpellData.Name instead of just SpellCastInfo.Name

No.




I am trying to track down how to fix a problem with some code I'm using to interrupt enemy abilities. Sorry if this is a little long.

Here is the code I am using to cast an interrupt and determine if it's needed

Code:
Spell.Cast("Blunt Arrow", r => settings.UseInterrupt && settings.Interrupt.Contains(((BattleCharacter)Core.Player.CurrentTarget).SpellCastInfo.Name))
If a setting is true, and the spell a monster is using is found, it casts blunt arrow. However, on some enemies and abilities it seems to be having some problems. I sat with a Wind Sprite attacking me with Aero in my interrupt list and it worked just as it should. It casted Blunt Arrow to interrupt Aero, and did other abilities if it wasn't or if UseInterrupt was false.

Then I went into Stone Vigil Hard mode, and every enemy ability there would cause the routine to stop until the enemy finished using their ability.

I tried out this code in the console to see if I could find what was happening
Code:
Log(((BattleCharacter)Core.Player.CurrentTarget).SpellCastInfo.Name);

On the Wind Sprite, it returns nothing if the sprite isn't casting, and Aero when the sprite is casting Aero. On the enemies in Stone Vigil Hard, it would usually log nothing if they weren't casting, but when they were casting, I got this

Code:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Driver.Run() in c:\Users\redacted\Desktop\RebornBuddy\Plugins\RebornConsole\Temp\151f0zh1.0.cs:line 36
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)
   at HighVoltz.CodeDriver.CompileAndRun(String input) in c:\Users\redacted\Desktop\RebornBuddy\Plugins\RebornConsole\RebornConsole.cs:line 452

Is my code wrong? Is SpellCastInfo.Name broken? How can I make this work consistently?

Get me the action id for spells that are broken.

Code:
Log(((BattleCharacter)Core.Player.CurrentTarget).SpellCastInfo.ActionId);

Edit:
Also get the actiontype please

Code:
Log(((BattleCharacter)Core.Player.CurrentTarget).SpellCastInfo.ActionType);
 
Here's a quick list of what I've found so far.

Haranguing Harrier
Dragon's Blood
2224
Spell

Jura Aevis
Strident Scream
2225
Spell

Watch Wyvern
Deadly Drive
2222
Spell

Giruveganus
????? (None of these abilities have cast bars or visible names)
2310
2311
2314
Spell

Gorynich
Rake
2293
Spell
Swynge
2295
Spell

I won't speculate on why this is happening as you surely know better than I do, but it seems like every ability at least 2200+ is affected.
 
Thanks, found the issue. Fixed for the next version. Probably going to release with tomorrows patch.
 
Back
Top