Jump to content
Mumbles

Variant Mining

Recommended Posts

Utility: Variant Mining

As per xienne15's request: http://herc.ws/board/topic/1886-simple-mining/

 

Description:

A simple mining system; allows for interacting players to excavate minerals by "mining" them with special equipment and tools. Minerals disappear and respawn randomly; chance is determined by configuration.

 

Configuration is mostly done in arrays so that settings may be changed with no modifications to the script. Duplicate in additional locations as needed; update the value of '.var_amount' correspondingly.

 

Download:

https://github.com/datmumbles/Scripts/raw/master/util/mining.txt

Share this post


Link to post
Share on other sites
  On 8/6/2013 at 1:05 PM, quesoph said:

Thanks. I will try this out. :)

 

Sure thing; be sure to adjust the success rates to your liking - the original request asked for particularly low rates. The .success array takes values in comparison to fractions (ex. 3, 4 is the same as 3 / 4 or 75%). Thanks for trying it out!

Edited by Via

Share this post


Link to post
Share on other sites
  On 8/6/2013 at 5:19 PM, quesoph said:

Suggestion:

When mining, if you fail or succeed the mine would be gone and be relocated to a different area( x, y )..

 

Yes, second devotion. if this would be add in the feature it'll be interesting.

Thank you!!!

Share this post


Link to post
Share on other sites
// Move Npcfunction    script    npcmove    {        while(1) {            set .@x,rand(0,300); // 0 to 300 random x coordinate            set .@y,rand(0,300); // 0 to 300 random y coordinate            if( checkcell("pay_dun00", .@x, .@y, cell_chkpass)) break; // check if passable            }                movenpc "Variant Mineral#"+getarg(0), .@x, .@y;  //Move NPC                setnpcdisplay "Variant Mineral#"+getarg(0), 1907; // set the npc sprite            end;}// Duplicates-    script    Variant#1    -1,{    doevent "mining::OnMine"; goto OnMove; // call mining script's OnMine label then move the npc    OnInit:    OnMove:        callfunc ("npcmove",1); // call npc move to move the variant#1, number 1 is the #1 in the Variant#1.    end;}-    script    Variant#2    -1,{    doevent "mining::OnMine"; goto OnMove;    OnInit:    OnMove:        callfunc ("npcmove",2); // call npc move to move the variant#1, number 2 is the #2 in the Variant#2.    end;}// dupes againpay_dun00,1,1,0    duplicate(Variant#1)    Variant Mineral#1    1907pay_dun00,1,1,0    duplicate(Variant#2)    Variant Mineral#2    1907

 

@edit

But you need to add more if you want to have more minerals.

Edited by quesoph

Share this post


Link to post
Share on other sites
  On 10/2/2013 at 8:54 AM, quesoph said:

 

// Move Npcfunction    script    npcmove    {        while(1) {            set .@x,rand(0,300); // 0 to 300 random x coordinate            set .@y,rand(0,300); // 0 to 300 random y coordinate            if( checkcell("pay_dun00", .@x, .@y, cell_chkpass)) break; // check if passable            }                movenpc "Variant Mineral#"+getarg(0), .@x, .@y;  //Move NPC                setnpcdisplay "Variant Mineral#"+getarg(0), 1907; // set the npc sprite            end;}// Duplicates-    script    Variant#1    -1,{    doevent "mining::OnMine"; goto OnMove; // call mining script's OnMine label then move the npc    OnInit:    OnMove:        callfunc ("npcmove",1); // call npc move to move the variant#1, number 1 is the #1 in the Variant#1.    end;}-    script    Variant#2    -1,{    doevent "mining::OnMine"; goto OnMove;    OnInit:    OnMove:        callfunc ("npcmove",2); // call npc move to move the variant#1, number 2 is the #2 in the Variant#2.    end;}// dupes againpay_dun00,1,1,0    duplicate(Variant#1)    Variant Mineral#1    1907pay_dun00,1,1,0    duplicate(Variant#2)    Variant Mineral#2    1907

 

@edit

But you need to add more if you want to have more minerals.

 

 

 

Thanks for the quick respond, btw? where can i put that part of the script?

