<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://avendar.net/index.php?action=history&amp;feed=atom&amp;title=Avendar%3AProg_Appendix_6</id>
	<title>Avendar:Prog Appendix 6 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://avendar.net/index.php?action=history&amp;feed=atom&amp;title=Avendar%3AProg_Appendix_6"/>
	<link rel="alternate" type="text/html" href="https://avendar.net/index.php?title=Avendar:Prog_Appendix_6&amp;action=history"/>
	<updated>2026-05-21T04:27:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.4</generator>
	<entry>
		<id>https://avendar.net/index.php?title=Avendar:Prog_Appendix_6&amp;diff=2678&amp;oldid=prev</id>
		<title>Elanthe: Created page with &quot;= Appendix 6: Generic Prog Skeletons =  In this section, we will include generic versions of whole progs, to be cannibalized and adapted for future use. Make the parts that need to be changed obvious!  == Object Decay == Prevent useless items that might otherwise pile up as useless clutter from doing so. Other uses are to keep particular items from stashing/vault hording (though there would need to be a good reason for such), or having a &quot;Stone of Power&quot;-like random plac...&quot;</title>
		<link rel="alternate" type="text/html" href="https://avendar.net/index.php?title=Avendar:Prog_Appendix_6&amp;diff=2678&amp;oldid=prev"/>
		<updated>2025-01-19T03:10:09Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Appendix 6: Generic Prog Skeletons =  In this section, we will include generic versions of whole progs, to be cannibalized and adapted for future use. Make the parts that need to be changed obvious!  == Object Decay == Prevent useless items that might otherwise pile up as useless clutter from doing so. Other uses are to keep particular items from stashing/vault hording (though there would need to be a good reason for such), or having a &amp;quot;Stone of Power&amp;quot;-like random plac...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Appendix 6: Generic Prog Skeletons =&lt;br /&gt;
&lt;br /&gt;
In this section, we will include generic versions of whole progs, to be cannibalized and adapted for future use. Make the parts that need to be changed obvious!&lt;br /&gt;
&lt;br /&gt;
== Object Decay ==&lt;br /&gt;
Prevent useless items that might otherwise pile up as useless clutter from doing so. Other uses are to keep particular items from stashing/vault hording (though there would need to be a good reason for such), or having a &amp;quot;Stone of Power&amp;quot;-like random placement/movement effect.&lt;br /&gt;
&lt;br /&gt;
Requirements:&lt;br /&gt;
* an object&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;b&amp;gt;rand_prog 1&amp;lt;/b&amp;gt;&lt;br /&gt;
 if isheld($o)&lt;br /&gt;
   opvalueset 0 0&lt;br /&gt;
 else&lt;br /&gt;
   opvalueup 0&lt;br /&gt;
   if value(0) == [[3]]&lt;br /&gt;
     opecho [[$I crumbles to dust.]]&lt;br /&gt;
     oppurge self&lt;br /&gt;
    endif&lt;br /&gt;
 endif&lt;br /&gt;
&lt;br /&gt;
== Player-owned Shop ==&lt;br /&gt;
&amp;lt;b&amp;gt;With profit-sharing and optional comped goods&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Requirements:&lt;br /&gt;
* 1 shopkeeper mobile (requires act keepgold),&lt;br /&gt;
* 1 room flagged save, nowhere, nosum_to, nosum_from, and nogate,&lt;br /&gt;
* and 1 free bit. &lt;br /&gt;
&lt;br /&gt;
Progs go on the mob.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;load_prog 100&lt;br /&gt;
  speak common&lt;br /&gt;
