generic quest #166

Parent #1Owner #361Flags read, fertileSource hellcore/hellcore.db

Aliases: generic quest

12 verbs · 23 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
award_tothis none thisrxd#16659
_award_tothis none thisrxd#1663
remove_fromthis none thisrxd#16626
tree_tagthis none thisrxd#16620
remove_from_allthis none thisrxd#16615
recyclethis none thisrxd#1662
rumorsthis none thisrxd#1667
earned_bythis none thisrxd#1667
change_valuethis none thisrxd#1667
add_hintthis none thisrxd#16624
name_forthis none thisrxd#1662
description_forthis none thisrxd#1662

Properties

PropertyDefinerFlagsOwnerValue
xp_award#166rc#36150
item_award#166rc#361#-1
earned_by#166rc#361{#620198}
earn_msg#166rc#361""
news_msg#166rc#361{}
news_time#166rc#36121600
metaquest#166rc#361#-1
title_bestowed#166rc#361""
brag_msg#166rc#361""
net_color#166rc#361""
credit_award#166rc#3610
rep_msg#166rc#361{}
survive_reroll#166rc#3610
aliases#1rc#361{"generic quest"}
description#1rc#361<clear>
object_size#1r#29{8476, 1298433929}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rc#361<clear>
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #1 root

Children: #238 generic achievement

Call graph

calls n166_0 #166:award_to n166_10 #166:name_for n166_0->n166_10 n103_1 #103:spawn n166_0->n103_1 n166_1 #166:_award_to n166_0->n166_1 n57_9 #57:valid n166_0->n57_9 n45_2 #45:has_verb n166_0->n45_2 n20_59 #20:name_and_number n166_0->n20_59 n1_30 #1:name n166_10->n1_30 n166_2 #166:remove_from n48_8 #48:suspend_if_needed n166_2->n48_8 n166_3 #166:tree_tag n166_3->n57_9 n166_3->n20_59 n166_4 #166:remove_from_all n166_4->n48_8 n42_0 #42:controls n166_4->n42_0 n166_5 #166:recycle n166_5->n166_4 n1_1 #1:recycle n166_5->n1_1 n166_6 #166:rumors n45_23 #45:leaves n166_6->n45_23 n166_8 #166:change_value n166_8->n48_8 n166_9 #166:add_hint n122_8 #122:strip n166_9->n122_8 n47_16 #47:slice n166_9->n47_16

Source

award_to

Spec this none thisFlags rxdOwner #361Definer #166

Referenced by

none

Source

