Summons and buffs a pet.
v1.2 :: Oct 12, 2004
- Removed remnants from the old macro this was in
- Ends when you run out of mana
v1.1 :: Oct 11, 2004
- Added fizzle support
Code: Select all
| Macro : PetSummoner |
| Created By: Vayeco Dynn |
| Release Date: Oct 11, 2004 |
| Version: 1.1 |
| Filename: PetSummmoner.mac |
|---------------------------------|
|----------------------------------------------------------------------|
| Usage: |
| |
| Change RV_PetSpell in Sub Main to whatever your pet summon spell is. |
| Then, for all the buffs you want to use on him, write the following: |
| /call BuffPet "SPELLNAME" |
| Some examples have already been provided. Make sure you save the |
| file! To then summon and buff your pet, just use /macro PetSummoner |
|----------------------------------------------------------------------|
#event Fizzle "Your spell fizzles!"
#event Fizzle "Your spell is interrupted."
|--------------------------------------------------------------------------------
|SUB: Main
|--------------------------------------------------------------------------------
Sub Main
|:: Change RV_PetSpell to your pet spell ::|
/declare RV_PetSpell string outer Restless Bones
/declare RV_Fizzled int outer 0
/call SummonPet
|:: Change these buffs to the buffs you want to use on your pet ::|
/call BuffPet "Spirit Armor"
/call BuffPet "Buff Numba 2"
/call BuffPet "Etcetera"
/return
|--------------------------------------------------------------------------------
|SUB: Memorize A Spell
|--------------------------------------------------------------------------------
Sub MemSpell(int GemSlot, string SpellName)
/if (!${Defined[GemSlot]} || !${Defined[SpellName]}) {
/echo /call MemSpell [GemSlot] [SpellName] failed, parameters not given.
/endmacro
}
/if (${Me.Gem[${SpellName}]} == ${GemSlot}) {
/return
}
/if (${Me.Book[${SpellName}]}) {
/echo Memorizing ${SpellName} into Gem ${GemSlot}
/memspell ${GemSlot} "${SpellName}"
/delay 5
:MemWait
/if (!${Me.Gem[${GemSlot}].ID}) {
/delay 1
/goto :MemWait
}
} else {
/echo You do not have ${SpellName} memorized in your spell book.
/endmacro
}
/return
|--------------------------------------------------------------------------------
|SUB: Cast a Spell
|--------------------------------------------------------------------------------
Sub Cast(string SpellName)
/if (!${Defined[SpellName]}) {
/echo /call Cast [SpellName] failed, parameters not given.
/endmacro
}
/if (!${Me.Gem[${SpellName}]}) {
/call MemSpell 8 "${SpellName}"
}
/if (${Math.Calc[${Me.CurrentMana} - ${Me.Gem[${Me.Gem[${SpellName}]}].Mana}]} < 0) {
/echo Not enough mana to cast! Ending macro.
/endmacro
}
/if (${Me.State.NotEqual[STAND]}) {
/echo Standing in order to cast...
/stand
/delay 5
}
/keypress forward
:Recast
/if (${Me.SpellReady[${SpellName}]}) {
/echo Casting ${SpellName}...
/cast "${SpellName}"
} else {
/delay 1
/goto :Recast
}
:WaitForCast
/if (${Me.Casting.ID}) {
/delay 1
/goto :WaitForCast
}
/delay 2
/doevents
/if (${RV_Fizzled}) {
/varset RV_Fizzled 0
/goto :Recast
}
/return
|--------------------------------------------------------------------------------
|SUB: Cast On A Target
|--------------------------------------------------------------------------------
Sub CastOn(string SpellName)
/if ((${Target.Distance} > ${Math.Calc[${Me.Gem[${Me.Gem[${SpellName}]}].Range} - 15]}) && (${Me.Gem[${Me.Gem[${SpellName}]}].Range} > 15)) {
/call MoveToMob ${Math.Calc[${Me.Gem[${Me.Gem[${SpellName}]}].Range} - 15]}
}
/call Cast "${SpellName}"
/return
|--------------------------------------------------------------------------------
|SUB: Buff a Target
|--------------------------------------------------------------------------------
Sub Buff(string TargetName, string SpellName)
/if (!${Defined[TargetName]} || !${Defined[SpellName]}) {
/echo /call Buff [TargetName] [SpellName] failed, parameters not given.
/endmacro
}
/if (!${Spawn[${TargetName}].ID}) {
/echo ${TargetName} is an invalid buff target; it doesn't seem to exist.
/return
}
/if (${Spawn[${TargetName}].Name.Equal[${Me}]}) {
/if (!${Me.Buff[${SpellName}].ID}) {
/echo Buffing myself...
/target ${Me}
/call CastOn "${SpellName}"
/keypress esc
}
} else /if (${Spawn[${TargetName}].Name.Equal[${Me.Pet}]}) {
/if (!${Me.PetBuff[${SpellName}]}) {
/echo Buffing pet...
/target ${Me.Pet}
/call CastOn "${SpellName}"
/keypress esc
}
} else {
/echo Buffing ${TargetName}...
/target ${TargetName}
/call CastOn "${SpellName}"
/keypress esc
}
/return
|--------------------------------------------------------------------------------
|SUB: Summon Pet
|--------------------------------------------------------------------------------
Sub SummonPet
/if (!${Me.Pet.ID}) {
/echo Summoning a pet...
/call Cast "${RV_PetSpell}"
}
/return
|--------------------------------------------------------------------------------
|SUB: Buff Pet
|--------------------------------------------------------------------------------
Sub BuffPet(string SpellName)
/call Buff ${Me.Pet} "${SpellName}"
/return
|--------------------------------------------------------------------------------
|SUB: Event :: Spell Fizzles
|--------------------------------------------------------------------------------
Sub Event_Fizzle
/varset RV_Fizzled 1
/return

