Jump to content

jiraiyasm

Members
  • Posts

    31
  • Joined

  • Last visited

Posts posted by jiraiyasm

  1. On 9/7/2023 at 5:20 AM, Nax said:
    public List<WoWPlayer> GetUnitsAttackingPartyMembers(WoWUnit p)
      {
      	return Party.GetParty().Where(x => x.TargetObject?.Target == p.Guid).ToList();
      }

     

    Thank you for the help!

    May I also ask please how to get my character to face it's target? i am trying to make a plug.in that it will stay in a specific position i set and just face the target and use range skills. i am using wrotation and if i set "Manage character movement...." it moves towards it's target. and if wrotation if off, it doesn't face it's target hence not using any range skills. Thank you.

  2. On 9/5/2023 at 5:14 PM, Nax said:

    hello, try something like this,

    note this is pudo code (Made from my phone).

     public List<WoWUnit> GetUnitsAttackingPartyMembers()
     {
       var partyMembers = Party.GetParty();
       var units = ObjectManager.GetObjectWoWUnit();
    
       return units
         .Where(x => x.IsAlive && x.IsAttackable &&
                (x.InCombat || x.InCombatFlagOnly) &&
                partyMembers.Any(p => x.TargetObject?.Target == p.Guid))
         .ToList();
     }

     

    this checks the units attacking partymembers, it should be the other way around. i want to check if mobId 12345 is being targetted or attacked by party members.

  3. 21 hours ago, Droidz said:

    Hello, that is managed by your fightclass. What fightclass do you user? Have you try another?

    hi Droidz,

    i am making a quester profile where it would be great not to go near the mob/target and cast a skill from a distance.

     

    var mobEntry = ObjectManager.GetNearestWoWUnit(ObjectManager.GetWoWUnitByEntry(mobId));

    if (mobEntry.Position.DistanceTo(ObjectManager.Me.Position) < 50f)
                    {
                        // Target mob
                        if (!mobEntry.IsMyTarget)
                        {                        
                             Interact.InteractGameObject(ObjectManager.GetWoWUnitByEntry(29639, true).First().GetBaseAddress);
                             Thread.Sleep(500);
                        }
                        //MovementManager.Face(ObjectManager.Target);
                        SpellManager.CastSpellByNameLUA("Ice Shard");
                        Usefuls.WaitIsCasting();
                        wManager.wManagerSetting.AddBlackList(mobEntry.Guid, 1000 * 5 * 60);
                        Lua.RunMacroText("/cleartarget");
                        DebugLog("Targeting and casting. rescued=" + _rescued);
                        _rescued += 1;
                    }
                    else
                    {
                        var mobpos = new List<Vector3>()
                        {
                            new Vector3(7236.417f, -2756.116f, 820.3741f),
                            new Vector3(7305.381f, -2730.507f, 821.9226f),            
                            new Vector3(7363.159f, -2719.983f, 822.0386f),
                            new Vector3(7386.727f, -2714.902f, 813.5573f),
                            new Vector3(7400.437f, -2760.255f, 841.5171f),
                            new Vector3(7381.176f, -2823.062f, 834.0812f),
                            new Vector3(7413.861f, -2878.198f, 850.9042f),
                            new Vector3(7327.644f, -2866.435f, 851.3341f),
                            new Vector3(7271.88f, -2838.288f, 863.6712f),
                        };

                        wManager.Wow.Bot.Tasks.GoToTask.ToPosition(mobpos[Others.Random(0, mobpos.Count - 1)]);

                    }

  4. 5 hours ago, Droidz said:

    Hello, what is your game version, I tested (on Wotlk) and it works.

    it is actually working. i thought the complete condition will be auto filled with that feature. 
    Also, any way this macro will work:
    Lua.RunMacroText("/click TradeSkillCreateAllButton");

  5. hi.
    i tried using the macro to click on the "Create All" button for cooking quest but it doesn't seem to work. when i tried to type it in-game it does work. so far, it opens the cooking frame, selects the desired recipe to make(has required item to cook) but somehow it won't be able to click the "Create All" button. this is the macro i am trying:

    Lua.RunMacroText("/click TradeSkillCreateAllButton");

    Thank you in advance for the help!

  6. On 9/13/2021 at 3:46 AM, Zan said:

    Bool - Boolean structure type that represents a Boolean value, which can be either true or false.

    Void - Is a reference type of data type and used to specify the return type of a method in C#.

    If you don't understand the above, start here: https://www.youtube.com/watch?v=GhQdlIFylQ8

    I do not know what spell 49936 is as it says it has been removed on Wowhead. Remove the SpellManager..... line from the if condition since it's not a boolean (bool).

    instead of DnD.Launch(); use ClickOnTerrain.Spell(43265, ObjectManager.Target.Position, false, false);

    if you want to check if the Target is on your DnD, then do something like this in the if condition (bool):  ObjectManager.Target.BuffCastedByAll(DnD.Name).Contains(ObjectManager.Me.Guid)

    if you want to cast it on the Target if it isn't on your DnD then add a "!" to it. The "!" is a negation. AKA the opposite (bool):  !ObjectManager.Target.BuffCastedByAll(DnD.Name).Contains(ObjectManager.Me.Guid)

    I forget if the debuff is the same as the spell. If it is, the last few lines will work.

    thanks for the help. i haven't tried it yet as i got busy.

  7. 14 hours ago, Sye24 said:

    Simple google search with words Wrobot Aoe Death and Decay will find a lot of help for you.

    tried using these code

    SpellManager.CastSpellByIDAndPosition(49936, ObjectManager.Target.Position

    ClickOnTerrain.Pulse(ObjectManager.Target.Position);

    but i get an error on vstudio. any way to correct these? Thank you.

     

  8. 15 hours ago, Sye24 said:

     

    Sorry but no, i improved a lot of the code and i am gonna use it in upcoming project.

     

    im making a fightclass for DK, how do i get it to use Death and Decay skills to be casted? it only use the skill but doesn't actually click on the ground.

  9. hi @Sye24is it possible for my characters to move away from the ground debuff that doesn't show as a debuff on the player? will this snipet below work?

     

    wManager.Events.FightEvents.OnFightLoop += (unit, cancelable) =>
            {
                var me = wManager.Wow.ObjectManager.ObjectManager.Me;
                var target = wManager.Wow.ObjectManager.ObjectManager.Target;
                if (me.IsAlive && target.IsAlive && !me.IsCast && me.HaveBuff("Buff name"))
                {
                    wManager.Wow.Helpers.Keybindings.PressKeybindings(wManager.Wow.Enums.Keybindings.STRAFELEFT, 1000 * 3); // strage left during 3 secondes
                }
            };
     

    the debuff IDs are 69019 and 68863 which both hits the characters but no debuffs appears on them as they explode from the ground. Thank you.

  10. 1 hour ago, Sye24 said:

    @jiraiyasmHello, i went ahead and cleaned up some of your code, this should work. let me know if you need any help.

     

    public static void EnchantWeapon()
        {
            try
            {
                if (hasMainHandEnchant || Fight.InFight || ObjectManager.Me.InCombatFlagOnly || ObjectManager.Me.IsDead)
                    return;
    
                IEnumerable<uint> MainHandEnchant = InstantPoisonDictionary
                       .Where(i => i.Key <= ObjectManager.Me.Level && ItemsManager.GetItemCountByIdLUA(i.Value) >= 1)
                       .OrderByDescending(i => i.Key)
                       .Select(i => i.Value);
    
                if (MainHandEnchant.Any())
                {
                    var MHPoison = MainHandEnchant.FirstOrDefault();
                    ItemsManager.UseItem(MHPoison);
                    Thread.Sleep(10);
                    Lua.LuaDoString("PickupInventoryItem(16);");
                    Thread.Sleep(5000);
                }
            }
            catch(Exception ex)
            {
                Logging.Write($"{ex}");
            }
        }
        private static Dictionary<int, uint> InstantPoisonDictionary = new Dictionary<int, uint>()
        {
            { 79, 41196 },
        };
        private static Boolean hasMainHandEnchant => Lua.LuaDoString<Int32>("local GetWeaponEnchant = {GetWeaponEnchantInfo()}; return GetWeaponEnchant[1];") == 1;

     

    Yes it indeed worked. Thank you so much!

  11. Thank you so much for the help. i am still very new to this area.  i tried having my lock to use grand spellstone but it doesn't "Left click" the spellstone to the weapon.

    i just based this on the snipets for rogue also. 

    private void EnchantWeapon()
        {
            bool hasMainHandEnchant = Lua.LuaDoString<bool>
                (@"local hasMainHandEnchant, _, _, _, _, _, _, _, _ = GetWeaponEnchantInfo()
                if (hasMainHandEnchant) then 
                   return '1'
                else
                   return '0'
                end");

            if (!hasMainHandEnchant)
            {

                IEnumerable<uint> MP = InstantPoisonDictionary
                    .Where(i => i.Key <= ObjectManager.Me.Level && ItemsManager.HasItemById(i.Value))
                    .OrderByDescending(i => i.Key)
                    .Select(i => i.Value);

                if (MP.Any())
                {
                    MHPoison = MP.First();
                    ItemsManager.UseItem(MHPoison);
                    Thread.Sleep(10);
                    Lua.LuaDoString("/click PickupInventoryItem(16)");
                    Thread.Sleep(5000);
                    return;
                }      
            }
        }
        private static Dictionary<int, uint> InstantPoisonDictionary = new Dictionary<int, uint>
        {       
            { 79, 41196 },
        };    

     

    may i ask please how to check if the required item is available in the bag before casting the spell especially needed for casting buffs.

    Thank you @Talamin

×
×
  • Create New...