1wholist = (typeof(args[1]) == LIST) ? args[1] | {args[1]};
2earned = 0;
3for who in (wholist)
4if ((is_a(who, $player) && (who:area() != #1436)) && who.xp_total)
5if (!(this in who.quest_xp))
6if (m = this.earn_msg)
7who:tell($ansi.bold_on, m, $ansi.reset);
8endif
9who:tell(tostr($ansi.bold_on, "You earned the '", this:name_for(who), "' XP award!", $ansi.reset));
10$nets.questnet:announce(who, tostr(this.net_color, who.name, " earned the '", this.name, "' quest award for ", this.xp_award, " XP.", $ansi.reset), 1);
11who:award_xp(this.xp_award);
12"if (c = this.credit_award)";
13"  who:credit_receive(c, #-1);";
14"endif";
15awards = this.item_award;
16if (typeof(awards) != LIST)
17awards = {awards};
18endif
19for item in (awards)
20if (valid(item))
21item = $rpg:spawn(item);
22if (who:get_gift(item, #-1))
23who:tell($ansi.bold_on + "You got ", item:iname(), "!", $ansi.reset);
24else
25item:moveto(who.location);
26who:tell($ansi.bold_on + "You got ", item:iname(), " but couldn't take it!  It's on the ground.", $ansi.reset);
27endif
28endif
29endfor
30if (!who.quest_xp)
31who:tell(($ansi.bold_on + "To view your unique XP awards, type 'journal'.") + $ansi.reset);
32endif
33who.quest_xp = setadd(who.quest_xp, this);
34if (this in keys(who.quests))
35who.quests = hashremove(who.quests, this);
36endif
37this.earned_by = setadd(this.earned_by, who);
38if (this.news_msg && (!is_a(who, $immortal)))
39$rpg.news:add_quest(this, who);
40endif
41this:_award_to(who);
42if (!$recycler:valid(who.respawn))
43who.respawn = who:default_respawn();
44endif
45if (((or = who.respawn) != $player_start) && (!$ou:has_verb(or, "update_clone")))
46who.respawn = who:default_respawn();
47$nets.prognet:announce(#2, ($su:nn(who) + " had weird .respawn: ") + $su:nn(or), 1);
48endif
49if (!$recycler:valid(who.respawn))
50who.respawn = who:default_respawn();
51endif
52"if (!who:is_hardcore())";
53"  #2800:update_clone(who);";
54"endif";
55earned = earned + 1;
56endif
57endif
58endfor
59return earned;

_award_to

Spec this none thisFlags rxdOwner #361Definer #166

Referenced by

Source

1if ((this != this.metaquest) && is_a(this.metaquest, #37269))
2this.metaquest:should_award_to(args[1]);
3endif

remove_from

Spec this none thisFlags rxdOwner #361Definer #166

Referenced by

none

Source

1{who, ?force = 0} = args;
2wholist = (typeof(who) == LIST) ? who | {who};
3dont_remove = {#183254};
4if ((!force) && (this in dont_remove))
5return 0;
6endif
7removed = 0;
8for p in (wholist)
9$cu:sin(0);
10if (is_a(p, $player))
11if ((this in p.quest_xp) || (p in this.earned_by))
12xp = this.xp_award;
13new_total = max(1, p.xp_total - xp);
14new_unspent = min(0, p.xp - xp);
15if (0 && ((new_total < 0) || (new_unspent < 0)))
16raise(E_INVIND);
17endif
18p.quest_xp = setremove(p.quest_xp, this);
19this.earned_by = setremove(this.earned_by, p);
20p.xp_total = new_total;
21p.xp = new_unspent;
22removed = removed + 1;
23endif
24endif
25endfor
26return removed;

tree_tag

Spec this none thisFlags rxdOwner #361Definer #166

Referenced by

none

Source

1r = "";
2if (this.survive_reroll)
3r = tostr(r, " ", $ansi.blue, $ansi.bold_on, "!", $ansi.reset);
4endif
5if (this.xp_award)
6r = tostr(r, " ", this.xp_award, "XP");
7endif
8if ((typeof(this.item_award) == OBJ) && valid(this.item_award))
9r = tostr(r, " ", $su:nn(this.item_award));
10endif
11if ($recycler:valid(this.metaquest))
12r = ((r + " ") + "metaquest: ") + $su:nn(this.metaquest);
13endif
14if ("_award_to" in verbs(this))
15r = r + " _award_to";
16endif
17if (this.net_color)
18r = (((r + " ") + this.net_color) + "questnet") + $ansi.reset;
19endif
20return r;

remove_from_all

Spec this none thisFlags rxdOwner #361Definer #166

Referenced by

Source

1if ((!valid(cp = caller_perms())) || (!$perm_utils:controls(cp, this)))
2return {};
3endif
4earned = this.earned_by;
5removed = {};
6for x in (this.earned_by)
7if (is_a(x, $player) && (this in x.quest_xp))
8x.quest_xp = setremove(x.quest_xp, this);
9removed = setadd(removed, x);
10earned = setremove(earned, x);
11endif
12$cu:sin(1);
13endfor
14this.earned_by = earned;
15return removed;

recycle

Spec this none thisFlags rxdOwner #361Definer #166

Referenced by

none

Source

1this:remove_from_all();
2return pass(@args);

rumors

Spec this none thisFlags rxdOwner #361Definer #166

Referenced by

none

Source

1r = {};
2for x in ($ou:leaves($rumor))
3if (x.quest == this)
4r = setadd(r, x);
5endif
6endfor
7return r;

earned_by

Spec this none thisFlags rxdOwner #361Definer #166

Referenced by

none

Source

1{who} = args;
2if (!is_a(who, $player))
3return 0;
4elseif (!(this in who.quest_xp))
5return 0;
6endif
7return who in this.earned_by;

change_value

Spec this none thisFlags rxdOwner #361Definer #166

Referenced by

none

Source

1oldvalue = this.xp_award;
2newvalue = args[1];
3this.xp_award = newvalue;
4for x in (this.earned_by)
5x:award_xp(newvalue - oldvalue);
6$cu:sin(0);
7endfor

add_hint

Spec this none thisFlags rxdOwner #361Definer #166

Referenced by

none

Source

1{who, hint, ?announce = 0} = args;
2hint = $ansi:strip(hint);
3if (this in who.quest_xp)
4return;
5endif
6if (announce)
7who:systell(hint);
8endif
9first = (!who.quests) ? 1 | 0;
10if (!(this in keys(who.quests)))
11who.quests[this] = {};
12endif
13hints = who.quests[this];
14if (!(hint in $lu:slice(hints, 2)))
15if (!who.quests[this])
16who:systell("You just got a hint about the '", this.name, "' journal.");
17else
18who:systell("You got another hint about '", this.name, "'.");
19endif
20if (first)
21who:systell("To refer back to hints you've received, type 'hints'.");
22endif
23who.quests[this] = listappend(who.quests[this], {area(who), hint});
24endif

name_for

Spec this none thisFlags rxdOwner #361Definer #166

Referenced by

Source

1{who} = args;
2return this:name();

description_for

Spec this none thisFlags rxdOwner #361Definer #166

Referenced by

none

Source

1{who} = args;
2return this.description;