Jump to content

Findeh

Members
  • Posts

    365
  • Joined

  • Last visited

Posts posted by Findeh

  1. Good day. Got a couple questions about druid shapeshifting

    1) Is there any inbuid function to cancel shapshift? Or should i use custom one like this?

    Spoiler
    
    internal void CancelShift()
    	{
    		if (ObjectManager.Me.HaveBuff("Cat Form"))
    		{
    			CatForm.Launch();
    		}
    		else if (ObjectManager.Me.HaveBuff("Bear Form"))
    		{
    			BearForm.Launch();
    		}
    		else if (ObjectManager.Me.HaveBuff("Dire Bear Form"))
    		{
    			DireBearForm.Launch();
    		}
    		else if (ObjectManager.Me.HaveBuff("Travel Form"))
    		{
    			TravelForm.Launch();
    		}
    		else if (ObjectManager.Me.HaveBuff("Aquatic Form"))
    		{
    			AquaticForm.Launch();
    		}
    	}

     

    2) When bot needs to drink, and he is shifted, he does not cancel shapeshift by its own, he just standing and spamming water item. ANd recivind the message "Can't use items while shapeshifted" How do i fix that? Is there any state (like RegenerationInProgress) to check it and cancel my form in fightclass?

    Thank you in advance.

  2. Got a new problem now, at my rotation the is peace of code for Buff
    i have formed it as a void Buff() function and placed all buffs inside, no problems with that.
    Now i need to call this function with the criteria:
    "if not fighting"

    the problem is, if i place it inside the if (!ObjectManager.Me.IsDeadMe) without any criteria, like this:
     

    if (!ObjectManager.Me.IsDeadMe)
    {
    	Buff();
    
    	if (Fight.InFight && ObjectManager.Me.Target > 0)
    	{
    		FightRotation();
      	}
    }


    then i'll buff during combat as well.


    if i place it with criteria like this:

    if (!ObjectManager.Me.IsDeadMe)
    {
    	if (!Fight.InFight)
    	{
    		Buff();
    	}
    
    	if (Fight.InFight && ObjectManager.Me.Target > 0)
    	{
    		FightRotation();
      	}
    }

    The weird things happens. For example, bot runs, decides to Buff(), goes inside that function, body-pulls the mob (just because continue to run his path, for example). Now he is in combat, but he does not live Buff() function, and don't continue to buff, even though his buffs are usable in combat. Guess it's because of !Fight.InFight criteria before Buff().
    So he just autoattack the mob, don't do FightRotation() because he is not in the FightRotation() code block.

    If he kills the mob with his autoattack, he just continue to buff from the place where he stopt and then runs as normal, till the next situation like this.

    So i need to code a condition where Buff() will be priority number 1, but only if we not in combat. And if during the buff the combat started, we should quit the Buff() and start the FightnRotation()

    Is it even possible? Thank you in advance.

  3. Good day, guys.

    I'm tyrying to make a construction that checks is target can bleed or not. Have found the CreatureTypeTarget() function, that returns String, but not sure how should i compare strings in c#. Trying to use that construction, but it says something like: "wManager.Wow.ObjectManager.WowUnit.CreatureTypeTarget can not be used as a method".

    private bool TargetCanBleed()
    	{
    		return ( (object.Equals("Elemental", ObjectManager.Me.CreatureTypeTarget())) || 
    			 (object.Equals("Mechanical", ObjectManager.Me.CreatureTypeTarget())) );
    	}

     

    How should i compare them right, to make function return bool result? Thank you in advance for any advices.

     

     

  4. Thanks alot for your help and answers, but guess i'll give up soon.
    Can't make it work. Just getting a bunch of errors when i start it with this code.

    Additionally, trying to force it use some spells when there is 2 or more attackers around. Using constuction like this:

    // If we are under attack from 3 or more mobs use Adrenaline Rush
    		if (ObjectManager.GetUnitAttackPlayer().Count(u => u.GetDistance <= 6) > 2)
    		{
    			if (AdrenalineRush.KnownSpell && AdrenalineRush.IsSpellUsable)
    			{
    				AdrenalineRush.Launch();
    			}
    		}

    But then again, got an errors saying that .Count can't be used like that. Don't know why again, because there is no documentation.

    Addittionally my bots don't skin units, have tryed different min and max MS settings, 0-100, 30-50, 30-100, 300-500, even 100-1000, no result.

    No metter what FC am i using, mine one, or downloaded, my bots only autoattack and not using any spells. Again, i don't get why. Is it a trial version issue or what? If it's so, how am i able to understand will it do all i need him to do, or will it just move around botlike and autoattack till get banned in a hour, because it looks wery botish

  5. You have convinced me. For items use, i'll better write a plugin separately from the Fight Class. Thank you.

    Seems like did evrithing except one thing, thank to your answers. Much appreciate it.

    Thing that i stuck at is Spell Rank. Seems like i'm just handicapped. What this string should return?

    3 hours ago, reapler said:

    Logging.Write(Lua.LuaDoString<string>("name, rank, icon, castTime, minRange, maxRange = GetSpellInfo(\"Shadow Word: Pain\")", "rank"));

    If do understand it right, GetSpellInfo Will return SpellInfo object, that is, according to wManager/wManager.Wow.Class :

    public class SpellInfo
    	{
    		public uint ID;
    		public string Name = "";
    		public string SubName = "";
    		public string Icon = "";
    		public int CastTime;
    		public float MinRange;
    		public float MaxRange;
    	}

    Seems like i don't get it :(  there is no spell rank field, anyway :(

    The goal is to calculate damage. I can make a table with all Spell damage numbers depending on it's rank. (Some damage are static in vanilla).
    Then all i need to get a current rank of the spell as an integer, then get a damage number for it from the table and compare that damage number with current health of the target.
    if (ObjectManager.Target.Health <= damage) we should use the spell.
    else we should not.

    This is a main thing i'm stuck at :( Can't solve it.

    I do need my rogue to know, should he use Eviscerate at 2 Combo Points and that will end the fight, or wait should it wait for 3 or for 4 and so on. As far as i see, most of rogue fight class that i am able to download, just use Eviscerate when reach some static combo point number (3 or 5) without any logic behind it.

     

  6. Thanks alot for your answer, it was really wery helpful. Seems like i did almost every function i need, but still few remain. Maybe again it's my stupidity.

    1) I was not able to find how do i get spell rank (level). For example, i want to count how many damage spell will do, depending on it's rank. To know will it kill the target, or will it not. Am i able to get spell rank somehow, or make it work any other way maybe?

    2) This will be a wery stupid one. I don't get, how some events works. I'm decompiling wManager with ILSpy. Going to wManager/wMnager.Events/ and can't understand the order they are triggering each other at.
    For example, if i got "internal void BuffRotation()" class inside my FC, will it use it only after the fight, or only during the fight, or maybe it will use it during patrol?

    3) And this one even more stupider. About "wManager.Wow.Bot.States.ToTown.GoToTownInProgress" If i get it right, i am able to chek it? Like this for example?

    if (Me.States.ToTown.GoToTownInProgress && SpellName.IsSpellUsable)
    {
    	SpellName.Launch();
    	return;
    }

    But bot will not use "SpellName" anyway because there is no such event where i can place it? Right?

    Thanks alot for any advices or hints. And once again, sorry for my english.

  7. Good day. Sorry in advance for my english, it's far not my native language.

    Searched forum for a while, but still can't find detailed information about handwriting FightClass. Maybe it's because i'm new here, or just because i'm dumb. I'd like to use C#, where can i get more detailed api for it?
    For example, i'd like to write some custom functions for a bot, like this:

    1) Override Eat function inside the bot. I'd like to force him check an inventory and eat first available food from the list, that is hardcoded inside the FC.

    2) While in combat, check inventory for an item, and if it's available, use it. For example, if bot hp <= 15% && bot got "Healing potion"  then bot use "Healing potion"

    3) Check target health (not percent, but a number of health that left)

    4) Use some abilityes when bot goes to the vendor (for example use blink or sprint to speed that process) and then use this abilities when bot is going back to the profile.


    And maybe some others functions, depending on api. Is it even possible?


    Thank you for your answers and any advices.

     

×
×
  • Create New...