caewen
here is the script
Code: Select all
| Shaman.mac - Shaman pet script, modified Druid.mac
| Work in progress, rewrites as I gain new spell levels. Currently lvl 9
|
| Spells in use (Type 1)..........: Heal, Shield, Strength, Cure Poison, Cure Disease, Drowsy, Gate, Nuke
|
| Start with /macro druid <Controller Name> <Type> e.g. /macro druid Buranda 1
|
| Spells for PLing (Type 1)........: Heal, DS, Skin, Chloro, STR, SoW, Snare, Root
| Spells for Hunting (Type 2)......: Heal, DS, Skin, Winged, STR, SoW, Breath, Evac
| or if indoors (Type 3)...........: Heal, DS, Skin, Winged, STR, Immolate, Breath, Evac
| or if a Nuke is required (Type 4): Heal, DS, Skin, Winged, STR, Nuke, Debuff, Evac
|
#chat tell
#define CurrentMaster v30
#define LastTellSender v33
#define CurrentSpellSet v34
#define CurrentTarget v35
#define CurrentHelpCommand v36
#define CurrentHealTarget v37
#define CurrentSlowSpell v38
#define CurrentHealSpell v39
#define CurrentBuffSpell v40
#define CurrentNukeSpell v41
#define LastTellMessage v42
#define MasterDistance v43
#define CurrentCurePoisonSpell v44
#define CurrentCureDiseaseSpell v45
#define TargetDead v46
#define MobDistance v47
#define MyXLoc v48
#define MyYLoc v49
#define HomeX v50
#define HomeY v51
#define BackHome v52
#define CurrentBuffTarget v53
#define CurrentRunSpeedSpell v54
#define CurrentAttackTarget v55
#define CastStatus v59
#define CastTimer t7
#define CAST_SUCCESS 0
#define CAST_UNKNOWNSPELL 1
#define CAST_RESTART 2
#define CAST_OUTOFMANA 3
#define CAST_OUTOFRANGE 4
#define CAST_CANNOTSEE 5
#define CAST_STUNNED 6
#define CAST_RESISTED 7
#event GainedALevel "You have gained a level!"
#event GroupInvite "click on the 'FOLLOW' option, or 'DISBAND' to cancel.
#event SlowOff "Your Drowsy spell has worn off."
#event IAmPoisoned "You have been poisoned."
#event CuredPoison "You have cured your target."
#event Fizzle "Your spell fizzles!"
#event Interrupt "Your spell is interrupted."
#event Recover "You haven't recovered yet..."
#event Resisted "You target resisted the"
#event OutOfMana "Insufficient Mana to cast this spell!"
#event OutOfRange "Your target is out of range, get closer!"
#event NoLOS "You cannot see your target."
#event Stunned "You cannot cast while stunned"
#event Standing "You must be standing to cast a spell"
#event Collapse "Your gate is too unstable, and collapses."
Sub Main
/zapvars
/varset HomeX -927
/varset HomeY -2789
/varset MobDistance 18
/varset MasterDistance 30
/varset CurrentMaster $p0
/varset CurrentSpellSet $p1
/call SetVarsForSpells
| /call MemSpells $CurrentSpellSet
/tell $CurrentMaster Ready
:loop
/doevents
/goto :loop
/return
Sub SetVarsForSpells
/if $CurrentSpellSet==1 {
/varset CurrentHealSpell "Light Healing"
/varset CurrentBuffSpell "Inner Fire"
/varset CurrentSlowSpell "Drowsy"
/varset CurrentNukeSpell "Frost Rift"
/varset CurrentCurePoisonSpell "Cure Poison"
/varset CurrentCureDiseaseSpell "Cure Disease"
/varset CurrentRunSpeedSpell "Spirit of Wolf"
}
/return
Sub Event_GainedALevel
/tell $CurrentMaster I have gained a level! I am now $char(level)
/return
Sub Event_GroupInvite
/invite
/return
Sub Event_IAmPoisoned
/tell $CurrentMaster I am poisoned. I am going to try to remove it myself.
/varset CurrentHealTarget myself
/call CurePoisonSub
/return
Sub Event_Chat
/varset LastTellSender $p1
/varset LastTellMessage "$p2"
/if "$LastTellSender"!="$CurrentMaster" {
/mqlog Tell from $LastTellSender : $LastTellMessage
/tell $CurrentMaster Tell from $LastTellSender to $char(name), you might wanna talk to them.
/return
}
/target $CurrentMaster
/if $left(3,"$LastTellMessage")==sow /varset CurrentBuffTarget $arg(2,"$LastTellMessage")
/if $left(4,"$LastTellMessage")==heal /varset CurrentHealTarget $arg(2,"$LastTellMessage")
/if $left(6,"$LastTellMessage")==poison /varset CurrentHealTarget $arg(2,"$LastTellMessage")
/if $left(7,"$LastTellMessage")==disease /varset CurrentHealTarget $arg(2,"$LastTellMessage")
/if $CurrentBuffTarget==$char(name) /varset CurrentBuffTarget myself
/if $CurrentHealTarget==$char(name) /varset CurrentHealTarget myself
|This section just redirects to the correct subs
/if "$LastTellMessage"~~"status" /tell $CurrentMaster Mana: $char(mana,pct)%, HP: $char(hp,pct)%, EXP: $char(exp)%
/if "$LastTellMessage"~~"gohome" /call HomeBase
/if "$LastTellMessage"~~"heal" /call HealSub
/if "$LastTellMessage"~~"slow" /call SlowSub
/if "$LastTellMessage"~~"sow" /call SowSub
/if "$LastTellMessage"~~"melee" /call MeleeSub
/if "$LastTellMessage"~~"follow" /call FollowSub
/if "$LastTellMessage"~~"stopfollow" /call StopFollowSub
/if "$LastTellMessage"~~"comehere" /call GoTargetSub
/if "$LastTellMessage"~~"help" /call HelpSub
/if "$LastTellMessage"~~"poison" /call CurePoisonSub
/if "$LastTellMessage"~~"disease" /call CureDiseaseSub
/if "$LastTellMessage"~~"sitdown" /call SitSub
/if "$LastTellMessage"~~"standup" /call StandSub
|This section will determine what kind of spells to mem whenever function is restored.
| /if $p2~~"buffspells" /call MemSpells 1
| /if $p2~~"supportspells" /call MemSpells 2
| /if $p2~~"offensespells" /call MemSpells 3
| /if $p2~~"00type4" /call MemSpells 4
/doevents
/return
Sub StopFollowSub
/sendkey down right
/sendkey up right
/return
Sub SitSub
/stand
/delay 5
/sit
/return
Sub StandSub
/stand
/return
Sub FollowSub
/target $CurrentMaster
/delay 6
/follow
/return
Sub MeleeSub
/assist $CurrentMaster
/delay 10
/varset CurrentAttackTarget $target(id)
/tell $CurrentMaster Going into MELEE mode! Gonna kill %T
/attack on
:combatloop
/face fast nopredict
/if n $target(distance)>13 {
/sendkey down up
/goto :combatloop
}
/if n $target(distance)<=$MobDistance /sendkey up up
/face fast nopredict
/if $char(ability,"Slam")>0 /doability "Slam"
/if n $target(id)!=$CurrentAttackTarget /varset TargetDead 1
/if n $TargetDead!=1 /goto :combatloop
/delay 1s
/varset TargetDead 0
/target id $MyTarget
/return
Sub SlowSub
/assist $CurrentMaster
/delay 5
/tell $CurrentMaster Going to slow %T
/call Cast $CurrentSlowSpell
/tell $CurrentMaster All done...%T is slowed
/return
Sub HealSub
/target $CurrentHealTarget
/delay 3
/tell $CurrentMaster Starting heal process for %T
:Begin
/call Cast "$CurrentHealSpell"
/if $CastStatus==3 {
/tell $CurrentMaster OOM! No more healing possible!
/return
}
/if $target(hp,pct)<=90 {
/goto :Begin
}
/tell $CurrentMaster Healing done, Mana: $char(mana,pct), HP: $char(hp,pct)
/return
Sub CurePoisonSub
/target $CurrentHealTarget
/delay 3
/tell $CurrentMaster Going to cure poison for %T
/for v80 0 to 3
/call Cast "$CurrentCurePoisonSpell"
/if $CastStatus==3 {
/tell $CurrentMaster OOM! Can't remove poison now!!
/return
}
/next v80
/tell $CurrentMaster Done casting, Mana: $char(mana,pct), HP: $char(hp,pct)
/return
Sub CureDiseaseSub
/target $CurrentHealTarget
/delay 3
/tell $CurrentMaster Going to cure disease for %T
/call Cast "$CurrentCureDiseaseSpell"
/if $CastStatus==3 {
/tell $CurrentMaster OOM! Can't remove disease now!!
/return
}
/tell $CurrentMaster Done casting, Mana: $char(mana,pct), HP: $char(hp,pct)
/return
Sub GoTargetSub
/target $CurrentMaster
/delay 3
:combatloop
/varset MyXLoc $char(x)
/varset MyYLoc $char(y)
/delay 1
/if n $MyXLoc==$char(x) /if $MyYLoc==$char(y) /call Obstacle
/face fast nopredict
/if n $target(distance)>$MasterDistance {
/sendkey down up
/goto :combatloop
}
/if n $target(distance)<=$MasterDistance {
/sendkey up up
/return
}
/return
Sub Nuke
/assist $CurrentMaster
/delay 6
/tell $CurrentMaster Nuking %T
/call SpellSub 6 5.5
/tell $CurrentMaster Nuke on %T done, Mana: $char(mana,pct), HP: $char(hp,pct)
/target $CurrentMaster
/return
Sub Debuff
/assist $CurrentMaster
/delay 6
/tell $CurrentMaster Debuffing %T
/call SpellSub 7 5.5
/tell $CurrentMaster %T successfully debuffed, Mana: $char(mana,pct), HP: $char(hp,pct)
/target $CurrentMaster
/return
Sub MemSpells
|
|This section doesn't work, as MQ is quite broken atm. When the spellmemming is fixed in MQ, I will
|Do a rewrite of this section to make it work. I am going to add some code here, just so I have a
| point of reference when it does work again :)
|
/return
Sub HelpSub
/tell $CurrentMaster Current commands are:
/delay 15
/tell $CurrentMaster heal targetname--slow--follow--info--comehere--help
/return
Sub Cast
/if n $char(gem,"$p0")==0 /return CAST_UNKNOWNSPELL
:StartCast
/if n $char(gem,"$p0")<0 /call WaitForRefresh "$p0"
/cast "$p0"
/varset CastTimer $int($spell("$p0",casttime)*10+$spell("$p0",recoverytime)*10)
/varset CastStatus CAST_SUCCESS
:WaitCast
/doevents Fizzle
/doevents Interrupt
/doevents Recover
/doevents Standing
/doevents OutOfRange
/doevents OutOfMana
/doevents NoLOS
/doevents Resisted
/if n $CastStatus==CAST_RESTART /goto :StartCast
/if n $CastStatus>CAST_RESTART /return $CastStatus
/if n $CastTimer>0 /goto :WaitCast
/varset CastTimer 0
/return CAST_SUCCESS
Sub WaitForRefresh
:LoopWaitForRefresh
/delay 0
/if n $char(gem,"$p0")<0 /goto :LoopWaitForRefresh
/return
Sub Event_Fizzle
/varset CastStatus CAST_RESTART
/return
Sub Event_Interrupt
/varset CastStatus CAST_RESTART
/return
Sub Event_Recover
/varset CastStatus CAST_RESTART
/delay 5
/return
Sub Event_Standing
/varset CastStatus CAST_RESTART
/stand
/return
Sub Event_Collapse
/varset CastStatus CAST_RESTART
/return
Sub Event_OutOfMana
/varset CastStatus CAST_OUTOFMANA
/return
Sub Event_OutOfRange
/varset CastStatus CAST_OUTOFRANGE
/return
Sub Event_NoLOS
/varset CastStatus CAST_CANNOTSEE
/return
Sub Event_Stunned
/varset CastStatus CAST_STUNNED
/return
Sub Event_Resisted
/varset CastStatus CAST_RESISTED
/return
sub HomeBase
:RunHome
/doevents
/if $char(ability,"Sense Heading")>0 /doability "Sense Heading"
/face loc $HomeY,$HomeX
/if n $distance($HomeY,$HomeX)>15 /call autorun2 1
/varset MyXLoc $char(x)
/varset MyYLoc $char(y)
/delay 1
/if n $MyXLoc==$char(x) /if $MyYLoc==$char(y) /call Obstacle
/if n $distance($HomeY,$HomeX)<15 {
/call autorun2 0
/varset BackHome 1
}
/delay 0
/if n $BackHome!=1 /goto :RunHome
/varset BackHome 0
/return
sub Obstacle
/sendkey up up
/sendkey down down
/delay 2
/sendkey up down
/sendkey down ctrl
/if n $rand(99)>50 {
/sendkey down right
} else {
/sendkey down left
}
/delay 3
/sendkey up right
/sendkey up left
/sendkey up ctrl
/sendkey down up
/return
Sub AutoRun2
/if $p0==1 /sendkey down up
/if $p0==0 /sendkey up up
/return
Sub SowSub
/target $CurrentBuffTarget
/delay 3
/tell $CurrentMaster Incoming Spirit of Wolf for %T
/call Cast "$CurrentRunSpeedSpell"
/if $CastStatus==3 {
/tell $CurrentMaster OOM! Can't SoW now!!
/return
}
/tell $CurrentMaster Done casting, Mana: $char(mana,pct), HP: $char(hp,pct)
/return

