generic quest #166
Aliases: generic quest
12 verbs · 23 properties · 1 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
award_to | this none this | rxd | #166 | 59 |
_award_to | this none this | rxd | #166 | 3 |
remove_from | this none this | rxd | #166 | 26 |
tree_tag | this none this | rxd | #166 | 20 |
remove_from_all | this none this | rxd | #166 | 15 |
recycle | this none this | rxd | #166 | 2 |
rumors | this none this | rxd | #166 | 7 |
earned_by | this none this | rxd | #166 | 7 |
change_value | this none this | rxd | #166 | 7 |
add_hint | this none this | rxd | #166 | 24 |
name_for | this none this | rxd | #166 | 2 |
description_for | this none this | rxd | #166 | 2 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
xp_award | #166 | rc | #361 | 50 |
item_award | #166 | rc | #361 | #-1 |
earned_by | #166 | rc | #361 | {#620198} |
earn_msg | #166 | rc | #361 | "" |
news_msg | #166 | rc | #361 | {} |
news_time | #166 | rc | #361 | 21600 |
metaquest | #166 | rc | #361 | #-1 |
title_bestowed | #166 | rc | #361 | "" |
brag_msg | #166 | rc | #361 | "" |
net_color | #166 | rc | #361 | "" |
credit_award | #166 | rc | #361 | 0 |
rep_msg | #166 | rc | #361 | {} |
survive_reroll | #166 | rc | #361 | 0 |
aliases | #1 | rc | #361 | {"generic quest"} |
description | #1 | rc | #361 | <clear> |
object_size | #1 | r | #29 | {8476, 1298433929} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | <clear> |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #1 root
Children: #238 generic achievement
Call graph
Source
award_to
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
Referenced by
- #166:award_to line 41:
this:_award_to
Source
1if ((this != this.metaquest) && is_a(this.metaquest, #37269)) 2this.metaquest:should_award_to(args[1]); 3endif
remove_from
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
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
Referenced by
- #166:recycle line 1:
this:remove_from_all
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
Referenced by
none
Source
1this:remove_from_all(); 2return pass(@args);
rumors
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
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
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
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
Referenced by
- #166:award_to line 9:
this:name_for
Source
1{who} = args; 2return this:name();
description_for
Referenced by
none
Source
1{who} = args; 2return this.description;