Book of Sleep #151

Parent #5Owner #2Flags read, fertileSource QuestCore.db

Aliases: Book of Sleep, sleepbook

2 verbs · 20 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
titlethis none thisrxd#1511
ca*stthis on top of/on/onto/upon anyrxd#15153

Properties

PropertyDefinerFlagsOwnerValue
spellcounter#151rc#210
drop_failed_msg#5rc#2<clear>
drop_succeeded_msg#5rc#2<clear>
odrop_failed_msg#5rc#2<clear>
odrop_succeeded_msg#5rc#2<clear>
otake_succeeded_msg#5rc#2<clear>
otake_failed_msg#5rc#2<clear>
take_succeeded_msg#5rc#2<clear>
take_failed_msg#5rc#2<clear>
value_base#102r#2300.0
damage_base#102r#2<clear>
x_loc#102r#36<clear>
y_loc#102r#36<clear>
ansi_title#102r#36<clear>
obvious#102r#36<clear>
build_help#102rc#2<clear>
key#1c#20
aliases#1rc#2{"Book of Sleep", "sleepbook"}
description#1rc#2"[green]You see a book bound in leather with magical text.[normal] [Spell: Sleep]"
object_size#1r#36{0, 0}

Ancestry

Ancestors (nearest first): #5 generic thing#102 subthing#1 Root Class

Children: none

Call graph

calls n151_1 #151:ca*st n6_18 #6:tell n151_1->n6_18 n151_0 #151:title n151_1->n151_0 n20_19 #20:match_object n151_1->n20_19 n52_0 #52:has_property n151_1->n52_0 n102_4 #102:title n151_1->n102_4 n63_1 #63:_recycle n151_1->n63_1

Source

title

Spec this none thisFlags rxdOwner #2Definer #151

Referenced by

Source

1return tostr("[yellow]", this.name, "[normal]");

ca*st

Spec this on top of/on/onto/upon anyFlags rxdOwner #2Definer #151

Referenced by

none

Source

1if ((this in player.contents) && (player.stats_current[2][3] >= 11.0))
2player:tell("You prepare to cast ", this:title(), "[normal]...");
3elseif (player.stats_current[2][3] < 11.0)
4player:tell("You do not have a high enough INT ability! This spell requires at least 11.0.");
5return;
6else
7player:tell("You are not carrying that.");
8return;
9endif
10target = $string_utils:match_object(iobjstr, player.location);
11if (!valid(target))
12player:tell("The target is invalid.");
13return;
14endif
15if ((((iobjstr == "me") || (iobjstr == "self")) || (iobjstr == "myself")) || (target == player))
16player:tell("You cannot cast this spell on yourself!");
17return;
18endif
19if ((!player.pkill) && (target in players()))
20return player:tell("You have PKILL set to off and cannot fight other players.");
21endif
22if (player.pkill && (!target.pkill))
23return player:tell(target:title(), " is a non-PKILL player.");
24endif
25if ($object_utils:has_property(target, "magic_immunity"))
26if (target.magic_immunity)
27player:tell(target:title(), " is immune to magic!");
28return;
29endif
30endif
31if (((target in player.location.contents) && $object_utils:has_property(target, "alive")) && $object_utils:has_property(target, "alert"))
32player:tell("You cast [yellow]Sleep[normal] on ", target:title(), "!");
33player.location:announce(player:title(), " casts [yellow]Sleep[normal] on ", target:title(), "!");
34target.alert = 0;
35if (!this.f)
36this.spellcounter = this.spellcounter - 1;
37if (!this.spellcounter)
38player:tell("The ", this:title(), " crumbles into dust!");
39$recycler:_recycle(this);
40endif
41endif
42player.location:announce_all(target:title(), " has fallen asleep!");
43fork (45)
44target.alert = 1;
45if (target.alive)
46player.location:announce_all(target:title(), " has awakened!");
47endif
48endfork
49else
50player:tell("No effect.");
51player:tell("The target must be a player or monster in the same area as you.");
52return;
53endif