http://wiki.uot2a.com/index.php?title=Script:_Mining&feed=atom&action=history
Script: Mining - Revision history
2024-03-29T13:54:48Z
Revision history for this page on the wiki
MediaWiki 1.29.1
http://wiki.uot2a.com/index.php?title=Script:_Mining&diff=629&oldid=prev
Grimoric: Created page with " <span style="color:#0000FF">inherits</span> itemmanip; forward <span style="color:#0000FF">void</span> <span style="color:#2B91AF">Q4S7</span>(<span style="col..."
2018-10-05T18:36:02Z
<p>Created page with " <span style="color:#0000FF">inherits</span> <a href="/index.php?title=Itemmanip&action=edit&redlink=1" class="new" title="Itemmanip (page does not exist)">itemmanip</a>; forward <span style="color:#0000FF">void</span> <a href="/index.php?title=Q4S7&action=edit&redlink=1" class="new" title="Q4S7 (page does not exist)"><span style="color:#2B91AF">Q4S7</span></a>(<span style="col..."</p>
<p><b>New page</b></p><div> <span style="color:#0000FF">inherits</span> [[Script:_Itemmanip|itemmanip]];<br />
<br />
forward <span style="color:#0000FF">void</span> [[Script_Function:_Q4S7|<span style="color:#2B91AF">Q4S7</span>]](<span style="color:#0000FF">obj</span> , <span style="color:#0000FF">loc</span> );<br />
<br />
<span style="color:#0000FF">trigger</span> use<br />
{<br />
[[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"Where do you wish to dig?"</span>);<br />
[[Engine Function:_targetLoc|<span style="color:#FF0000;font-weight:bold">targetLoc</span>]](user, this);<br />
<span style="color:#0000FF">return</span> (0x00);<br />
}<br />
<br />
<span style="color:#0000FF">trigger</span> targetloc<br />
{<br />
<span style="color:#0000FF">if</span> (![[Engine Function:_isInMap|<span style="color:#FF0000;font-weight:bold">isInMap</span>]](place))<br />
{<br />
<span style="color:#0000FF">return</span> (0x00);<br />
}<br />
<span style="color:#0000FF">if</span> ([[Engine Function:_getDistanceInTiles|<span style="color:#FF0000;font-weight:bold">getDistanceInTiles</span>]]([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](user), place) > 0x04)<br />
{<br />
[[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"That is too far away."</span>);<br />
<span style="color:#0000FF">return</span> (0x00);<br />
}<br />
<span style="color:#0000FF">if</span> (objtype == 0x00)<br />
{<br />
<span style="color:#0000FF">int</span> Q62L = [[Engine Function:_getTileAt|<span style="color:#FF0000;font-weight:bold">getTileAt</span>]](place);<br />
<span style="color:#0000FF">if</span> ([[Script_Function:_Q4ZJ|<span style="color:#2B91AF">Q4ZJ</span>]](Q62L))<br />
{<br />
[[Script_Function:_Q4S7|<span style="color:#2B91AF">Q4S7</span>]](user, place);<br />
}<br />
<span style="color:#0000FF">else</span><br />
{<br />
[[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"You can't mine there."</span>);<br />
}<br />
}<br />
<span style="color:#0000FF">else</span><br />
{<br />
<span style="color:#0000FF">if</span> ([[Script_Function:_Q4ZI|<span style="color:#2B91AF">Q4ZI</span>]](objtype))<br />
{<br />
[[Script_Function:_Q4S7|<span style="color:#2B91AF">Q4S7</span>]](user, place);<br />
}<br />
<span style="color:#0000FF">else</span><br />
{<br />
[[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"You can't mine that."</span>);<br />
}<br />
}<br />
<span style="color:#0000FF">return</span> (0x00);<br />
}<br />
<br />
<span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q579(<span style="color:#0000FF">obj</span> user)<br />
{<br />
<span style="color:#0000FF">if</span> ([[Engine Function:_getItemAtSlot|<span style="color:#FF0000;font-weight:bold">getItemAtSlot</span>]](user, 0x19) != [[Engine Function:_NULL|<span style="color:#FF0000;font-weight:bold">NULL</span>]]())<br />
{<br />
[[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"You can't mine while riding."</span>);<br />
<span style="color:#0000FF">return</span> ();<br />
}<br />
<span style="color:#0000FF">if</span> ([[Engine Function:_getObjType|<span style="color:#FF0000;font-weight:bold">getObjType</span>]](user) < 0x0190)<br />
{<br />
[[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"You can't mine while polymorphed."</span>);<br />
<span style="color:#0000FF">return</span> ();<br />
}<br />
[[Engine Function:_animateMobile|<span style="color:#FF0000;font-weight:bold">animateMobile</span>]](user, 0x0B, 0x14, 0x01, 0x00, 0x00);<br />
shortCallback(this, 0x04, 0x73);<br />
<span style="color:#0000FF">return</span> ();<br />
}<br />
<br />
<span style="color:#0000FF">function</span> <span style="color:#0000FF">void</span> Q4S7(<span style="color:#0000FF">obj</span> user, <span style="color:#0000FF">loc</span> place)<br />
{<br />
<span style="color:#0000FF">obj</span> Q4D6 = [[Engine Function:_getChunkEgg|<span style="color:#FF0000;font-weight:bold">getChunkEgg</span>]](place);<br />
<span style="color:#0000FF">int</span> Q56Z = 0x00;<br />
<span style="color:#0000FF">int</span> Q4Q1 = [[Engine Function:_getResource|<span style="color:#FF0000;font-weight:bold">getResource</span>]](Q56Z, Q4D6, <span style="color:#800000">"metal"</span>, 0x03, 0x02);<br />
<span style="color:#0000FF">if</span> (Q56Z <= 0x00)<br />
{<br />
[[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"There is no metal here to mine."</span>);<br />
<span style="color:#0000FF">return</span> ();<br />
}<br />
[[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, <span style="color:#800000">"user"</span>, user);<br />
[[Engine Function:_setObjVar|<span style="color:#FF0000;font-weight:bold">setObjVar</span>]](this, <span style="color:#800000">"mineLoc"</span>, place);<br />
[[Engine Function:_removeCallback|<span style="color:#FF0000;font-weight:bold">removeCallback</span>]](this, 0x72);<br />
[[Engine Function:_removeCallback|<span style="color:#FF0000;font-weight:bold">removeCallback</span>]](this, 0x73);<br />
[[Script_Function:_Q579|<span style="color:#2B91AF">Q579</span>]](user);<br />
<span style="color:#0000FF">return</span> ();<br />
}<br />
<br />
<span style="color:#0000FF">trigger</span> callback(0x73)<br />
{<br />
<span style="color:#0000FF">obj</span> user = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"user"</span>);<br />
sfx([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](user), 0x0125, 0x00);<br />
<span style="color:#0000FF">if</span> ([[Engine Function:_getDistanceInTiles|<span style="color:#FF0000;font-weight:bold">getDistanceInTiles</span>]]([[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](user), [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"mineLoc"</span>)) > 0x04)<br />
{<br />
[[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"You have moved too far away to continue mining."</span>);<br />
}<br />
<span style="color:#0000FF">else</span><br />
{<br />
shortCallback(this, 0x04, 0x72);<br />
}<br />
<span style="color:#0000FF">return</span> (0x00);<br />
}<br />
<br />
<span style="color:#0000FF">trigger</span> callback(0x72)<br />
{<br />
<span style="color:#0000FF">obj</span> user = [[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"user"</span>);<br />
<span style="color:#0000FF">obj</span> Q4D6 = [[Engine Function:_getChunkEgg|<span style="color:#FF0000;font-weight:bold">getChunkEgg</span>]]([[Engine Function:_getObjVar|<span style="color:#FF0000;font-weight:bold">getObjVar</span>]](this, <span style="color:#800000">"mineLoc"</span>));<br />
<span style="color:#0000FF">int</span> Q56Z = 0x00;<br />
<span style="color:#0000FF">int</span> Q4Q1 = [[Engine Function:_getResource|<span style="color:#FF0000;font-weight:bold">getResource</span>]](Q56Z, Q4D6, <span style="color:#800000">"metal"</span>, 0x03, 0x02);<br />
[[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"user"</span>);<br />
[[Engine Function:_removeObjVar|<span style="color:#FF0000;font-weight:bold">removeObjVar</span>]](this, <span style="color:#800000">"mineLoc"</span>);<br />
<span style="color:#0000FF">if</span> (Q56Z <= 0x00)<br />
{<br />
[[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"Someone has gotten to the metal before you."</span>);<br />
<span style="color:#0000FF">return</span> (0x00);<br />
}<br />
<span style="color:#0000FF">if</span> (![[Engine Function:_testSkill|<span style="color:#FF0000;font-weight:bold">testSkill</span>]](user, 0x2D))<br />
{<br />
[[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"You loosen some rocks but fail to find any useable ore."</span>);<br />
<span style="color:#0000FF">return</span> (0x00);<br />
}<br />
<span style="color:#0000FF">int</span> Q65M;<br />
<span style="color:#0000FF">switch</span> (Q56Z / 0x02)<br />
{<br />
<span style="color:#0000FF">case</span> 0x00<br />
Q65M = 0x19B7;<br />
<span style="color:#0000FF">break</span>;<br />
<span style="color:#0000FF">case</span> 0x01<br />
Q65M = 0x19B8 + (0x02 * [[Engine Function:_random|<span style="color:#FF0000;font-weight:bold">random</span>]](0x00, 0x01));<br />
Q56Z = 0x02;<br />
<span style="color:#0000FF">break</span>;<br />
<span style="color:#0000FF">default</span><br />
Q65M = 0x19B9;<br />
Q56Z = 0x04;<br />
<span style="color:#0000FF">break</span>;<br />
}<br />
<span style="color:#0000FF">obj</span> ore = [[Engine Function:_createNoResObjectAt|<span style="color:#FF0000;font-weight:bold">createNoResObjectAt</span>]](Q65M, [[Engine Function:_getLocation|<span style="color:#FF0000;font-weight:bold">getLocation</span>]](user));<br />
[[Engine Function:_transferResources|<span style="color:#FF0000;font-weight:bold">transferResources</span>]](ore, Q4D6, Q56Z, <span style="color:#800000">"metal"</span>);<br />
<span style="color:#0000FF">obj</span> Q47G = [[Engine Function:_getBackpack|<span style="color:#FF0000;font-weight:bold">getBackpack</span>]](user);<br />
<span style="color:#0000FF">if</span> ([[Engine Function:_canHold|<span style="color:#FF0000;font-weight:bold">canHold</span>]](Q47G, ore))<br />
{<br />
[[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"You dig some ore and put it in your backpack."</span>);<br />
Q4Q1 = [[Engine Function:_putObjContainer|<span style="color:#FF0000;font-weight:bold">putObjContainer</span>]](ore, Q47G);<br />
}<br />
<span style="color:#0000FF">else</span><br />
{<br />
[[Engine Function:_systemMessage|<span style="color:#FF0000;font-weight:bold">systemMessage</span>]](user, <span style="color:#800000">"You dig some ore and put it at your feet."</span>);<br />
}<br />
<span style="color:#0000FF">if</span> ([[Script_Function:_Q46J|<span style="color:#2B91AF">Q46J</span>]](user, this))<br />
{<br />
[[Engine Function:_deleteObject|<span style="color:#FF0000;font-weight:bold">deleteObject</span>]](this);<br />
}<br />
<span style="color:#0000FF">return</span> (0x00);<br />
}</div>
Grimoric