Jump to content

Recommended Posts

I hit level 30 on my protection warrior and my fight class was working just fine until I trained Rank 2 of Demoralizing Shout. I am using string names for spell checks,
and it just keeps spamming Demo Shout continuously. Spell string = "Demoralizing Shout" | Spell ID = 6190.

Using a simple check:
 

if (!target.HaveBuff("Demoralizing Shout"))
        {
            DemoralizingShout.Launch();
            return;
        }

 

Link to comment
https://wrobot.eu/forums/topic/6673-demoralizing-shout-rank-2-spam/
Share on other sites

Hello, i can't directly test it, but you can try:

            var target = ObjectManager.Me.TargetObject;
            var spell = new Spell("Demoralizing Shout");
            if (!spell.TargetHaveBuff)
            {
                spell.Launch();
            }

or you can find the problem by yourself if you lookup spell / target:

//copy this in your fightclass, and run this with opening settings
    public void ShowConfiguration()
    {
        //effects are also included
        var spellName = "Demoralizing Shout";
        Logging.Write("Get all ids of spell: "+spellName);
        foreach (var id in new Spell(spellName).Ids.Distinct())
        {
            Logging.Write("\n"+id);
        }
        Logging.Write("Done.");


        Logging.Write("Get all buffs from current target:");
        foreach (var id in ObjectManager.Me.TargetObject.GetAllBuff())
        {
            Logging.Write("\nid: "+id.SpellId+"     name: "+id.GetSpell.Name);
        }
        Logging.Write("Done.");
    }

 

You can also search for the "HaveBuff()" method with a decompiler, you'll see that some checking are different.

Usage(with demonstration video) of my prefered decompiler can be found here

Thanks for the replies. I am still not quite sure how I can check each different id to whichever spell id the player currently has (as per rank and level of training).
Lower level warriors use spell id 1160, while rank 2 of Demoralizing shout uses 6190. If I run a for loop through each demoralizing shout id that each mob
might have, I am wondering if this will be very efficient?

1 hour ago, Apexx said:

Thanks for the replies. I am still not quite sure how I can check each different id to whichever spell id the player currently has (as per rank and level of training).
Lower level warriors use spell id 1160, while rank 2 of Demoralizing shout uses 6190. If I run a for loop through each demoralizing shout id that each mob
might have, I am wondering if this will be very efficient?

It's pretty fast. For a few ids, there's no need to care about (as i benchmarked, it took about 0,01789ms).

But if you are going to iterate through thousands of entries, then another solution must be considered.

You can read more about the performance of .net collections here.

You might also try this:

        var spell = new Spell("Demoralizing Shout");
        if (!ObjectManager.Me.TargetObject.HaveBuff(spell.Ids))
        {
            Logging.Write("not active");
            spell.Launch();
        }
        else
        {
            Logging.Write("debuff active");
        }

 

Hey @reapler Here's a the log file from one fight using your latest post example:
 

