• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Useful code snippets for developing quest profiles

    Discussion in 'Rebornbuddy Profiles' started by mastahg, Aug 30, 2014.

    1. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,335
      Likes Received:
      380
      Trophy Points:
      83
      Getting list of quests
      Code:
      ClearLog();
      foreach(var quest in QuestLogManager.Quests())
      {
      Log(quest);
      }
      
      The bits you'll be intersted in is GlobalId and Step

      Get all nearby units
      Code:
      ClearLog();
      var units = GameObjectManager.GameObjects;
      foreach(var unit in units.OrderBy(r=>r.Distance()))
      {
      Log("{0}-{2}-{1}",unit,unit.NpcId,unit.GetType());
      }
      
      Get all nearby eventobjects
      Code:
      ClearLog();
      var units = GameObjectManager.GetObjectsOfType<EventObject>();
      foreach(var unit in units.OrderBy(r=>r.Distance()))
      {
      Log("{0}-{1}",unit,unit.NpcId);
      }
      
      Get all KeyItems
      Code:
      ClearLog();
      foreach(var bagslot in  InventoryManager.GetBagByInventoryBagId(ff14bot.Enums.InventoryBagId.KeyItems).Slots)
      {
      Log(bagslot);
      }
      
      Etc
      Code:
      Log("{0}-{1}",Core.Target,Core.Target.NpcId);
      Log(Core.Player.Location);
      
       
    2. parrot

      parrot Community Developer

      Joined:
      Feb 5, 2012
      Messages:
      222
      Likes Received:
      7
      Trophy Points:
      18
      This error is thrown when im trying to execute the code above (reborn console):
      Code:
      2) The name 'InventoryBagId' does not exist in the current context
       
    3. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,335
      Likes Received:
      380
      Trophy Points:
      83
      Updated the code in the OP, let me know if that works for you.
       
    4. parrot

      parrot Community Developer

      Joined:
      Feb 5, 2012
      Messages:
      222
      Likes Received:
      7
      Trophy Points:
      18
      Ty, that worked
       
    5. Sodimm

      Sodimm Member

      Joined:
      Nov 8, 2014
      Messages:
      383
      Likes Received:
      7
      Trophy Points:
      18
      Get all KeyItems changed since update:

      Code:
      ClearLog();
      foreach(var bagslot in  InventoryManager.GetBagByInventoryBagId(ff14bot.Enums.InventoryBagId.KeyItems).FilledSlots)
      {
      Log(bagslot);
      }
      
       
    6. hkme

      hkme Member

      Joined:
      May 12, 2014
      Messages:
      197
      Likes Received:
      0
      Trophy Points:
      16
      Thank you for the update.
       
    7. Yasuko

      Yasuko Member

      Joined:
      Oct 28, 2010
      Messages:
      314
      Likes Received:
      6
      Trophy Points:
      18
      if FilledSlots returns a List to to go through, but FreeSlots is an uint .. whats an easy way to go through the freeslots?
       
    8. ADR

      ADR New Member

      Joined:
      Sep 12, 2015
      Messages:
      36
      Likes Received:
      1
      Trophy Points:
      0
      is there a code for retrieving the map ID?
       
    9. y2krazy

      y2krazy Community Developer

      Joined:
      Jun 21, 2011
      Messages:
      2,803
      Likes Received:
      70
      Trophy Points:
      48
    10. ADR

      ADR New Member

      Joined:
      Sep 12, 2015
      Messages:
      36
      Likes Received:
      1
      Trophy Points:
      0
      Thanks that link is a whole pile of usefulness.
       
      y2krazy likes this.
    11. Frivolous8

      Frivolous8 New Member

      Joined:
      Jun 1, 2015
      Messages:
      10
      Likes Received:
      2
      Trophy Points:
      3
      TalkTo (XXXXX = QuestId)

      Here is another useful snippet I use for making quest profiles.

      TalkTo (XXXXX = QuestId)
      Code:
      ClearLog();
      GameObject s = GameObjectManager.GetObjectByNPCId(Core.Target.NpcId);
      QuestWork q = QuestLogManager.GetQuestById(67850);
      string location = s.Location.ToString().Remove(0, 1);
      location = location.Remove(location.Length - 1, 1);
      Log("<TalkTo Name=\"" + s.EnglishName.ToString() + "\"" + " InteractDistance=\"" + 1.0 + "\"" + " QuestId=\"" + q.GlobalId.ToString() + "\"" + " StepId=\"" + q.Step.ToString() + "\"" + " NpcId=\"" + s.NpcId.ToString() + "\"" + " XYZ=\"" + location + "\"/>");
      
       

    Share This Page