Jump to content

Hzqvkr8aTLw4rv

Members
  • Posts

    18
  • Joined

  • Last visited

Posts posted by Hzqvkr8aTLw4rv

  1. 13 hours ago, Matenia said:

    Don't bother with manacost. You can generally estimate the mana percentage it costs and see if you're above. For everything IsUsableSpell covers what you need.

    Most of us hang around the wRobot Discord. The link is in sidebar/footer iirc, but just in case: https://discord.gg/ED2Mjfp

    And there is a gearscore addon for 2.4.3. It's absolutely useless bullshit though, especially on lower levels. TBC isn't Wrath, itemization works very differently and the guy who backported it did it to troll Feenix. Only the Warmane community was actually stupid enough to pick it up and use it.
    Pawn uses actual, real stat weights.

    I'm doing this for the lolz though, and possibly make a good opensource system for others to build fightclasses on.

    I've already managed to get the exact manacost from spells with a set manacost, but spells such as Cat Form use % of base mana, and getting base mana is rather impossible afaik (so i'll have to use data from TBC-DB)

    I used to do hacky custom systems for private servers but i've grown rather tired of it. So i thought i'll be hobbycoding some here instead :)

    Thanks for the info about Pawn btw, will be useful! :)

  2. On 8/7/2017 at 10:23 PM, reapler said:

    I have already thought about this option at my current project (https://wrobot.eu/forums/topic/6681-extension-wowdb/) but i wanted to be more compact and converted it to SqLite.

    In the end no client actions are needed and i can customize struct definitions (https://github.com/barncastle/WDBXEditor), load it to database and alter it.

    I guess i also need to add spell retrieve methods to my manager aswell more client data to db :)

    But i'm thinking now it's better to use the reader, because all WRobot libraries already have it.

     

    And by the way welcome to WRobot.

     

    Damn you've done some heavy lifting here!

    Yes indeed, if you were to convert the Spell*.dbc files into .SQL (i could assist you with that if you're interested) then that looks like a pretty solid build to me.

    If i'm reading documentation right it seems like you're not exposing SQLite to the "user", it'd be a really dope feature to include that freedom.

    Then "users" could create their own tables programmatically and fill them with data they gather while the bot is running (probably not very useful though) and could also query for anything they find useful =)

    I definitely like this idea.

     

    EXTRA:
    Idk if there's a gearscore addon for 2.4.3, but it'd be real dope to implement one of those into the lib (along with items), this way we could determine what item's players should be equipped with according to magic formulas =)

     

    Do you guys hang around some IRC, Discord or Slack maybe? Would be cool to ball ideas around with you guys =)

  3. On 8/8/2017 at 0:28 AM, reapler said:

    It looks excellent Carl. I'm looking forward that this will be added soon to the WRobot's lib ;)

    Yes it would be really cool if the dbcreader was implemented into wrobot, but the loading was optional (because distributing DBC files isn't very legal iirc)

    I'm also looking into exporting data about all items (from TBC-DB) into a CSV or smth, and another table that handles "classlevelstats" or whatever it's called.

    Maybe you can get this with Lua, but my idea is that with this we could implement a way to predict things better (damage to be caused by a spell before it's casted, healing done by a spell).

    With this one could eliminate "all" (not taking criticals into account probably) overhealing, start popping rogue finishing moves when they're predicted to kill (good to optimize leveling classes).

    I'm really shit with the actual AI part, since i barely can play WoW. But this could be a fun project! :)

  4. 9 hours ago, Matenia said:

    I might be too late here, but I use this helper class, that allows me to easily iterate over ranks and break the loop if (highest to lowest) I know a spell or (lowest to highest) I don't know a spell anymore.

    
    class RotationSpell
    {
        public Spell Spell;
        private string Name;
        private int? Rank;
    
        public RotationSpell(string name, int? rank = null)
        {
            this.Name = name;
            this.Rank = rank;
            this.Spell = new Spell(name);
        }
    
        public bool IsUsable()
        {
            return Spell.IsSpellUsable;
            //return Lua.LuaDoString<bool>("usable = (IsUsableSpell(\""  + Name + "\") and true or false)", "usable");
        }
    
        public bool CanCast()
        {
            return Lua.LuaDoString<bool>("return (IsUsableSpell(\"" + FullName() + "\") and GetSpellCooldown(\"" + FullName() + "\") == 0)");
        }
    
        public float GetCooldown()
        {
            string luaString = @"
            cooldownLeft = 0;
    
            local start, duration, enabled = GetSpellCooldown(""{0}"");
            if enabled == 1 and start > 0 and duration > 0 then
                cooldownLeft = duration - (GetTime() - start)
            end";
            return Lua.LuaDoString<float>(string.Format(luaString, FullName()), "cooldownLeft");
        }
    
        public void UpdateRank(int rank)
        {
            this.Rank = rank;
        }
    
        public string FullName()
        {
            return Rank != null ? (Name + "(Rank " + Rank + ")") : Name;
        }
    
        public bool IsKnown()
        {
            return Lua.LuaDoString<bool>("return (GetSpellInfo(\"" + FullName() + "\") ~= nil)");
        }
    
    }

     

    That Lua thingy was useful to know though (How you call Lua) :)

  5. 11 minutes ago, reapler said:

    Hello @LilleCarl, i don't think that's the actual behavior of "new Spell("Regrowth", false).Id" to get the first rank and ".KnownSpell" shouldn't return always true. Maybe @Droidz can look into it.

    On 3.3.5a i have only experienced the second issue.

    But you may try this:

    
        public List<uint> GetKnownSpellIds(string name)
        {
            return new Spell(name).Ids.Where(SpellManager.KnowSpell).OrderBy(i => i).Distinct().ToList();
        }
        
        public uint GetHighestKnownSpell(string name)
        {
            return new Spell(name).Ids.Where(SpellManager.KnowSpell).OrderByDescending(i => i).FirstOrDefault();
        }

    Usage:

    
            var s = GetKnownSpellIds("Regrowth");
            for (var i = 0; i < s.Count; i++)
            {
                robotManager.Helpful.Logging.Write("\nId: "+s[i] +"    Rank: "+(i+1));
            }
            
            robotManager.Helpful.Logging.Write("Id: "+GetHighestKnownSpell("Regrowth"));

     

    Aah thanks, i didn't even know SpellManager.KnowSpell existed, nice snippet there! =)

  6. Hi!

    When creating a spell like new Spell("Regrowth", false) it'll get the first rank of the spell. So i thought id list all spellid's and iterate through tem and get the highest one by checking KnownSpell, but it seems to always be returning true.

    Is this intended behavior? This is kinda related to the Mana issue i faced in another thread. (I've implemented reading DBC files extracted from the client, so i can get all spellinfo available, but now i must know the highest rank (spellid) known to the player)

    When this starts to look like something somewhat useful i'm thinking that i'll opensource this and make a fightclass (hopefully together with other people) that'll work good for all classes! :)

     

    Best Regards
    Carl

  7. 47 minutes ago, avvi said:

    Is your goal to determine whether you have enough mana to cast the spell? If so, then you can use wManager.Wow.Helpers.SpellManager.SpellUsableLUA("Spellname") . Spellusable uses the http://wowwiki.wikia.com/wiki/API_IsUsableSpell so, it's not purely based on mana percentage, but it might accomplish what you want. Currently I don't know if there is a way to find the mana cost of a spell. You may be able to write a dictionary SpellByCost and do that yourself, though.
           

    I'll probably go with the latter, the reason IsUsableSpell isn't enough is because sometimes i must check if player has enough mana to cast 2 spells, say i'm in Cat Form and wanna heal myself. Then i better have enough mana to land regrowth and cat form, else i'm better of fighting in catform til i have mana for both :)

     

    Imo those are things that should be in the API, to help the community grow! =)

     

    I might just extract all spellcosts from dbc files and put them in a dictionary.

    Cheers =)

  8. First i'll just link to what i'm working on. It's a fightclass for Feral Druids (leveling atm, thought it'd be fun to try this out while leveling) https://gist.github.com/Lillecarl/22b3c8170c1070873ca4dfcc607b98ac

    Both Spell and SpellInfo classes contain very little information, i'd love to get the power (mana) requirements from spells by their names in some easy fashion.

    Can this be done in some way, i skimmed through wManager with dnSpy, but i didn't find anything of use there.

    Best Regards
    Carl

×
×
  • Create New...