it would be great if you could provide a whole script with that current add-on part.

 

Thanks in Advance!

Share this post


Link to post
Share on other sites

 

  Reveal hidden contents

 

Edited by quesoph

Share this post


Link to post
Share on other sites
[Debug]: Source (NPC): Variant Mineral#10 at pay_dun00 (86,139)[Warning]: script:get_val: cannot access player variable 'Emveretarcon', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#10 at pay_dun00 (86,139)[Warning]: script:get_val: cannot access player variable 'Oridecon', defaultingto 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: number value=0[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#10 at pay_dun00 (86,139)[Warning]: script:get_val: cannot access player variable 'Elunium', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: variable name='Phracon'[Debug]: Data: number value=5[Debug]: Data: variable name='Emveretarcon'[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Phracon', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: variable name='Emveretarcon'[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Emveretarcon', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Oridecon', defaultingto 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: number value=0[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Elunium', defaulting to 0

I got errors from that scripts..?

Share this post


Link to post
Share on other sites
  On 10/28/2014 at 2:13 AM, dagiccross said:

 

[Debug]: Source (NPC): Variant Mineral#10 at pay_dun00 (86,139)[Warning]: script:get_val: cannot access player variable 'Emveretarcon', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#10 at pay_dun00 (86,139)[Warning]: script:get_val: cannot access player variable 'Oridecon', defaultingto 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: number value=0[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#10 at pay_dun00 (86,139)[Warning]: script:get_val: cannot access player variable 'Elunium', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: variable name='Phracon'[Debug]: Data: number value=5[Debug]: Data: variable name='Emveretarcon'[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Phracon', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: variable name='Emveretarcon'[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Emveretarcon', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Oridecon', defaultingto 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: number value=0[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Elunium', defaulting to 0

I got errors from that scripts..?

 

This will not work with *Athena emulators until they add compatibility for item constants (in place of IDs); this script is optimised for Hercules emulators only.1

 

 

1If you are using Hercules, please update your emulator.

Share this post


Link to post
Share on other sites
  On 10/28/2014 at 2:31 AM, Mumbles said:

 

  On 10/28/2014 at 2:13 AM, dagiccross said:

 

[Debug]: Source (NPC): Variant Mineral#10 at pay_dun00 (86,139)[Warning]: script:get_val: cannot access player variable 'Emveretarcon', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#10 at pay_dun00 (86,139)[Warning]: script:get_val: cannot access player variable 'Oridecon', defaultingto 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: number value=0[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#10 at pay_dun00 (86,139)[Warning]: script:get_val: cannot access player variable 'Elunium', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: variable name='Phracon'[Debug]: Data: number value=5[Debug]: Data: variable name='Emveretarcon'[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Phracon', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: variable name='Emveretarcon'[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Emveretarcon', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Oridecon', defaultingto 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: number value=0[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Elunium', defaulting to 0

I got errors from that scripts..?

 

This will not work with *Athena emulators until they add compatibility for item constants (in place of IDs); this script is optimised for Hercules emulators only.1

 

 

1If you are using Hercules, please update your emulator.

I already solved it, thanks :)

It's really nice scripts to share, btw is there a chance of adding a random spawn on a map after progressbar has been finish?

Edited by dagiccross

Share this post


Link to post
Share on other sites
  On 10/28/2014 at 5:42 AM, dagiccross said:

I already solved it, thanks :)

It's really nice scripts to share, btw is there a chance of adding a random spawn on a map after progressbar has been finish?

You can use the monster command after the line containing the progressbar command.

Share this post


Link to post
Share on other sites

Cool plugin. I loved it! This one is simpler that Myzter's mining game.

My only concern is that for example I put 10/10 on the success chance, should it be 100%? My problem is that its still not 100% chance of success even though I put those values. I also tried 100/100 but still same result.

Am I missing something?

Share this post


Link to post
Share on other sites

@@Mumbles is it possible to add arrays for Normal Drops and Rare Drops..

And also for the success rate, for Normal drop and Rare Drops can be set also.

 

Can you do it?

Thanks in advance!

Edited by Vlync

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.