06:43:34 - [Fight] Player Attack Galak Windchaser (lvl 24)
06:43:35 - not active
[F] 06:43:35 - [Spell] Cast Demoralizing Shout (Demoralizing Shout)
06:43:35 - not active
[F] 06:43:35 - [Spell] Cast Demoralizing Shout (Demoralizing Shout)
06:43:36 - not active
[F] 06:43:36 - [Spell] Cast Demoralizing Shout (Demoralizing Shout)
06:43:36 - not active
[F] 06:43:36 - [Spell] Cast Demoralizing Shout (Demoralizing Shout)
06:43:37 - not active
[F] 06:43:37 - [Spell] Cast Demoralizing Shout (Demoralizing Shout)
[F] 06:43:37 - [Spell] Cast Bloodrage (Bloodrage)
[F] 06:43:38 - [Spell] Cast Rend (Rend)
06:43:38 - not active
[F] 06:43:38 - [Spell] Cast Demoralizing Shout (Demoralizing Shout)
06:43:39 - not active
[F] 06:43:39 - [Spell] Cast Demoralizing Shout (Demoralizing Shout)
[F] 06:43:39 - [Spell] Cast Mocking Blow (Mocking Blow)
[F] 06:43:39 - [Spell] Cast Demoralizing Shout (Demoralizing Shout)
06:43:40 - debuff active
06:43:40 - debuff active
06:43:40 - debuff active
06:43:41 - debuff active
[F] 06:43:41 - [Spell] Cast Thunder Clap (Thunder Clap)
06:43:41 - debuff active
06:43:42 - debuff active
06:43:42 - debuff active
06:43:42 - debuff active
06:43:43 - debuff active
06:43:43 - debuff active
06:43:44 - debuff active
[F] 06:43:44 - [Spell] Cast Mocking Blow (Mocking Blow)
06:43:44 - debuff active
06:43:45 - debuff active
06:43:45 - debuff active
06:43:45 - debuff active
06:43:46 - debuff active
[F] 06:43:46 - Galak Windchaser casting time remaining: 1.1 seconds.
[F] 06:43:46 - Player interrupted with Shield Bash (Id found: 72, Name found: Shield Bash, NameInGame found: Shield Bash, Know = True, IsSpellUsable = False)
06:43:46 - debuff active
[F] 06:43:46 - Galak Windchaser casting time remaining: 0.7 seconds.
[F] 06:43:46 - Player interrupted with Shield Bash (Id found: 72, Name found: Shield Bash, NameInGame found: Shield Bash, Know = True, IsSpellUsable = False)
06:43:46 - debuff active
[F] 06:43:46 - [Spell] Cast Demoralizing Shout (Demoralizing Shout)
[F] 06:43:47 - Galak Windchaser casting time remaining: 0.1 seconds.
[F] 06:43:47 - [Spell] Cast Shield Bash (Shield Bash)
[F] 06:43:47 - Player interrupted with Shield Bash (Id found: 72, Name found: Shield Bash, NameInGame found: Shield Bash, Know = True, IsSpellUsable = False)
06:43:47 - debuff active
06:43:48 - debuff active
06:43:48 - debuff active
06:43:48 - debuff active
06:43:49 - debuff active
06:43:49 - debuff active
06:43:50 - debuff active
06:43:50 - debuff active
[F] 06:43:50 - [Spell] Cast Demoralizing Shout (Demoralizing Shout)
06:43:51 - debuff active
06:43:51 - debuff active
06:43:51 - debuff active
06:43:52 - debuff active
06:43:52 - debuff active
06:43:52 - debuff active
[F] 06:43:53 - [Spell] Cast Demoralizing Shout (Demoralizing Shout)
06:43:53 - debuff active
06:43:53 - debuff active
06:43:54 - debuff active
06:43:54 - debuff active
06:43:55 - debuff active
06:43:55 - debuff active
06:43:55 - debuff active
06:43:56 - debuff active
06:43:56 - debuff active
06:43:57 - debuff active
06:43:57 - debuff active
06:43:57 - debuff active
06:43:58 - debuff active
[F] 06:43:58 - [Spell] Cast Rend (Rend)
06:43:58 - debuff active
06:43:59 - debuff active
06:43:59 - debuff active
06:43:59 - debuff active
06:44:00 - debuff active
[F] 06:44:00 - [Spell] Cast Demoralizing Shout (Demoralizing Shout)
06:44:00 - debuff active
06:44:01 - debuff active
06:44:01 - debuff active
06:44:02 - debuff active
06:44:02 - debuff active
06:44:02 - debuff active
06:44:03 - debuff active
06:44:03 - debuff active
06:44:04 - debuff active
06:44:04 - debuff active
06:44:04 - debuff active
06:44:05 - debuff active
06:44:05 - debuff active
06:44:05 - debuff active
06:44:06 - debuff active
06:44:06 - debuff active
06:44:06 - debuff active
06:44:07 - debuff active
06:44:07 - not active
[F] 06:44:07 - [Spell] Cast Demoralizing Shout (Demoralizing Shout)
06:45:13 - [Apexx Protection Warrior v1.0] Stop in progress.

Demoralizing Shout Debuff lasts for 30 seconds. I am not sure why it keeps reapplying it.

So far i can see it correctly detects the debuff. You may need to look-over if you have somewhere else used ".Launch()" for your "Demoralizing Shout",

because in the snippet it must log "not active" before "[Spell] Cast Demoralizing Shout (Demoralizing Shout)" can appear(it can a bit delay).

I guess you may also alter the ".Launch()" method aswell the conditions for the spell, since "waitIsCast" has an impact of your rotation:

        var spell = new Spell("Demoralizing Shout");
        if (!ObjectManager.Me.TargetObject.HaveBuff(spell.Ids)
            && spell.IsSpellUsable
            && spell.IsDistanceGood)
        {
            Logging.Write("not active\n=> cast"+spell.Name);
            spell.Launch(false, false);
        }
        else
        {
            Logging.Write(spell.Name+" active");
        }

 

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...