I've been trying to make a simple cleric heal script, which would be activated by me saying "Assist me on" in group chat and go back to main loop if I say "Fight over". Starting the script with "Assist me on" will work, and the script will heal. But NONE of the other Event calls will work!
I'm going crazy over this and I hope someone can point out to me where the error(s) is, because i'm out of ideas...
Here's the script;
Code: Select all
#turbo
#Chat group
| Simple cleric script by Sarah/Eloasti
#event Fizzle "Your spell fizzles!"
#event Interrupt "Your casting has been interrupted!"
#event Interrupt "Your spell is interrupted."
#event Recover "You haven't recovered yet..."
#event Recover "Spell recovery time not yet met."
#event Stunned "You cannot cast while stunned"
#event Collapse "Your gate is too unstable, and collapses."
#event Fight "Assist me on"
#event NoFight "Fight over"
Sub Main
/declare SpellName global
/declare FastHeal global
/declare Heal global
/declare Hotheal global
/declare ChatText global
/declare Spelldelay global
/declare GroupMember global
/declare GroupMemNum global
/declare Owner global
/declare Player global
/declare Fight global
/declare ALREADYSTART global
/declare ALREADYSTOP global
/varset SpellName " "
/varset FastHeal "Ethereal Remedy"
/varset Heal "Complete Healing"
/varset Hotheal "Supernal Elixir"
/varset ChatText " "
/varset Spelldelay 0
/varset GroupMemNum 0
/varset GroupMember " "
/varset Fight 0
/gsay Starting!
:MainLoop
/delay 0
/if n $char(mana,pct)<50 {
/if n @Fight==0 {
/gsay Low mana, need to meditate.
/sit
/call med
/gsay Full mana now.
/stand
}
}
/doevents
/if "$return"=="FIGHT_START" {
/varset Fight 1
/call Fight
}
/goto :MainLoop
Sub Fight
:GroupHPCheck
/for GroupMemNum 1 to $group(count)
/doevents
/if "$return"=="FIGHT_STOP" {
/gsay Ending...
/varset Fight 0
/return
}
/varset Player $group($calc(@GroupMemNum-1))
/if n @Player>0 {
/if n $spawn(@Player,hp,pct)<50 {
/tar id @Player
/delay 1s
/call healfast
}
/if n $spawn(@Player,hp,pct)<70 {
/tar id @Player
/delay 1s
/call heal
}
}
/next GroupMemNum
/goto :GroupHPCheck
/return
Sub healfast
/varset SpellName "@FastHeal"
/call spell_cast
/return
Sub heal
/varset SpellName "@Heal"
/call spell_cast
/return
Sub med
:medloop
/if n $char(mana,pct)==100 /return
/goto :medloop
Sub spell_cast
/stand
:castcast
/cast "@SpellName"
/doevents Event_Recover
/if "$return"=="RECOVER" /goto :castcast
/varset Spelldelay $spell("@SpellName",casttime)
/gsay Casting @SpellName at %t, landing in @Spelldelay seconds.
:WaitCast
/if "$char(casting)"=="TRUE" {
/delay 1
/goto :WaitCast
}
/doevents Event_Stunned
/if "$return"=="STUNNED" {
/delay 3s
/varset SpellName "@FastHeal"
/goto :castcast
}
/doevents Event_Interrupt
/if "$return"=="INTERRUPT" {
/delay 2s
/varset SpellName "@FastHeal"
/goto :castcast
}
/doevents Event_Fizzle
/if "$return"=="FIZZLE" /goto :castcast
/sit
/return
Sub Gate
/cast Gate
/return
Sub Event_Fizzle
/call spell_cast
/return FIZZLE
Sub Event_Revover
/return RECOVER
Sub Event_Interrupt
/return INTERRUPT
Sub Event_Stunned
/return STUNNED
Sub Event_Collapse
/delay 5
/call cast_spell
/return
Sub Event_Chat(Group,Eloasti,"Fight over")
/return FIGHT_STOP
Sub Event_Chat(Group,Eloasti,"Assist me on")
/return FIGHT_START
Sub End
/endmacro

