ItemSkill(Script)

From CoffeeMud Wiki
Revision as of 21:24, 13 September 2022 by Loki (talk | contribs) (→‎Notes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
CoffeeMUD
Administrator                                                  Builder                                                              Player
=CoffeeMUD Builder Information=
Basics Praetor     Player Support     Commands     Zapper Masks Advanced Races     Classes     Abilities     Socials     Scripting    
Building Behaviors     Properties     Areas     Rooms     Exits     Items     Mobs Systems Achievements     Crafting     Help Info     Ships     Planes of Existence     Quests     Triumphs    

Skill Use on an Item

When designing a mob to work on a player's items, there are several considerations:

  • You need to make sure the player will get back their item, even if their inventory is full, or they are overloaded. If you do a GIVE command, and the player cannot accept the item, the mob will keep the item. Therefore, it is best to follow any GIVE commands with a DROP command.
  • When charging for services, you really don't want to encourage players killing the mob to get their money back. Therefore, consider resetting the mob's money.

Casting Refit for Free


give_prog all
     if level($n <= 25)
          mpcast refit $o
          give $o $n
          drop $o
          sayto $n That's more like it.
     else
          if isimmort($n)
               mpcast refit $o
               give $o $n
               drop $o
          sayto $n Anything for an immortal!
          else
               tsk $n
               sayto $n Tried to fool ol' Sandibald you did! Go to the mainlands.
               give $o $n
               drop $o
               chuckle
          endif
     endif
~

Notes

  • Note the DROP after the GIVE. This is a catch statement in case there is some reason preventing the character from receiving the item, the MOB will drop the item to the ground and the player can resolve their inventory issue without killing the MOB.