Well this is my first Macro and I don't know if it will work.
Any comments on this?
Code: Select all
| /macro shaman <Charname> <Rootonlowhp 0/1> <Slow 0/PCT> <HealHPpct>
#turbo 20
#event Fizzle "Your spell fizzled!"
#event RegenStop "You have stopped regenerating."
#event Mobdead "has been slain."
#event MobSlowed "yawns."
#event MobRooted "Dunno the Text hehe"
Sub Main
|-- declares --|
/declare MasterName global
/declare Root global
/declare Slow global
/declare Heal global
/declare CastSpell global
/declare SpellName global
/declare getHP global
/declare getMana global
/declare IsSlowed global
/declare IsRooted global
/declare RootName global
/declare SlowName global
/declare HealName global
/declare RegenName global
|-- varstets --|
/varset CastSpell 0
/varset SpellName " "
/varset getHP 0
/varset getMana 0
/varset IsSlowed 0
/varset IsRooted 0
/varset Mastername @p1
/varset Root @p2
/varset Slow @p3
/varset Heal @p4
|-- Spellnames
|-- Please Edit
/varset RootName "Immobilize"
/varset SlowName "Turgur's Insects"
/varset HealName "Superior Healing"
/varset RegenName "Regrowth"
| Perhaps I should add some Spellcheck and Spellmemming ;)
| Check if Regen is running. after initial check, Event should handle this
/if n $char(buff,@RegenName)==0 {
/varset SpellName @RegenName
/call cast_spell
}
:MainLoop
/call mana_hp_check
/call handle_role
/doevents
/goto :MainLoop
/return
Sub mana_hp_check
| Checking HP ...
| If Shamans HP < 60% he needs to sit down and heal himself up until Shamans HP is 100%
| If Shamans HP < 50% he needs to tell Master that he is in trouble
/if $char(hp,pct) <= 50 {
| will need to make this better. now shaman will spam master with troubletells
| until hp >50% =)
/tell @MasterName I am in trouble. my HP is $char(hp,pct)
}
/if @getHP == 0 {
| shaman is not regening at the moment
if $char(hp,pct) <= 60 {
/varset getHP 1
/tell @MasterName I am sitting down to regen HP now
/sit
}
}
/if @getHP == 0 {
| if regenmode is off, manaregenmode is off but mana <70%, set regenmode on
/if @getMana == 0 {
if $char(mana,pct) <= 70 {
/varset getMana 1
}
}
| if Manaregenmode if on but mana is full, stop manaregen mode
/if @getMana == 1 {
/if $char(mana,pct) == 100 {
/varset getMana 0
}
}
| if regenmode is off, manaregenmode is on, canni
/if @getMana == 1 {
/varset SpellName @CanniName
/call cast_spell
}
}
| if regenmode is on and HP is full, turn regenmode off
/if @getHP == 1 {
if $char(hp,pct) == 100 {
/varset getHP 0
}
}
/return
Sub handle_role
|-- check for target HP
/if @Heal > 0 {
|-- Heal Target if HP < @Heal
/target @MasterName
/delay 1
/if $target(hp,pct) < @Heal {
/varset SpellName @HealName
/call cast_spell
}
}
|-- Slow Mob?
/if @Slow > 0 {
/assist @MasterName
/delay 1
/if @IsSlowed == 0 {
/if $target(hp,pct) <= @Slow {
/varset SpellName @SlowName
/call cast_spell
}
}
}
|-- Root Mob?
/if @Root > 0 {
/assist @MasterName
/delay 1
/if $target(hp,pct) <= @Root {
/varset SpellName @RootName
/call cast_spell
}
}
/return
Sub cast_spell
|-- Handle spellcasting
/stand
/delay 1
/cast "@SpellName"
/pause $spell(@SpellName,casttime) + 2 | there may be lag and stuff
/sit
/return
Sub Event_MobSlowed
/varset IsSlowed 1
/return
Sub Event_MobDead
/varset IsRooted 0
/varset IsSlowed 0
/return
Sub Event_Fizzle
/call cast_spell
/return
Sub Event_RegenStop
/varset SpellName @RegenName
/call cast_spell
/return
Sub Event_MobRooted
/varset MobRooted 1
/return
Edit: pause -> delay