&lt;br /&gt;
This mob talks, so include this if it&amp;#039;s not a human.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;verb_prog p collect&lt;br /&gt;
 if isbitset($n) == shopOwnerBit&lt;br /&gt;
        mpset mob self copper 0&lt;br /&gt;
        mpset mob self platinum 0&lt;br /&gt;
        mpset mob self gold 0&lt;br /&gt;
        mpset mob self silver 0&lt;br /&gt;
        mpat shop[[StorageVnum]] get all&lt;br /&gt;
        mpget mob $i platinum 0&lt;br /&gt;
        mpget mob $i gold 1&lt;br /&gt;
        mpget mob $i silver 2&lt;br /&gt;
        mpget mob $i copper 3&lt;br /&gt;
        if value(0) &amp;gt; 0&lt;br /&gt;
        or value(1) &amp;gt; 0&lt;br /&gt;
        or value(2) &amp;gt; 0&lt;br /&gt;
        or value(3) &amp;gt; 0&lt;br /&gt;
                say Your portion of the profits, sir.&lt;br /&gt;
                emote passes a small bag to $N.&lt;br /&gt;
 //above is the flavour section of the cash handoff-- you will want to write your own.                &lt;br /&gt;
                mpmath 4 \$3 + 10*\$2 + 100*\$1 + 1000*\$0&lt;br /&gt;
                mpmath 5 (\$4*2)/5&lt;br /&gt;
 //the above line is the one where owner return rate is determined.&lt;br /&gt;
 //do decimals via fractions. Example shown gives a 40% return--&lt;br /&gt;
 //use that number as-is unless you have a reason to do otherwise.&lt;br /&gt;
                mpmath 6 \$5/1000&lt;br /&gt;
                mpmath 5 \$5 - \$6*1000&lt;br /&gt;
                mpmath 7 \$5/100&lt;br /&gt;
                mpmath 5 \$5 - \$7*100&lt;br /&gt;
                mpmath 8 \$5/10&lt;br /&gt;
                mpmath 5 \$5 - \$8*10&lt;br /&gt;
                mpset mob self copper \$5&lt;br /&gt;
                mpset mob self platinum \$6&lt;br /&gt;
                mpset mob self gold \$7&lt;br /&gt;
                mpset mob self silver \$8&lt;br /&gt;
                give \$5 copper $n&lt;br /&gt;
                give \$8 silver $n&lt;br /&gt;
                give \$7 gold $n&lt;br /&gt;
                give \$6 platinum $n&lt;br /&gt;
                note to immortal&lt;br /&gt;
                note subject $N collected $s filthy, filthy lucre.&lt;br /&gt;
                note + I passed off \$6 platinum, \$7 gold, \$8 silver, and \$5 copper.&lt;br /&gt;
                note send&lt;br /&gt;
                &lt;br /&gt;
        else&lt;br /&gt;
                say I apologize, sir, but there hasn&amp;#039;t been enough business, since you were by last.&lt;br /&gt;
  //flavour for no money in the storage room; again, write your own.                &lt;br /&gt;
        endif&lt;br /&gt;
 else&lt;br /&gt;
        emote pointedly ignores $N.&lt;br /&gt;
 //you ain&amp;#039;t the boss of me-- and the same.        &lt;br /&gt;
 endif&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;verb_prog p buy&lt;br /&gt;
 if isbitset($n) == shop[[OwnerBit]]&lt;br /&gt;
        mpinterpret $n $x&lt;br /&gt;
        mpget mob $i platinum 0&lt;br /&gt;
        mpget mob $i gold 1&lt;br /&gt;
        mpget mob $i silver 2&lt;br /&gt;
        mpget mob $i copper 3&lt;br /&gt;
        give \$0 platinum $n&lt;br /&gt;
        give \$1 gold $n&lt;br /&gt;
        give \$2 silver $n&lt;br /&gt;
        give \$3 copper $n&lt;br /&gt;
        tell $n Your money is no good here, sir.&lt;br /&gt;
 else&lt;br /&gt;
 //the above section can be removed for a shop that doesn&amp;#039;t comp purchases, or math can be done to provide&lt;br /&gt;
 //a discount rather than comping, if you study the math in &amp;#039;collect&amp;#039; above.&lt;br /&gt;
        mpinterpret $n $x&lt;br /&gt;
        mpget mob $i platinum 0&lt;br /&gt;
        mpget mob $i gold 1&lt;br /&gt;
        mpget mob $i silver 2&lt;br /&gt;
        mpget mob $i copper 3&lt;br /&gt;
        mpat shop[[StorageVnum]] drop \$0 platinum&lt;br /&gt;
        mpat shop[[StorageVnum]] drop \$1 gold&lt;br /&gt;
        mpat shop[[StorageVnum]] drop \$2 silver&lt;br /&gt;
        mpat shop[[StorageVnum]] drop \$3 copper&lt;br /&gt;
 endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Dreams ==&lt;br /&gt;
