• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • A few questions about the API.

    Discussion in 'Community Developer Forum' started by Neverdyne, Dec 6, 2014.

    1. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      649
      Likes Received:
      18
      Trophy Points:
      18
      Some quick questions:

      1. Is the Core.Me.NpcId the same as Character.SpellCastInfo.TargetId if the caster is targeting the player?
      2. For the MathEx.GetPointAt method, what is the reference of the angle? Is 0 radians the player's forward direction?
      3. Is Character.Heading the radian angle of where the character is facing? If so, what is the reference point?

      Also, regarding injection. I was reading a somewhat old Honorbuddy post, where they discussed it a little bit. But there's something I don't have clear. The references to stuff in the game, like BattleCharacter objects, are they obsolete the next frame? What I mean is, lets say I save a reference to a battle character on one of my classes, something like:

      Code:
      private BattleCharacter character;
      
      public void GetReference() 
      {
          character = Core.Target as BattleCharacter;
      }
      
      public void IsDead() 
      {
          return character.IsDead;
      }
      Let's say the GetReference() method is called in one frame, and not on the other frames. If I then call IsDead() later, will it accurately tell me if that particular battle character is dead? I know that the character will probably not be my current target, but what I mean is will the personal information of that character still be updated on later frames? Basically I'm asking if the object references that represent stuff in-game go out of scope for Rebornbuddy the next frame.
       
      Last edited: Dec 6, 2014
    2. kaihaider

      kaihaider Community Developer

      Joined:
      May 18, 2010
      Messages:
      1,325
      Likes Received:
      5
      Trophy Points:
      38
      1. pretty sure but you could double check pretty easily
      2/3 It's pulled from the game based on the world orientation. The code I pmed you shows how to use it. Did that not work for you?

      yes it updates, you're copying the reference not the data

      edit:
      oops, didn't notice you said npcid instead of objectid. npcid is the type of creature, players are 0.
       
      Last edited: Dec 7, 2014
    3. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      1)TargetId is an ObjectId
      2)Wat
      3)Yes its in rad, as per its documentation. I don't remember which cardinal direction is 0.
      4)You can store references, if you do, you need to make sure ref.IsValid is true before checking any other property as its pointer may have been set to zero by the objectmananger.

      Code:
              public static Vector3 GetPointAt(Vector3 from, float distance, float rotationRadians)
              {
                  float y = (float)(Math.Cos(rotationRadians) * distance);
                  float x = (float)(Math.Sin(rotationRadians) * distance);
                  return from + new Vector3(x, 0, y);
              }
      
       
    4. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      649
      Likes Received:
      18
      Trophy Points:
      18
      Ah, that explains stuff. Thank you! So references can become obsolete after all, I had that suspicion since I'm guessing if you store a GameObject reference and move far away, it might no longer be visible to the client, then if you move close again it'll be seen as a new object and given a new ID?
       
    5. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      Yep.
       
    6. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      649
      Likes Received:
      18
      Trophy Points:
      18
      Two more quick questions:

      1. Is there a way to know the current experience points of the player?
      2. Would it be possible for us to see the FateBot botbase code? Or is it classified? :p
       

    Share This Page