#chat tell
#turbo
#Event Collapse "Your gate is too unstable, and collapses."
#Event NoLOS "You cannot see your target."
#Event CastStart "You begin casting"
#Event CastFizzle "Your spell fizzles!"
#Event CastInterrupt "Your spell is interrupted."
#Event CastNoMana "Insufficient Mana to cast this spell"
#Event CastTooFar "Your target is out of range, get closer!"
#Event Recovered "You haven't recovered yet..."
#Event CastResist "Your target resisted "
#Event Distracted "You are too distracted to cast a spell now!"
#Event NoTarget "You must first select a target for this spell!"
#Event Sitting "You must be standing to cast a spell."
#Event NoMem "You do not seem to have that spell memorized."
#Event Stunned "You can't cast spells while stunned!"
#define DefaultSpellSet default
|SpellSub
|Used to handle all spell casting. Auto mems spells and handles fizzles.
|Will want to set the DefaultSpellSet var to your default spell set
|if you plan to have it auto load spells.
|
|Usage /call SpellSub "spellname"
|
Sub SpellSub
/if $defined(Fail)==FALSE /call SpellSubVars
/if $char(state)==SIT {
/stand
}
/varset Remem 0
/varset Fail 0
/varset SpellName "@Param0"
:MemWait
/doevents
/if n @Fail==1 {
/varset Fail 0
/if n @Remem==1 {
/memspellset DefaultSpellSet
:loadsploop
/delay 5
/if $char(spellbook)=="TRUE" /goto :loadsploop
}
/return
}
/varset SpellSlot $char(gem,"@SpellName")
/if n @SpellSlot<0 {
/delay 1s
/goto :MemWait
}
/if n @SpellSlot==0 {
/memspell 2 "@Param0"
/varset SpellSlot 2
/varset Remem 1
:refreshwait
/doevents
/if n @Fail==1 {
/varset Fail 0
/if n @Remem==1 {
/memspellset DefaultSpellSet
:loadsploop
/delay 5
/if $char(spellbook)=="TRUE" /goto :loadsploop
}
/return
}
/delay 5
/if n $char(gem,"@SpellName")<=0 /goto :refreshwait
}
/varset CastTime "$spell("@SpellName",casttime)"
/varadd CastTime 1
:BeginCast
/varset Fail 0
/varset DoAgain 0
/varset StartCast 0
/call WaitForStart
:TimerLoop
/doevents
/if n @DoAgain==1 /goto :BeginCast
/if n @Fail==1 {
/varset Fail 0
/if n @Remem==1 {
/memspellset DefaultSpellSet
:loadsploop
/delay 5
/if $char(spellbook)=="TRUE" /goto :loadsploop
}
/return
}
/if n @CTimer>0 /goto :TimerLoop
/delay 2
/doevents
/if n @DoAgain==1 /goto :BeginCast
/if n @Remem==1 {
/memspellset default
:loadsploop
/delay 5
/if $char(spellbook)=="TRUE" /goto :loadsploop
}
/return
|WaitForStart
|Used by SpellSub to determine when to start spell countdown.
Sub WaitForStart
/cast @SpellSlot
:StartLoop
/doevents
/if n @Fail==1 /return
/if n @DoAgain==1 /return
/if n @StartCast==0 {
/goto :StartLoop
}
/varset CTimer "@CastTime"s
/return
Sub SpellSubVars
/declare Fail global
/declare DoAgain global
/declare SpellName global
/declare Remem global
/declare SpellSlot global
/declare StartCast global
/declare CastTime global
/declare CTimer timer
/declare OOMtimer timer
/return
Sub Event_CastStart
/varset StartCast 1
/return
Sub Event_CastFizzle
/delay 2
/varset DoAgain 1
/return
Sub Event_CastInterrupt
/delay 2
/if n @Fail==1 /return
/varset DoAgain 1
/return
Sub Event_Sitting
/stand
/delay 2
/varset DoAgain 1
/return
Sub Event_CastTooFar
/varset Fail 1
/varset CTimer 0
/return
Sub Event_Distracted
/varset Fail 1
/varset CTimer 0
/return
Sub Event_NoTarget
/varset Fail 1
/varset CTimer 0
/return
Sub Event_NoMem
/varset Fail 1
/varset CTimer 0
/return
Sub Event_CastNoMana
/varset DoAgain 1
/if $char(state)==STAND /sit on
/varset OOMtimer 130
:medingwait
/delay 1
/doevents
/if n @OOMtimer>0 /goto :medingwait
/sit off
/return
Sub Event_Stunned
/delay 3s
/varset DoAgain 1
/return
Sub Event_Recovered
/delay 2s
/varset DoAgain 1
/return
Sub Event_CastResist
/tell @MasterName Resisted.
/varset Fail 1
/return
Sub Event_Collapse
/varset DoAgain 1
/return
Sub Event_NoLOS
/varset Fail 1
/varset CTimer 0
/return
My problem is that this sub that I have been using FOREVER won't accept /call SpellSub "Tnarg's Mending"!
Im sure the problem is with the space or the ', I just don't know how to get around it =/
Hewp pwease.
Sky
