Jump to content

Recommended Posts

Hello.

The first question. I'm trying to use

MovementManager.Face(ObjectManager.Target)

with

MovementManager.IsFacing(ObjectManager.Me.Position, ObjectManager.Me.Rotation, ObjectManager.Target.Position, 3.1f) == false

condition and it works but if once condition is true, my char facing to target every time while i dont move. I want facing once per condition is true. How i can to do it?

The second question. I'm using !TraceLine.TraceLineGo(ObjectManager.Target.Position) and some times i can cast through barriers (mountains) on private server, and i want do check on the Z coordinate. For example in Probably Engine exists function

function LoS_Check(ax, ay, az, bx, by, bz)
    if ax ~= nil and bx ~= nil then
    local los = TraceLine(ax, ay, az+1, bx, by, bz+1)
    return los == nil
    end
    return false
end

As you can see i can change coordinates manualy. In that way i can change Z, for example Z+10 and check can i cast through mountains. And that the question: how can i get Z coordinate and use it with TraceLineGo? I think about

Vector3 targetZ = ObjectManager.GetTargetPosition();

!TraceLine.TraceLineGo(nearestPlayerEnemy.targetZ+10)

or something like this.

And other question is about wrobot api. Where i can find list of conditions and functions like?

Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause or Conditions.IsAttackedAndCannotIgnore

For example i want check spell cd and trying to use Conditions.CounterSpell("Spell name") and i guess it is wrong form. Tried use lua

var resultLua =
           Lua.LuaDoString(
               "ret = \"false\"; spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, interrupt = UnitChannelInfo(\"player\"); if spell ~='Hurricane' then ret = \"true\" end",
               "ret");

and condition is working but it ignored when checking all conditions, even if all conditions is true and lua condition (resultLua) is false, the function still performed.
Coding on C# on 3.3.5

Thanks in Advance

Link to comment
https://wrobot.eu/forums/topic/4718-diff-conditions/
Share on other sites

  • 2 weeks later...

Face target:

// Face target
if (!ObjectManager.Me.IsFacing(target.Position))
{
   MovementManager.Face(target);
}


Target with Z position:

Vector3 testTarget = ObjectManager.Me.TargetObject.Position;
testTarget.Z = testTarget.Z + 10;

!TraceLine.TraceLineGo(testTarget)

About the API: Short answer... there is no documentation and i think there will be no one, you need to check the libs and try and error. A big issue if you ask me.

The last question i don't understand, i don't know the condition "counter spell", sorry for that.
if you want to interrupt a spell this could be an example for it:

WoWUnit target = ObjectManager.Me.TargetObject;
Spell interruptSpell = new Spell("SpellName");
Spell targetSpell = target?.CastingSpell;

// Validate target and spell
if(ObjectManager.Me.HasTarget && target.IsCast && target?.CastingSpell.Name == "SpellName")
{
   // Interrup if specified time is left and interrupt spell is ready
   if(target.CastingTimeLeft <= (targetSpell.CastTime - 2) && interruptSpell.IsSpellUsable)
   {
      // Interrupt
      interruptSpell.Launch();
   }
}

Never tested, written right out of the mind. I would recommend to change the CastingSpell.Name to ingame name or ID.

Hope i could help you out a bit.

Link to comment
https://wrobot.eu/forums/topic/4718-diff-conditions/#findComment-22087
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...