• Visit Rebornbuddy
  • Specify SubIndex for WorldManager.Teleport?

    Discussion in 'Community Developer Forum' started by annerose, Sep 30, 2016.

    1. annerose

      annerose New Member

      Joined:
      Sep 30, 2016
      Messages:
      4
      Likes Received:
      0
      Trophy Points:
      0
      I encountered a challenge with using WorldManager.Teleport and WorldManager.TeleportById methods. I am in possession of an Apartment and an Estate in the same housing district, and using that district's aetheryteID takes me to the one at the top of my teleport list. Using WorldManager.AvailableLocations I found the following:
      Code:
      Name: Estate Hall (Private) AetheryteId: 60 Cost:17 Zone:340 SubIndex:128
      Name: Estate Hall (Free Company) AetheryteId: 58 Cost:80 Zone:341 SubIndex:0
      Name: Estate Hall (Private) AetheryteId: 60 Cost:17 Zone:340 SubIndex:1
      Is there a way for me to specify the SubIndex? I can't find it on rbdocumentation.

      Posting as requested from release thread.
       
    2. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,239
      Likes Received:
      366
      Trophy Points:
      83
      Code:
                  //Copy to a local variable so it only has to do the memory read once
                  var locations = AvailableLocations;
                  var tele = locations.FirstOrDefault(r=>r.SubIndex == 123);
                  var index = locations.IndexOf(tele);
                  WorldManager.Teleport((uint)index);
      
       
    3. annerose

      annerose New Member

      Joined:
      Sep 30, 2016
      Messages:
      4
      Likes Received:
      0
      Trophy Points:
      0
      Nice, thanks! Is it possible to do this with CommonBehaviors.CreateTeleportBehavior? I'd like to modify TeleportTo so that XMLs could do <TeleportTo AetheryteID="" SubIndex=""/>
       
    4. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,239
      Likes Received:
      366
      Trophy Points:
      83

      Code:
      
              public static Composite CreateTeleportBehavior(ValueRetriever<uint> aetheryteId, ValueRetriever<uint> zoneId)
              {
                  return new Decorator(ret => WorldManager.CanTeleport(),
                      new Sequence(
                          new Action(ret => Navigator.Stop()),
                          new Sleep(240),
                          new Action(ret => WorldManager.TeleportById(aetheryteId(ret))),
                          new Wait(TimeSpan.FromMilliseconds(5000), r => Core.Player.IsCasting, new ActionAlwaysSucceed()),
                          new WaitContinue(TimeSpan.FromMilliseconds(15000), ret => (WorldManager.ZoneId == zoneId(ret) && !IsLoading), new Action(ret => RunStatus.Success))
                      )
                  );
              }
      
      You can make your own.
       

    Share This Page