&amp;lt;b&amp;gt;Gives a dream one or more times to any number of particular, sleeping PCs&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Resources needed:&lt;br /&gt;
* A dream manager bot added as a standard reset.&lt;br /&gt;
* A dream handler bot which is loaded by the manager.&lt;br /&gt;
* A bit number, if you want to have the complete dream given only once.&lt;br /&gt;
* The content of the dream, to be added in the data prog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manager bot progs&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;rand_prog 100&lt;br /&gt;
 // Periodically runs the dream sequence&lt;br /&gt;
 // This could also easily work as a time prog, a verb_prog, etc.&lt;br /&gt;
 // For a rand prog, the 0 value check can vary for a less or more &lt;br /&gt;
 // frequent/likely dream, but it must be higher than the number &lt;br /&gt;
 // of lines in dream data_progs.&lt;br /&gt;
 //&lt;br /&gt;
 mpvalueup 0&lt;br /&gt;
 if value(0) == 250&lt;br /&gt;
   mpvalueset 0 0&lt;br /&gt;
   mpmasstrigger&lt;br /&gt;
 endif&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;trigger_prog 100&lt;br /&gt;
 if position($n) == 4&lt;br /&gt;
   // Stops if the PC has already dreamed the complete dream.&lt;br /&gt;
   if isbitset($n) == [[StopDreamBit]]&lt;br /&gt;
     break&lt;br /&gt;
   endif&lt;br /&gt;
   // Conditions for the dream. Could use a &amp;quot;name($n) == Jolinn&amp;quot; to target only 1 PC.&lt;br /&gt;
   [[if class($n) == 4]]&lt;br /&gt;
   [[or ischaotic($n)]]&lt;br /&gt;
   [[or israce($n) == kankoran]]&lt;br /&gt;
     mpmload [[DreamHandlerVnum]]&lt;br /&gt;
     mpforce [[DreamHandlerName]] mpfocus $n&lt;br /&gt;
     mpforce [[DreamHandlerName]] mpsetdata dream_time&lt;br /&gt;
     mpstring mob [[DreamHandlerName]] long $I is giving $N a dream.&lt;br /&gt;
     // Notifications that a dream is starting.&lt;br /&gt;
     tell [[ImmName]] $N is dreaming.&lt;br /&gt;
   endif&lt;br /&gt;
 endif&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Handler bot progs&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;rand_prog 100&lt;br /&gt;
 // Deliver the dream lines if the PC is sleeping. Go away, if not.&lt;br /&gt;
 //&lt;br /&gt;
 if position($f) == 4&lt;br /&gt;
   $d&lt;br /&gt;
   mpnextdata&lt;br /&gt;
 else&lt;br /&gt;
   mppurge self&lt;br /&gt;
 endif&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;data_prog dream_time&lt;br /&gt;
 // You can add more // lines in the data_prog to slow the pace of the dream echoes.&lt;br /&gt;
 mpechoat $f Your normal dreams are disturbed by strange, vague images and sensations.&lt;br /&gt;
 // &lt;br /&gt;
 [[mpechoat $f You dream that you gaze up into the night sky, and it is black, devoid of stars.]] &lt;br /&gt;
 [[//]]&lt;br /&gt;
 [[mpechoat $f In the dream, three brilliant, blazing stars appear on the eastern horizon.]]&lt;br /&gt;
 [[//]]&lt;br /&gt;
 [[mpechoat $f You see that the three bright stars are flanked by two other lesser stars.]] &lt;br /&gt;
 [[//]]&lt;br /&gt;
 [[mpechoat $f On the western horizon, as if in response or challenge, three faint stars appear.]] &lt;br /&gt;
 //&lt;br /&gt;
 mpechoat $f The strange images fade away, and you return to normal slumber.&lt;br /&gt;
 mpat 1210 prog_enddream&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;verb_prog prog_enddream&lt;br /&gt;
 // Set a bit if you want the dream to be delivered one time only.&lt;br /&gt;
 mpbitset $f [[StopDreamBit]] 1&lt;br /&gt;
 //&lt;br /&gt;
 // Send a note if you want to be notified that the PC had the dream.&lt;br /&gt;
 note to [[RECIPIENT(S)]]&lt;br /&gt;
 note subject $F had the dream&lt;br /&gt;
 note send&lt;br /&gt;
 //&lt;br /&gt;
 mppurge self&lt;/div&gt;</summary>
		<author><name>Elanthe</name></author>
	</entry>
</feed>