@q @program asys-ppp 1 99999 d i ( *YOUR HEADER COMMENT HERE* Please do include a header comment. They're important. See other Argo programs for examples. USING ASYS-XSKILLS: Modify this program as needed to add new Argo skills. Begin by searching and replacing all instances of the string 'ppp' with the name of your program. Search and replace all instances of the string 'xxx' with the name of the skill. Code that handles effects of the skill should be placed in function Do. See the Argo Manual for further discussion. See asys-effects for examples. You may freely copy and modify functions from asys-effects for inclusion in this program. ) (2345678901234567890123456789012345678901234567890123456789012345678901) $def thisVersion "1.1" $define Tell me @ owner swap notify $enddef $define VerifyEvent caller #0 "@a/calls/eventloop" getprop dbcmp not if ">> This routine must be called from asys-eventmgr." me @ swap notify 0 exit then $enddef $include $lib/argo lvar ourArg (* inital arg string, unmodified *) lvar ourAttackVal (* int: amount skill user's roll was made by *) lvar ourBoolean (* int: misc flow control var *) lvar ourCom (* string: 'official' name of command *) lvar ourCounter (* misc. counter var *) lvar ourDataObj (* dbref: object holding system-wide data *) lvar ourDefenceVal (* int: amount defender's roll was made by *) lvar ourSkill (* string: name or prop of current skill *) lvar ourTarget (* dbref: player to heal *) lvar scratch (* workspace var *) : DoInstall ( -- ) (* install program into Argo system *) caller program? not if (* confirm installation method *) ">> Programs must be installed via the " "+install" GetCommandName strcat " command." strcat Tell exit then (* notify that we're starting... *) prog "@a/version" getpropstr if ">> Reinstalling..." Tell else ">> Installing..." Tell then (* record 'official' name of prog; remove old links *) prog "@a/name" "asys-ppp" setprop prog "@a/version" ArgoVersion setprop RecOldActions #0 "@a/prog_list/asys-ppp" prog setprop #0 "@a/calls/usexxx" prog setprop ">> Installed." Tell ; : DoUninstall (* uninstall program from Argo *) (* check: is program installed? *) prog "@a/name" getpropstr if #0 "@a/prog_list/" prog "@a/name" getpropstr strcat getprop not if ">> " prog name strcat " is not currently installed." strcat Tell pid kill then else ">> " prog name strcat " is not currently installed." strcat Tell pid kill then (* check: is program installed? *) ">> Please confirm: You wish to uninstall " prog name strcat "?" strcat Tell ReadYesNo not if ">> Aborted." Tell pid kill Then #0 "@a/calls/usexxx" remove_prop #0 "@a/prog_list/" prog "@a/name" getpropstr strcat remove_prop ">> Uninstalled. Please edit the online manual as appropriate." Tell ; : DoUseRoll ( -- s ) (* roll for caster *) -999 ourAttackVal ! (* use materials *) "@a/skills/$skill/materials/" ourSkill @ "$skill" subst UseMaterials (* apply fatigue *) me @ "@a/stats/fat" over over getpropstr atoi ourDataObj @ "@a/skills/$skill/fat" ourSkill @ "$skill" subst getpropstr atoi + intostr setprop (* get ability *) me @ "@a/skills/$skill" ourSkill @ "$skill" subst GetModAbility me @ "@a/stats/" "skills/$skill" ourSkill @ "$skill" subst GetBase strcat GetModAbility + me @ "@a/eloop/genmod" getpropstr atoi + me @ "@a/skills/$skill" ourSkill @ "$skill" subst GetModAbility if 3 else 4 then 6 0 Dice over over - ourAttackVal ! dup 4 <= if me @ RollXPs then dup 4 <= if pop pop "critsucc" exit then dup 17 >= if pop pop "critfail" exit then >= if "normsucc" else "normfail" then ; : DoDefenceRoll ( -- i ) (* roll for target *) -998 ourDefenceVal ! ourDataObj @ "@a/skills/$skill/def" ourSkill @ "$skill" subst getpropstr dup if scratch ! else pop "normfail" exit then (* get ability *) ourTarget @ scratch @ GetModAbility dup if 3 else 4 then 6 0 Dice over over - ourDefenceVal ! dup 4 <= if ourTarget @ RollXPs then dup 4 <= if pop pop "critsucc" exit then dup 17 >= if pop pop "critfail" exit then >= if "normsucc" else "normfail" then ; : Doxxx ( -- ) VerifyEvent "Doxxx" Tell (* YOUR PRIMARY FUNCTION GOES HERE*) ; : main "me" match me ! (* initialize *) GetDataObj ourDataObj ! strip ourArg ! trig "@a/name" getpropstr ourCom ! Update ourArg @ if ourArg @ "#" stringpfx if "#usexxx" ourArg @ smatch if Doxxx else "#install" ourArg @ stringpfx if DoInstall else "#uninstall" ourArg @ stringpfx if DoUninstall else ">> #Argument not understood." Tell then then then exit then then ; . c q @set asys-ppp=W