CacaoDemon
Sulfrum 17 Jun 2009 20:04
void spell_cacaodemon(int level, struct char_data *ch, struct char_data *victim, struct obj_data *obj) { struct affected_type af; assert(ch && victim && obj); if (A_NOPETS(ch)) { send_to_char("The arena rules do not permit you to summon pets!\n\r", ch); return; } act("$n gestures, and a black cloud of smoke appears", TRUE, ch, 0, 0, TO_ROOM); act("$n gestures, and a black cloud of smoke appears", TRUE, ch, 0, 0, TO_CHAR); if (GET_LEVEL(ch, CLERIC_LEVEL_IND) > 40 && IS_EVIL(ch)) { act("$p smokes briefly", TRUE, ch, obj, 0, TO_ROOM); act("$p smokes briefly", TRUE, ch, obj, 0, TO_CHAR); obj->obj_flags.cost /= 2; if (obj->obj_flags.cost < 100) { act("$p bursts into flame and disintegrates!", TRUE, ch, obj, 0, TO_ROOM); act("$p bursts into flame and disintegrates!", TRUE, ch, obj, 0, TO_CHAR); obj_from_char(obj); extract_obj(obj); } } else { act("$p bursts into flame and disintegrates!", TRUE, ch, obj, 0, TO_ROOM); act("$p bursts into flame and disintegrates!", TRUE, ch, obj, 0, TO_CHAR); obj_from_char(obj); extract_obj(obj); GET_ALIGNMENT(ch) -= 5; } char_to_room(victim, ch->in_room); act("With an evil laugh, $N emerges from the smoke", TRUE, ch, 0, victim, TO_NOTVICT); if (too_many_followers(ch)) { act("$N says 'No way I'm hanging with that crowd!!'", TRUE, ch, 0, victim, TO_ROOM); act("$N refuses to hang out with crowd of your size!!", TRUE, ch, 0, victim, TO_CHAR); } else { /* * charm them for a while */ if (victim->master) { stop_follower(victim); } add_follower(victim, ch); af.type = SPELL_CHARM_PERSON; af.duration = follow_time(ch); af.modifier = 0; af.location = 0; af.bitvector = AFF_CHARM; affect_to_char(victim, &af); } if (IS_SET(victim->specials.act, ACT_AGGRESSIVE)) { REMOVE_BIT(victim->specials.act, ACT_AGGRESSIVE); } if (IS_SET(victim->specials.act, ACT_META_AGG)) { REMOVE_BIT(victim->specials.act, ACT_META_AGG); } if (!IS_SET(victim->specials.act, ACT_SENTINEL)) { SET_BIT(victim->specials.act, ACT_SENTINEL); } }
#define DEMON_TYPE_I 20 #define DEMON_TYPE_II 21 #define DEMON_TYPE_III 22 #define DEMON_TYPE_IV 23 #define DEMON_TYPE_V 24 #define DEMON_TYPE_VI 25 #define TYPE_VI_ITEM 27002 #define TYPE_V_ITEM 5107 #define TYPE_IV_ITEM 5113 #define TYPE_III_ITEM 1101 #define TYPE_II_ITEM 21014 #define TYPE_I_ITEM 5105 void cast_cacaodemon(int level, struct char_data *ch, char *arg, int type, struct char_data *tar_ch, struct obj_data *tar_obj) { char buffer[40]; int mob, obj; struct obj_data *sac; struct char_data *el; int held = FALSE, wielded = FALSE; one_argument(arg, buffer); if (NoSummon(ch)) { return; } if (!str_cmp(buffer, "one")) { mob = DEMON_TYPE_I; obj = TYPE_I_ITEM; } else if (!str_cmp(buffer, "two")) { mob = DEMON_TYPE_II; obj = TYPE_II_ITEM; } else if (!str_cmp(buffer, "three")) { mob = DEMON_TYPE_III; obj = TYPE_III_ITEM; } else if (!str_cmp(buffer, "four")) { mob = DEMON_TYPE_IV; obj = TYPE_IV_ITEM; } else if (!str_cmp(buffer, "five")) { mob = DEMON_TYPE_V; obj = TYPE_V_ITEM; } else if (!str_cmp(buffer, "six")) { mob = DEMON_TYPE_VI; obj = TYPE_VI_ITEM; } else { send_to_char("It seems that all demons of that type are currently in " "the service of others.\n\r", ch); return; } if (!ch->equipment[WIELD] && !ch->equipment[HOLD]) { send_to_char("You must wield or hold an item to offer the demon for " "its services.\n\r", ch); return; } if (ch->equipment[WIELD] && obj_index[ch->equipment[WIELD]->item_number].virtual == obj) { wielded = TRUE; } if (ch->equipment[HOLD] && obj_index[ch->equipment[HOLD]->item_number].virtual == obj) { held = TRUE; } if (!wielded && !held) { send_to_char("You do the spell perfectly, but no demon comes.\n\r", ch); send_to_char("You realize that the demon was dissatisfied with your " "offering and\n\r", ch); send_to_char("wants you to offer it something else.\n\r", ch); return; } sac = unequip_char(ch, (held ? HOLD : WIELD)); if ((sac) && (GET_LEVEL(ch, CLERIC_LEVEL_IND) > 40) && IS_EVIL(ch)) { if (sac->obj_flags.cost >= 200) { equip_char(ch, sac, (held ? HOLD : WIELD)); } else { obj_to_char(sac, ch); } } else { obj_to_char(sac, ch); } if (sac) { if (ObjVnum(sac) != obj) { send_to_char("Your offering must be an item that the demon " "values.\n\r", ch); return; } el = read_mobile(mob, VIRTUAL); if (!el) { send_to_char("You sense that all demons of that kind are in " "others' services...\n\r", ch); return; } } else { send_to_char("You must be holding or wielding the item you are " "offering to the demon.\n\r", ch); return; } switch (type) { case SPELL_TYPE_SPELL: case SPELL_TYPE_SCROLL: spell_cacaodemon(level, ch, el, sac); break; default: Log("serious screw-up in cacaodemon."); break; } }
You'll pay for all your sins. If you already paid, please disregard this message.