"item_tpscroll" - ensage is not finding

Hi developers. Please fix bug with "item_tpscroll". I can find any items in hero enventory, but not "item_tpscroll".

Tagged:

Comments

  • YEEEEEEEYEEEEEEE Posts: 1,339
    edited September 29

    ObjectManager.GetEntities<Item>().FirstOrDefault(x => x.IsValid && x.Id == AbilityId.item_tpscroll)

  • Nagibator666Nagibator666 Posts: 19
    edited October 1

    Thanks! But now the question is: how to exclude all tpscrolls from main hero Inventory(Arc Warden) and keep only from Tempest.

    Now I'm using:

    var tpscroll = ObjectManager.GetEntities().FirstOrDefault(x => x.IsValid && x.Id == AbilityId.item_tpscroll);

    var tempestt = ObjectManager.GetEntities().FirstOrDefault(x => x != ObjectManager.LocalHero && x.HasModifier("modifier_arc_warden_tempest_double"));

    Player.UseAbility(tempestt, tpscroll, Radiant_Triangle);

    It works well, but I'm starting to recieve this annoying messages ~"You trying to use item which isn't in your inventory". Because it finds both TPs from main hero and tempest, and try to use both too. When I need only one tempest's TP =)

  • Nagibator666Nagibator666 Posts: 19
    edited October 1

    @YEEEEEEE said:
    ObjectManager.GetEntities<Item>().FirstOrDefault(x => x.IsValid && x.Id == AbilityId.item_tpscroll)

    Thanks! But now the question is: how to exclude all tpscrolls from main hero Inventory(Arc Warden) and keep only from Tempest.

    Now I'm using:

    var tpscroll = ObjectManager.GetEntities().FirstOrDefault(x => x.IsValid && x.Id == AbilityId.item_tpscroll);
    
    var tempestt = ObjectManager.GetEntities().FirstOrDefault(x => x != ObjectManager.LocalHero && x.HasModifier("modifier_arc_warden_tempest_double"));
    
    Player.UseAbility(tempestt, tpscroll, Radiant_Triangle);
    

    It works well, but I'm starting to recieve this annoying messages ~"You trying to use item which isn't in your inventory". Because it finds both TPs from main hero and tempest, and try to use both too. When I need only one tempest's TP =)

  • YEEEEEEEYEEEEEEE Posts: 1,339
    edited October 1

    @Nagibator666

    var tempestDouble = EntityManager<Hero>.Entities.FirstOrDefault(x => x.IsIllusion && x.HasModifier("modifier_arc_warden_tempest_double"));
    var tpscroll = EntityManager<Item>.Entities.FirstOrDefault(x => x.Owner == tempestDouble && x.Id == AbilityId.item_tpscroll);
    tpscroll.UseAbility(Radiant_Triangle);
  • @YEEEEEEE said:
    @Nagibator666

    var tempestDouble = EntityManager<Hero>.Entities.FirstOrDefault(x => x.IsIllusion && x.HasModifier("modifier_arc_warden_tempest_double"));
    var tpscroll = EntityManager<Item>.Entities.FirstOrDefault(x => x.Owner == tempestDouble && x.Id == AbilityId.item_tpscroll);
    tpscroll.UseAbility(Radiant_Triangle);

    BRILLIANT! Works like a swiss clock! Thank you :godbless:

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!