ID:195126
 
//Title: Verbs Packages
//Credit to: Gughunter
//Contributed by: Jtgibson


//This is a sample implementation on how to make "verbs packages".
// That is, you can give users a bunch of verbs simultaneously
// by grouping verbs into packages. The limits of this powerful
// feature are defined only by your imagination!


proc
AddSingleVerb(mob/mySrc, myVerb)
if(!mySrc.verbs.Find(myVerb))
mySrc.verbs += myVerb


verbPackage
proc
AddVerbs(mob/mySrc)

GMPrivs
proc
fudd()
usr << "Fudd!"

fnord()
usr << "Fnord!"

AddVerbs(mob/mySrc)
AddSingleVerb(mySrc,/verbPackage/GMPrivs/proc/fudd)
AddSingleVerb(mySrc,/verbPackage/GMPrivs/proc/fnord)

MageSpells
proc
fireball()
usr << "You cast a fireball!"

AddVerbs(mob/mySrc)
AddSingleVerb(mySrc,/verbPackage/MageSpells/proc/fireball)


mob
var
isMage = 1

Login()
..()
if(UsrIsGM())
call(/verbPackage/GMPrivs/AddVerbs)(src)

if(isMage)
call(/verbPackage/MageSpells/AddVerbs)(src)

proc
UsrIsGM()
return (usr.ckey == "thegamemaster")