Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts
jessew
Apprentice


Joined: 03 Mar 2003
Posts: 141

PostPosted: Wed Dec 08, 2004 5:53 am   

Medievia - Updated Spellup Script
 
To Install - use the #read command, if you dont know how the easiest way is to copy these scripts and save them to a file, put it in your zmud root directory and type #read <filename>

You need my CaebUtils Script posted in the finish forums installed first before installing this.
http://forums.zuggsoft.com/phpbb/viewtopic.php?t=19482

If you used my old spellup script you will need to redo profiles, but this one works much better pause/restart wise.

Code:

;;Version 2.2 - Fixed missing Run Profile Option implementation from menu
#DELCLASS "ZSpellup"
#DELCLASS "CaebSpellup"

#IF (@CaebUtils_Version < 1.0) {
      #MESSAGE CaebSpellup requires CabeUtils script please install that first.
      #ABORT 1
}

#CLASS "CaebSpellup"

    #VAR CaebSpellup_Version 2.2

    #ALIAS spc {cspoptions}

    #ALIAS spr {
        #IF (!@csinspellup) {
            cspmsg_error_noprofilerunning
            #ABORT 1
        }
        csspellupdone
        #VAR cspaused 0 0 "CaebSpellup"
        cspmsg_info_reset
    }

    #ALIAS spp {
        #IF (!@csinspellup) {
            cspmsg_error_noprofilerunning
            #ABORT 1
        }
        #IF (@cspaused) {
            cspemsg_error_alreadypaused
            #ABORT 1
        }
        cs_pause_cast "User Requested pause"
    }

    #ALIAS sp {
        #IF (!%numitems(@csprofiles)) {
            cspmsg_error_noprofiles
            #ABORT 1
        }
        #IF (%1) {
            csrunspellup %1
        } {
            #IF (@cspaused) {
                csresumespellup
            } {
                #IF (!@csdefault) {
                    cspmsg_error_nodefault
                    #ABORT 1
                } {
                    csrunspellup @csdefault
                }
            }
        }
    }

    #ALIAS csresumespellup {
        #VAR cspaused 0 0 "CaebSpellup"
        cspmsg_spellup_resume @cscurprof
        cs_first_cast
    }

    #ALIAS csrunspellup {
        #VAR csinspellup 1 0 "CaebSpellup"
        #VAR cscurprof %1 _nodef "CaebSpellup"
        #VAR cscurspell 1 0 "CaebSpellup"
        cspmsg_spellup_running @cscurprof
        cs_first_cast
    }

    #ALIAS cs_first_cast       {
        csstartup
        #EXEC {c %item(%eval(@@cscurprof),@cscurspell)}
        cspmsg_spellup_plaincast %item(%eval(@@cscurprof),@cscurspell)
    }
    #ALIAS cs_fumble_cast      {
        c %item(%eval(@@cscurprof),@cscurspell)
        cspmsg_spellup_fumblecast %item(%eval(@@cscurprof),@cscurspell)
    }
    #ALIAS cs_stand_cast       {
        stand
        c %item(%eval(@@cscurprof),@cscurspell)
        cspmsg_spellup_standcast %item(%eval(@@cscurprof),@cscurspell)
    }
    #ALIAS cs_not_learned_cast {
        #VAR cscurspell %eval(@cscurspell + 1) _nodef "CaebSpellup"
        #IF (@cscurspell > %numitems(%eval(@@cscurprof))) {
            csspellupdone
        } {
            c %item(%eval(@@cscurprof),@cscurspell)
            cspmsg_spellup_nolearncast %item(%eval(@@cscurprof),@cscurspell)
        }
    }
    #ALIAS cs_success_cast     {
        #VAR cscurspell %eval(@cscurspell + 1) _nodef "CaebSpellup"
        #IF (@cscurspell > %numitems(%eval(@@cscurprof))) {
            csspellupdone
        } {
            c %item(%eval(@@cscurprof),@cscurspell)
            cspmsg_spellup_successcast %item(%eval(@@cscurprof),@cscurspell)
        }
    }
    #ALIAS cs_pause_cast       {
        cspmsg_spellup_pausing %-1
        csshutdown
        #VAR cspaused 1 0 "CaebSpellup"
    }

    #ALIAS csspellupdone {
        csshutdown
        cspmsg_spellup_done @cscurprof
        #VAR csinspellup 0 0 "CaebSpellup"
    }

    #ALIAS csshutdown {
        #T- "CaebSpellup|Triggers"
    }

    #ALIAS csstartup {
        #T+ "CaebSpellup|Triggers"
    }

    #VAR cspaused    0 0
    #VAR cscurspell  0 0
    #VAR cscurprof   "" ""

    #VAR csdefault   ""
    #VAR csprofiles  ""
    #VAR cstemp      "" ""
    #VAR csallspells "armor|bless|breathe water|detect evil|detect good|detect invisibility|detect magic|fireshield|infravision|invisibility|levitate|manashield|map catacombs|phantasmal image|protection|quickness|sanctuary|sense life|shield|stone skin|strength"
    #VAR cspicks     "" ""
    #VAR csmainmenu "Create new profile|Modify existing profile|Choose new default profile|Delete a profile|Rename an existing profile|Run a profile"

    #ALIAS cspoptions {
        #VAR cstemp %ismember(%pick("p:CaebSpellup Main Menu","o:1",@csmainmenu),@csmainmenu) "" "CaebSpellup"
        #IF (@cstemp) {
            #CASE @cstemp {cspcreatenew} {cspmodify} {csnewdefault} {csdelete} {csrename} {csrunprofile}
        } {
            cspmsg_info_abortmain
        }
    }

    #ALIAS cspcreatepicks {
        #VAR cspicks "" "" "CaebSpellup"
        #FORALL @csallspells {
            #IF (%ismember(%i, %eval(@%1))) {
                #VAR cspicks %additem(%concat(*,%i),@cspicks) "" "CaebSpellup"
                } {
                #VAR cspicks %additem(%i, @cspicks) "" "CaebSpellup"
            }
        }
    }

    #ALIAS cspcreatenew {
        #VAR cstemp %prompt("Enter profile Name", "Enter the name for you new profile") "" "CaebSpellup"
        #IF (!@cstemp) {
            cspmsg_info_abortcreate @cstemp
            #ABORT 1
        }
        #IF (%ismember(@cstemp,@csprofiles)) {
            cspmsg_error_alreadyexists
            #ABORT 1
        }
        cspcreatepicks
        #VAR @cstemp %pick("p:Choose spells for you new profile",@cspicks) _nodef "CaebSpellup"
        #IF (!@%eval(@cstemp)) {
            cspmsg_info_abortcreate @cstemp
            #UNVAR @cstemp
            #ABORT 1
        }
        #VAR csprofiles %additem(@cstemp, @csprofiles) _nodef "CaebSpellup"
        cspmsg_success_create @cstemp
        #IF (%numitems(@csprofiles) = 1) {
            #VAR csdefault @cstemp _nodef "CaebSpellup"
            cspmsg_info_autoset @cstemp
        }
    }

    #ALIAS csrunprofile {
        #IF (!%numitems(@csprofiles)) {
            cspmsg_error_noprofiles
            #ABORT 1
        }
        #VAR cstemp %pick("p:Choose profile to run", @csprofiles) "" "CaebSpellup"
        #IF (!@cstemp) {
            cspmsg_info_abortmodify
            #ABORT 1
        }
        cspcreatepicks @cstemp
        #VAR cstempprofile %pick("p:Modify profile",@cspicks) "" "CaebSpellup"
        #IF (!@cstempprofile) {
            cspmsg_info_abortmodify
            #ABORT 1
        }
        sp @cstempprofile
    }

    #ALIAS cspmodify {
        #IF (!%numitems(@csprofiles)) {
            cspmsg_error_noprofiles
            #ABORT 1
        }
        #VAR cstemp %pick("p:Choose profile to modify", @csprofiles) "" "CaebSpellup"
        #IF (!@cstemp) {
            cspmsg_info_abortmodify
            #ABORT 1
        }
        cspcreatepicks @cstemp
        #VAR cstempprofile %pick("p:Modify profile",@cspicks) _nodef "CaebSpellup"
        #IF (!@cstempprofile) {
            cspmsg_info_abortmodify
            #ABORT 1
        }
        #VAR @cstemp @cstempprofile _nodef "CaebSpellup"
        cspmsg_success_modify @cstemp
    }

    #ALIAS csnewdefault {
        #IF (!%numitems(@csprofiles)) {
            cspmsg_error_noprofiles
            #ABORT 1
        }
        #VAR cstemp %pick("p:Choose new default profile", @csprofiles) "" "CaebSpellup"
        #IF (!@cstemp) {
            cspmsg_info_abortdefault
            #ABORT 1
        }
        #VAR csdefault @cstemp _nodef "CaebSpellup"
        cspmsg_success_default @cstemp
    }

    #ALIAS csdelete {
        #IF (!%numitems(@csprofiles)) {
            cspmsg_error_noprofiles
            #ABORT 1
        }
        #VAR cstemp %pick("p:Choose profile to delete", @csprofiles) "" "CaebSpellup"
        #IF (!@cstemp) {
            cspmsg_info_abortdelete
            #ABORT 1
        }
        #VAR csprofiles %delitem(@cstemp,@csprofiles) _nodef "CaebSpellup"
        #UNVAR %eval(@cstemp)
        cspmsg_success_delete @cstemp
        #IF (@csdefault = @cstemp) {
            cspmsg_info_deletedefault
        }
    }

    #ALIAS csrename {
        #IF (!%numitems(@csprofiles)) {
            cspmsg_error_noprofiles
            #ABORT 1
        }
        #VAR cstemp %pick("p:Choose profile to rename", @csprofiles) "" "CaebSpellup"
        #IF (!@cstemp) {
            cspmsg_info_abortrename
            #ABORT 1
        }
        #VAR cstempname %prompt("New name of profile","Enter a new name for you profile") "" "CaebSpellup"
        #IF (!@cstempname) {
            cspmsg_info_abortrename
            #ABORT 1
        }
        #IF (%ismember(@cstempname,@csprofiles)) {
            cspmsg_error_alreadyexists
            #ABORT 1
        }
        #VAR csprofiles %delitem(@cstemp,@csprofiles) _nodef "CaebSpellup"
        #VAR csprofiles %additem(@cstempname, @csprofiles) _nodef "CaebSpellup"
        #VAR @cstempname %eval(@@cstemp) "" "CaebSpellup"
        #UNVAR %eval(@cstemp)
        cspmsg_success_rename @cstemp @cstempname
        #IF (@csdefault = @cstemp) {
            #VAR csdefault @cstempname _nodef "CaebSpellup"
            cspmsg_success_default @cstemp
        }
    }

    #VAR csinfotitle    "CaebSpellup @CC(bold,green)INFO"
    #VAR cserrortitle   "CaebSpellup @CC(bold,red)ERROR"
    #VAR cssuccesstitle "CaebSpellup @CC(bold,magenta)SUCCESS"
    #VAR csspelluptitle "CaebSpellup @CC(bold,yellow)SPELLUP"

    #ALIAS cspmsg_spellup_running     {cmsg @csspelluptitle "Now starting spellup profile %1" "%1"}
    #ALIAS cspmsg_spellup_resume      {cmsg @csspelluptitle "Now resuming spellup profile %1" "%1"}
    #ALIAS cspmsg_spellup_plaincast   {cmsg @csspelluptitle "Now Casting: %1." "%1"}
    #ALIAS cspmsg_spellup_fumblecast  {cmsg @csspelluptitle "Fumbled ReCasting: %1." "%1"}
    #ALIAS cspmsg_spellup_standcast   {cmsg @csspelluptitle "AutoStand and ReCasting: %1." "%1"}
    #ALIAS cspmsg_spellup_nolearncast {cmsg @csspelluptitle "Spell Not Learned Now Casting: %1." "%1"}
    #ALIAS cspmsg_spellup_successcast {cmsg @csspelluptitle "Success Now Casting: %1." "%1"}
    #ALIAS cspmsg_spellup_pausing     {cmsg @csspelluptitle "Pausing Spellup:%1." "%1"}
    #ALIAS cspmsg_spellup_done        {cmsg @csspelluptitle "Spellup %1 completed." "%1"}

    #ALIAS cspmsg_error_noprofilerunning {cmsg @cserrortitle "You are not currently running a profile."}
    #ALIAS cspmsg_error_alreadypaused    {cmsg @cserrortitle "Spellup is already paused, use sp to resume." "sp"}
    #ALIAS cspmsg_error_nodefault        {cmsg @cserrortitle "You have not set a default profile, please do so first."}
    #ALIAS cspmsg_error_profilenotexist  {cmsg @cserrortitle "No such profile:%1." "%1"}
    #ALIAS cspmsg_error_noprofiles       {cmsg @cserrortitle "You have no profiles, you can create on through the menu."}
    #ALIAS cspmsg_error_alreadyexists    {cmsg @cserrortitle "A profile with that name already exists."}

    #ALIAS cspmsg_success_delete  {cmsg @cssuccesstitle "Deleted profile %1" "%1"}
    #ALIAS cspmsg_success_modify  {cmsg @cssuccesstitle "Profile %1 modified." "%1"}
    #ALIAS cspmsg_success_default {cmsg @cssuccesstitle "Default profile set to %1" "%1"}
    #ALIAS cspmsg_success_create  {cmsg @cssuccesstitle "New profile %1 created." "%1"}
    #ALIAS cspmsg_success_rename  {cmsg @cssuccesstitle "Profile %1 renamed to %2." "%1|%2"}

    #ALIAS cspmsg_info_deletedefault {cmsg @csinfotitle "You have deleted your default profile please go select one now"}
    #ALIAS cspmsg_info_abortdelete   {cmsg @csinfotitle "Aborted profile delete."}
    #ALIAS cspmsg_info_abortrun      {cmsg @csinfotitle "Aborted running a new profile."}
    #ALIAS cspmsg_info_noprofiles    {cmsg @csinfotitle "You have no profiles, please create a new one."}
    #ALIAS cspmsg_info_reset         {cmsg @csinfotitle "Spellup has been reset."}
    #ALIAS cspmsg_info_abortrename   {cmsg @csinfotitle "Aborted renaming profile."}
    #ALIAS cspmsg_info_abortmodify   {cmsg @csinfotitle "Aborted modifying profile."}
    #ALIAS cspmsg_info_abortcreate   {cmsg @csinfotitle "Aborted creating profile."}
    #ALIAS cspmsg_info_autoset       {cmsg @csinfotitle "%1 set to default profile automatically. You can change this through the menu." "%1"}
    #ALIAS cspmsg_info_abortmain     {cmsg @csinfotitle "Aborted main menu choice."}   
    #ALIAS cspmsg_info_abortdefault  {cmsg @csinfotitle "Aborted selecting new default profile."}
