Purify Spell [by Soren P. Skou]
Snippet Posted Wednesday, August 12th @ 11:34:23 PM, by George Greer in the Skills dept.
Added Dec 8, 1997. Click the link below to read it or download it.

From: "Soren P. Skou" <serces@MUD.DK>
Subject: Spell Purify

This is a purify spell.. Pretty much selfexplanatory, if thing is
poisoned, then it will remove the poison (Maybe) .. Please note,
that my value 3 (The poison) equals Level, this shouldn't do
anything for the normal Circle, since it just looks at poison as
either 0 or non-zero.

As always, should you choose to use this, then send me a mail,
corrections/improvements and so on are very much appreciated.

---------snip----------
ASPELL(spell_purify)
{

 /* Check if it's food or Drink Container */
 if (GET_OBJ_TYPE(obj) != ITEM_FOOD && GET_OBJ_TYPE(obj) !=
 ITEM_DRINKCON) {
  send_to_char("This cannot be purified further, purify your Eyes
  instead!\r\n", ch); return;
 }

 /* Is It poisoned? And are you a lower level? */
 if (GET_OBJ_VAL(obj, 3) <= GET_LEVEL(ch) && GET_OBJ_VAL(obj, 3)) {
  if (GET_INT(ch) > number(0, 24) || GET_LEVEL(ch) >= LVL_IMMORT) {
   GET_OBJ_VAL(obj, 3) = 0; /* No longer poisoned */
  }
 }
 /* Ok, not Poisoned, lets deal with Drink Containers first! */
 if (GET_OBJ_TYPE(obj) == ITEM_DRINKCON) {
  if (GET_INT(ch) > number(0, 24) || GET_LEVEL(ch) >= LVL_IMMORT) {
   if (GET_OBJ_VAL(obj, 2) > 0 && GET_OBJ_VAL(obj, 2) < 15) {
    GET_OBJ_VAL(obj, 2) = GET_OBJ_VAL(obj, 2) - 1;
    sprintf(buf, "%s seems to be purified.\r\n",
    obj->short_description); send_to_char(buf, ch); return;
   } else {
    send_to_char("This cannot be purified any more.\r\n", ch);
    return;
   }
  } else {
  /* Ui.. a fumble.. */
   if (GET_OBJ_VAL(obj, 2) < 14)
    GET_OBJ_VAL(obj, 2)++;

   if (!GET_OBJ_VAL(obj, 3) && number(0, 150) > GET_INT(ch) * 5)
    GET_OBJ_VAL(obj, 3) = GET_LEVEL(ch); /* Oups, a poison? */

   send_to_char("What a fumblefinger you are!\r\n", ch);
   return;
  }
 }
 else {
  /* Since it's not a Drink container, it must be food! */
  if (GET_INT(ch) > number(0, 24) || GET_LEVEL(ch) >= LVL_IMMORT) {
   if (GET_OBJ_VAL(obj, 0) >= 50) {
    send_to_char("This cannot be purified any more!\r\n", ch);
    return;
   }
   GET_OBJ_VAL(obj, 0) = GET_OBJ_VAL(obj, 0) + (GET_LEVEL(ch) >> 2);
   sprintf(buf, "%s seems to be purified.\r\n",
   obj->short_description); send_to_char(buf, ch); return;
  } else {
   if (GET_OBJ_VAL(obj, 0) > 3)
    GET_OBJ_VAL(obj, 0) = GET_OBJ_VAL(obj, 0) - 3;
   if (!GET_OBJ_VAL(obj, 3) && number(0, 150) > GET_INT(ch) * 5)
    GET_OBJ_VAL(obj, 3) = GET_LEVEL(ch); /* Oups, That one got poison
    */
   send_to_char("What a fumblefinger you are!\r\n", ch);
   return;
  }
 }
}


<< Proposal For New Player Structs [by Jaco] | Reply | View as text | Threaded | Push Code (for players) [by Leonardo Herrera] >>

 


Related Links
  download
Related Articles
More by greerga
 
 

CircleMUD Snippets
 
Note: Not all of these snippets will work perfectly with your version of code, so be prepared to fix one or two bugs that may arise, and please let me know what you needed to do to fix it. Sending a corrected version is always welcome.
Finally, if you wish to use any of the snippets from this page, you are more than welcome, just mention the authors in your credits. If you wish to release any of these snippets to the public on another site, contact me FIRST.