Moderator: MacroQuest Developers
Wraeth,Wraeth wrote:I did, perhaps I should clarify what I'm after:
I'm an enchanter. I mez, I tash, I slow, and I cripple. I have a vested interest in learning when my debuffs are about to wear off. I searched through the depot, using various terms including the ones you gave, but I couldn't find anything that would give me an alert when a debuff was about to wear off of a mob.
I'm not so worried about buffs wearing off on me or my group members, as I use a UI that tells me how long my buffs have left.
emphasis mine. Just a bit of work (I know but I am assuming he is willing to work) will get you what you need. If you have trouble re-working the script, a more detailed question will get a much better response.This script automatically debuffs mobs that enter the radius that you specify. The script should then not cast on the mobs after they are debuffed (unless the buff duration you use is exceeded). Once the mob is dead the script cleans up its tracking of the mob. By default it will retry resists 2 times.
Ok....it's been answered before. Quite repeating yourself.Wraeth wrote:What I want is something that gives me a text warning say 'Your spell will wear off of <mob> in 10 seconds".
Does this not contridict what you just asked for in the previous sentance?Wraeth wrote:...more interested in adapting my UI. So maybe there's something in there that can be adapted, but I can't do it.

Code: Select all
|
| dbtime.mac
| Times debuffs of mobs, modified from autodebuff.mac
| Version 1.00
| Date:2/25/2004 10:00am
|
| NOTE: You must use the spellcast.inc that I posted in the snippets forum under
| the title of: "spellcast.inc --- This will cast a spell reliably for you."
| Be sure to use the one in that thread that was posted by ml2517.
| This should only be necessary if you are going to use AA skill activations.
|
|
| Variable Examples:
| ---------------------
|
| Example for using spells:
|
| Debuff=Tashania
| DebuffDuration=0 <----------- Uses default spell duration IE: $spell("Spell Name",duration).
| DebuffDuration=60 <---------- Uses custom duration of 60 seconds.
| DebuffStartWait=0 <---------- Uses wait time of 0 seconds which means to cast immediately.
| DebuffStartWait=20 <--------- Uses wait time of 20 seconds. After 20 seconds the mob will be debuffed.
| DebuffMinHealth=100 <-------- Casts at 100 percent health, i.e., immediately.
| DebuffMinHealth=90 <--------- Casts at 90 percent health. Mob gets under 90 percent he's debuffed.
|
| Example for using casting items:
|
| Debuff=item Gloves of Fire <- Notice: the name of the item is preceded with "item ".
| DebuffDuration=1 <----------- Set this to the duration of the debuff, in seconds. DO NOT use 0, as this is not a spell.
| DebuffStartWait=0 <---------- Uses wait time of 0 seconds which means to cast immediately.
| DebuffMinHealth=20 <--------- You wouldn't cast until the mob was at 20 percent.
|
| Example for using AA skill activations:
|
| Debuff=activate 169 <-------- Notice: the number of the AA Skill is preceded with "activate ".
| DebuffDuration=1 <----------- AA skill duration in seconds. DO NOT use 0, as this is not a spell.
| DebuffStartWait=0 <---------- Activate the AA skill immediately.
| DebuffMinHealth=20 <--------- Activate the AA skill when the mob is at 20 percent health.
#turbo
#include spellcast.inc
| -----------------------------------------------------------------------------
Sub Main(DbfName)
| Declare Variables
/declare Debuff local
/declare DebuffAlertDuration local
/declare DebuffStartWait local
/declare DebuffMinHealth local
/declare DefaultAlertSecs local
/declare MyTemp local
/declare MyTime local
| Defaults
/varset DefaultAlertSecs 60
/varset DebuffAlertDuration 0
/varset DebuffStartWait 0
/varset DebuffMinHealth 100
/if $defined(DbfName)==FALSE {
/echo -Usage: dbtime.mac "Debuffname" [duration] [wait] [minhealth]
/echo -
/echo - duration= Alert duration of debuff. If debuff duration is 0 (default),
/echo - then the spell duration minus @DefaultAlertSecs seconds is used.
/echo - wait= Time to wait before casting. Default is 0 seconds, immediately.
/echo - minhealth= Percent of mob health to wait before casting. Default is 100 percent,
/echo - which will debuff immediately. Passing 90 would wait and debuff when
/echo - the mob was at 90 percent health.
/return
}
/varset Debuff "@DbfName"
/if $defined(Param1)==TRUE {
/varset DebuffAlertDuration @Param1
}
/if $defined(Param2)==TRUE {
/varset DebuffStartWait @Param2
}
/if $defined(Param3)==TRUE {
/varset DebuffMinHealth @Param3
}
|/echo Parameters: @Debuff @DebuffAlertDuration @DebuffStartWait @DebuffMinHealth
| Add check to make sure we are not debuffing ourself. Maybe verify it's NPC completely (no PVP capability).
/delay 0
/if n @DebuffStartWait>0 {
/varcalc MyTemp @DebuffStartWait*10
/echo Waiting @DebuffStartWait seconds before debuffing $target(name,clean) with @Debuff.
/delay @MyTemp
}
| Fix this, what if $target changes? Need to find it in spawn list, and reference that way.
/if n @DebuffMinHealth<100 {
/echo Waiting until $target(name,clean) health is @DebuffMinHealth% or less before debuffing.
:HLoop
/varset MyTemp $target(hp,pct)
/if n @MyTemp>@DebuffMinHealth {
/delay 10
/doevents
/goto :HLoop
}
/echo $target(name,clean) health at $target(hp,pct)%, debuffing with @Debuff.
}
/if $char(state)==SIT /stand
/echo Debuffing $target(name,clean) with @Debuff
/if "$mid(0,4,"@Debuff")"=="item" {
/call Cast "$mid(5,$calc($strlen("@Debuff")-5),"@Debuff")" "item"
} else /if "$mid(0,8,"@Debuff")"=="activate" {
/call Cast "$mid(9,$calc($strlen("@Debuff")-9),"@Debuff")" "activate"
} else {
/call Cast "@Debuff"
}
/echo $return
/if "$return"=="CAST_RESISTED" {
/echo $target(name,clean) resisted @Debuff!
}
/if ("$return"=="CAST_CANNOTSEE" || "$return"=="CAST_OUTOFRANGE") {
/echo $target(name,clean) out of range or cannot be seen.
}
/if "$return"=="CAST_UNKNOWNSPELL" {
/echo Unknown spell.
}
/if "$return"=="CAST_OUTOFMANA" {
/echo Insufficient mana to cast @Debuff on $target(name,clean).
}
/if "$return"=="CAST_STUNNED" {
/echo You cannot cast while stunned!
}
/if "$return"=="CAST_TOOK2LONG" {
/echo Took too long.
}
/if "$return"=="CAST_ABILITYNOTREADY" {
/echo Ability not ready for use.
}
/if "$return"=="CAST_SUCCESS" {
/varset MyTemp 0
/echo $target(name,clean) debuffed with @Debuff, starting timer.
/if n @DebuffAlertDuration==0 {
/if "$spell("@Debuff",duration)"=="INSTANT" {
/echo Duration instant (effect).
} else {
/echo Duration "$spell("@Debuff",duration)"
/varset MyTemp $spell("@Debuff",duration)
/varcalc MyTemp @MyTemp-@DefaultAlertSecs
}
} else {
/varcalc MyTemp @DebuffAlertDuration-@DefaultAlertSecs
/echo Duration override, @DebuffAlertDuration seconds.
}
/echo ALERT: @Debuff on $target(name,clean) wears off in $spell("@Debuff",duration) seconds, Alert in @MyTemp seconds.
/varcalc MyTemp @MyTemp*10
/delay @MyTemp
/echo
/echo ALERT!!! @Debuff wears off on $target(name,clean) in @DefaultAlertSecs seconds!!
}
/return
Code: Select all
/target @whatever
/call cast @whatever2Code: Select all
/echo @whatever needs to be debuffed with @whatever2 soon