#CLASS 0

#CLASS "CaebSpellup|Triggers" disable

    #TRIGGER {Sorry, you can't do that.}          {cs_not_learned_cast}
    #TRIGGER {You have not practiced that spell!} {cs_not_learned_cast}

    #TRIGGER {Sparkles*as the magic is*undings.}  {cs_pause_cast Your in a no magic room.}
    #TRIGGER {The battle dist*ur spell casting.}  {cs_pause_cast Your in combat, resume later.}
    #TRIGGER {You can't summon en*o c*he spell.}  {cs_pause_cast Your out of mana, tick and resume.}
    #TRIGGER {You drea*hing such gr*dero*ats.}    {cs_pause_cast Your sleeping, wake and resume.}

    #TRIGGER {That is impossibl*hile sitting.}    {cs_stand_cast}
    #TRIGGER {You have to stand up be*hat.}       {cs_stand_cast}

    #TRIGGER {You chant out the arcane words*}    {cs_success_cast}
    #TRIGGER {You fumble over th*ection *}        {cs_fumble_cast}
    #TRIGGER {Can * follow you*~>}                {cs_pause_cast "Someone tried to follow."} "" {prompt|nocr}

#CLASS 0

#CLASS "CaebSpellup|Help"

    #ALIAS cspellhelpcreate {
        #VAR spellhelpmsg @hhtitle(%concat("CaebSpellup v",@CaebSpellup_Version," Help file")) _nodef "CaebSpellup|Help"
        #VAR spellhelpmsg %concat(@spellhelpmsg, @hhline) _nodef "CaebSpellup|Help"
        #VAR spellhelpmsg %concat(@spellhelpmsg, @hhentry("cspellhelp","-","Show this help file.")) _nodef "CaebSpellup|Help"
        #VAR spellhelpmsg %concat(@spellhelpmsg, @hhentry("spc","-","Enter menu system.")) _nodef "CaebSpellup|Help"
        #VAR spellhelpmsg %concat(@spellhelpmsg, @hhentry("sp","-","Resume paused spellup or run default profile")) _nodef "CaebSpellup|Help"
        #VAR spellhelpmsg %concat(@spellhelpmsg, @hhentry("sp (profile)","-","Run (profile)")) _nodef "CaebSpellup|Help"
        #VAR spellhelpmsg %concat(@spellhelpmsg, @hhentry("spr","-","Reset spellup: Clears all, current or paused.")) _nodef "CaebSpellup|Help"
        #VAR spellhelpmsg %concat(@spellhelpmsg, @hhentry("spp","-","Pauses the current spellup")) _nodef "CaebSpellup|Help"
        #VAR spellhelpmsg %concat(@spellhelpmsg, @hhline) _nodef "CaebSpellup|Help"
    }

    #ALIAS cspellhelp {
        #SHOW @spellhelpmsg
    }

#CLASS 0

cspellhelpcreate

cmsg %concat("CaebSpellup v",@CaebSpellup_Version) "Installing CaebSpellup. If you had zspellup or caebspellup before you will need to remake your profiles."

#IF (!%yesno("Would you like to add a submenu to your speedmenu for this script?")) {
    cmsg "CaebChat" "Not installing menu please type cspellhelp to see commands." "cspellhelp"
    #ABORT 1
}

#CLASS "CaebSpellup|Menu"

    #MENU {Caebryn's Spellup Script} {} "" "CaebSpellupSubMenu"

#CLASS 0

#CLASS "CaebSpellup|Menu|CaebSpellupSubMenu" menu
    #MENU {Help File} {cspellhelp}
    #MENU {%if(@cspaused,Resume spellup,Run default profile)} {sp}
    #MENU {Enter menu system} {spc}
    #MENU {Pause Spellup} {spp}
    #MENU {Reset Spellup} {spr}
#CLASS 0

#T- "CaebSpellup|Triggers"
_________________
I love deadlines. I like the whooshing sound they make as they fly by.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net