• Visit Rebornbuddy
  • SpellCastInfo.Name broken on some enemies/abilities?

    Discussion in 'Community Developer Forum' started by Ichiba, Sep 30, 2014.

    1. Ichiba

      Ichiba New Member

      Joined:
      Jun 14, 2014
      Messages:
      258
      Likes Received:
      8
      Trophy Points:
      0
      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?
       
    2. Wheredidigo

      Wheredidigo Community Developer

      Joined:
      Dec 15, 2013
      Messages:
      417
      Likes Received:
      8
      Trophy Points:
      18
      Try using SpellCastInfo.SpellData.Name instead of just SpellCastInfo.Name
       
    3. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,231
      Likes Received:
      364
      Trophy Points:
      83
      No.




      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);
       
    4. Ichiba

      Ichiba New Member

      Joined:
      Jun 14, 2014
      Messages:
      258
      Likes Received:
      8
      Trophy Points:
      0
      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.
       
    5. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,231
      Likes Received:
      364
      Trophy Points:
      83
      Thanks, found the issue. Fixed for the next version. Probably going to release with tomorrows patch.
       
    6. Ichiba

      Ichiba New Member

      Joined:
      Jun 14, 2014
      Messages:
      258
      Likes Received:
      8
      Trophy Points:
      0
      Awesome. Thanks for the quick work.
       

    Share This Page