Page 1 of 2
DOTing for a Beastlord Hunter Script
Posted: Tue Aug 31, 2004 12:55 pm
by Jeegan
Hello all. I am trying to add a DOT section to my beastlord hunter script. I have it setup to be able to kick and DD but with my current setup if I put a DOT using the line I use for the DD, it will chain cast it, but I want it to just cast when it wears off the mob. Is this possible? Here is my current special combat sub.
Code: Select all
Sub SpecialIt
/declare TempID int inner 0
/doevents
/if ((${Target.Distance}<11)&&(${Me.AbilityReady["Kick"]})) {
/call Kick
}
/if ((${Me.Gem["Blast of Frost"]})&&(${Me.SpellReady["Blast of Frost"]})) {
/cast "Blast of Frost"
}
/return
Posted: Tue Aug 31, 2004 1:28 pm
by A_Druid_00
I'd assume you'll need an event that looks for the "Your XXX spell has worn off" message", but I have no idea how to code it!
Posted: Tue Aug 31, 2004 4:32 pm
by Terramantian
I don't like events cause they can screw up sometimes (or maybe it's me, but I prefer to blame them and avoid when possible). Plus it's a hassle to call doevents all the time.
Try:
Code: Select all
| (In Sub Main general declarations)
/declare DOTimer timer outer 0
Code: Select all
Sub SpecialIt
/declare TempID int inner 0
/doevents
/if ((${Target.Distance}<11)&&(${Me.AbilityReady["Kick"]})) {
/call Kick
}
/if ((${Me.Gem["DOTHERE"]})&&(${Me.SpellReady["DOTHERE"]})&&(!${DOTimer})) {
/cast "DOTHERE"
/varset DOTimer ${Math.Calc[${Spell[DOTHERE].Duration}*10]}m
}
/return
should work, or close to that.
[edit] Oh, btw, it won't take into account extended duration focii... and unless you clear the variable on mob death it'll wait for the original one to run out before casting again. Both minor points though.
Posted: Tue Aug 31, 2004 7:43 pm
by Night Hawk
I find it best to use kick when attack is on, because of mezzed mobs and targetting. Also, throw in spellcast.inc or spell_routines.inc and whatch for interrupts/resists, ect.
Posted: Tue Aug 31, 2004 11:02 pm
by Jeegan
I tried adding that, but it doesn't seem to do anything, I don't cast the spell for some reason. No errors or anything, just no casting, I kick fine, however.
Posted: Wed Sep 01, 2004 3:31 am
by Night Hawk
Did you chance the code he posted?
Code: Select all
/if ((${Me.Gem["DOTHERE"]})&&(${Me.SpellReady["DOTHERE"]})&&(!${DOTimer})) {
/cast "DOTHERE"
/varset DOTimer ${Math.Calc[${Spell[DOTHERE].Duration}*10]}m
Did you chance DOTHERE in each instance?
Posted: Wed Sep 01, 2004 9:40 am
by Jeegan
This is what I put in.
Code: Select all
/if ((${Me.Gem["Sicken"]})&&(${Me.SpellReady["Sicken"]})&&(!${DOTimer})) {
/cast "Sicken"
/varset DOTimer ${Math.Calc[${Spell["Sicken"].Duration}*10]}m
}
Posted: Wed Sep 01, 2004 10:02 am
by aChallenged1
Is this correct??
Code: Select all
/if ((${Me.Gem["Sicken"]})&&(${Me.SpellReady["Sicken"]})&&(!${DOTimer})) {
/cast "Sicken"
/varset DOTimer ${Math.Calc[${Spell["Sicken"].Duration}*10]}m
}
Isn't there one too many sets of "( )"? Shouldn't it be...
Code: Select all
/if ( ${Me.Gem["Sicken"]} && ${Me.SpellReady["Sicken"]})&&(!${DOTimer} ) {
/cast "Sicken"
/varset DOTimer ${Math.Calc[${Spell["Sicken"].Duration}*10]}m
}
Posted: Wed Sep 01, 2004 3:43 pm
by Terramantian
From my experience, (s and )s don't (usually) really matter as long as you have at least one around the whole if, and if each open has a matched close.
The way you have it I don't think it'll work... no matter what the way I've written shouldn't be a problem though.
as a sidenote, you don't need ""s with ${Spell[]} so... ${Spell[Sicken]... should be fine.. I don't remember if that causes a problem or not, but wouldn't think so. while you're running the script.. try doing /echo ${DOTimer} a few times and see if it's ever changed.
Posted: Wed Sep 01, 2004 4:07 pm
by Night Hawk
well I can't see the rest of the code, but maybe chance it to ${DOTimer}==0 would help. Also, I notice only 1 "T" as in not DOT Timer, make sure your spelling matches in all places.
Posted: Wed Sep 01, 2004 6:32 pm
by Jeegan
When I type /echo ${DOTimer}, I get NULL back from MQ2. I added the ==0 to the line but that didn't do anything either. Would it be better if I post the whole macro?
Posted: Wed Sep 01, 2004 6:43 pm
by blueninja
You can't /echo ${DOTimer} from outside the macro because that variable is declared as an "outer", which means it's availiable in the scope of the macro but from the console. If you want to do that you'd have to declare it as "global".
Posted: Wed Sep 01, 2004 6:47 pm
by Jeegan
On a side note, how can I add a sub routine to my macro to check and cure poison? BTW, thank you all for all the help.
Posted: Wed Sep 01, 2004 11:08 pm
by Terramantian
I was talking about /echoing it at different points of the macro.. I'm assuming it's a bigger macro and lasts a fairly long time... else why would you need to recast like that?
[Edit] Just reread... yes, you can /echo a variable from a macro while that macro is running. The scope determines the length of existence of the variable, not the access available.
Posted: Thu Sep 02, 2004 1:49 am
by PhoenixZorn
#include Spellcast.inc
#Event_CurePoison "You have been poisoned"
Sub Event_CurePoison
/target me
/cast "Cure Poison"
/return