bool spell_smokescreen_master(int sn, int level, CHAR_DATA *ch, void *vo, OBJ_DATA *obj) { ROOM_INDEX_DATA *arearoom; BUILD_DATA_LIST *pList = NULL; ROOM_AFFECT_DATA raf; pList = ch->in_room->area->first_area_room; if (pList == NULL || pList->data == NULL) return FALSE; arearoom = pList->data; if (IS_SET(arearoom->affected_by, ROOM_BV_SMOKESCREEN_AREA)) { send_to_char("@@NThere is already an @@dArea Smokescreen@@N operating in this area!\n\r", ch); return FALSE; } act("@@dA @@gSmokescreen@@d encompasses the area.@@N", ch, NULL, NULL, TO_ROOM); send_to_char("@@dYou fill the area with @@gSmoke@@d.@@N\n\r", ch); raf.type = sn; raf.duration = 20; raf.level = level; raf.bitvector = ROOM_BV_SMOKESCREEN_AREA; raf.caster = ch; raf.modifier = 0; raf.name = str_dup(""); affect_to_room(arearoom, &raf); return TRUE; }
bool spell_ordainsanctum(int sn, int level, CHAR_DATA * ch, void * vo, int target) { // Sanity check if (ch->in_room == NULL) { bug("Ordain sanctum called from null room", 0); return false; } // Check for cooldown if (is_affected(ch, sn)) { send_to_char("You are not yet ready to ordain this ground.\n", ch); return false; } // Check for effect already present if (room_is_affected(ch->in_room, sn)) { send_to_char("This place has already been ordained as a sanctum.\n", ch); return false; } // Check for annointing oil OBJ_DATA * obj(lookup_obj_extra_flag(ch, ITEM_ANNOINTINGOIL)); if (obj == NULL) { send_to_char("You cannot ordain this place without holy oil.\n", ch); return false; } // Ordain the room act("You murmur a soft chant, pouring out $p as you do so.", ch, obj, NULL, TO_CHAR); act("$n murmurs a soft chant, pouring out $p as $e does so.", ch, obj, NULL, TO_ROOM); act("As the last of the oil is poured out, you sense a certain protective aura fill this place.", ch, NULL, NULL, TO_ALL); AFFECT_DATA af = {0}; af.where = TO_ROOM; af.type = sn; af.level = level; af.duration = (level / 12); affect_to_room(ch->in_room, &af); // Apply a cooldown af.duration = 14; affect_to_char(ch, &af); return true; }
bool spell_sentry_master(int sn, int level, CHAR_DATA *ch, void *vo, OBJ_DATA *obj) { ROOM_INDEX_DATA *room; ROOM_AFFECT_DATA raf; ROOM_AFFECT_DATA *paf; room = ch->in_room; if (room == NULL) return FALSE; if (IS_SET(room->affected_by, ROOM_BV_SENTRY)) { for (paf = room->first_room_affect; paf; paf = paf->next) { if (paf->bitvector == ROOM_BV_SENTRY && paf->caster == ch) { send_to_char("@@NYou are already operating a @@dSentry@@N here!\n\r", ch); return FALSE; } } } if (ch->pcdata->runes >= 10) { send_to_char("You already have the maximum amount of rune/sentries.\n\r", ch); return FALSE; } if (*target_name == '\0') { send_to_char("You must give your sentry a name.\n\r", ch); return FALSE; } send_to_char("@@gYou set up a @@dSentry@@g.@@N\n\r", ch); raf.type = sn; raf.duration = 30; raf.level = level; raf.bitvector = ROOM_BV_SENTRY; raf.caster = ch; raf.modifier = 0; raf.name = str_dup(target_name); affect_to_room(room, &raf); return TRUE; }
bool spell_hoarfrost(int sn, int level, CHAR_DATA * ch, void * vo, int target) { // Sanity check if (ch->in_room == NULL || !ON_GROUND(ch)) { send_to_char("There is no solid ground here to rime over.\n", ch); return false; } // Check for cooldown if (is_affected(ch, sn)) { send_to_char("You are not prepared to conjure more hoarfrost yet.\n", ch); return false; } // Check for the room already having some if (room_is_affected(ch->in_room, sn)) { send_to_char("This place is already coated in hoarfrost.\n", ch); return false; } act("You spin in a slow circle, chanting softly as a thin layer of ice coats the ground.", ch, NULL, NULL, TO_CHAR); act("$n spins in a slow circle, chanting softly as a thin layer of ice coats the ground.", ch, NULL, NULL, TO_ROOM); // Add the effect AFFECT_DATA af = {0}; af.where = TO_ROOM; af.type = sn; af.level = level; af.duration = (level / 10); affect_to_room(ch->in_room, &af); // Add a cooldown af.duration = 8; affect_to_char(ch, &af); return true; }