Jump to content
  • 0

(Support) Little Help


Elysium

Question


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  164
  • Reputation:   16
  • Joined:  03/15/12
  • Last Seen:  

Hi, i was wondering if this could be possible to add i don't know exactly, is it possible to add an arrays for Normal Drops and Rare Drops.

.@NormalDrops, item1,item2,item3; .@NormalDropsquantity, item 1, item2, item 3, and.@RareDrops, item1,item2,item3; .@RareDropsquantity, item1,item2,item3 etc etc.................

 

And you can set in the settings  e.g Normal Drops 80% for Rare Drops 5-10% and also it would be nice it this could be add success rate of Normal Drops and Rare Drops.

Credits: Mumble

-	script	Variant Mineral#0::mining	S_EMPEL_1,{
	
	/*-----------------------------------------------------
	Script
	-----------------------------------------------------*/
	// Check equipment
	for (.@i = 0; .@i < getarraysize(.equip); .@i++) {
		if (!isequipped(.equip[.@i])) {
			message strcharinfo(0), "You need to have '"+ getitemname(.equip[.@i]) +"' equipped to mine!";
			.@unequipped++;
		}
	}
	
	// Show count of equipment not worn
	if (.@unequipped) {
		message strcharinfo(0), .@unequipped +" of "+ getarraysize(.equip) +" equipment has not been worn.";
		end;
	}
	
	// Check tools
	for (.@i = 0; .@i < getarraysize(.tool); .@i += 2) {
		if (countitem(.tool[.@i]) < .tool[.@i + 1]) {
			message strcharinfo(0), "You need to bring "+ .tool[.@i + 1] +" "+ getitemname(.tool[.@i]) +" to mine!";
			.@gearless++;
		}
	}
	
	// Show count of tools not in inventory
	if (.@gearless) {
		.@grammar$ = (getarraysize(.tool) > 1 ? "tools were" : "tool was");
		message strcharinfo(0), .@gearless +" of "+ getarraysize(.tool) +" "+ .@grammar$ +" not brought.";
		end;
	}
	
	// Progress
	message strcharinfo(0), "Mining in progress...";
	progressbar "green", .progress;
	
	// Delete tools
	for (.@i = 0; .@i < getarraysize(.tool); .@i += 2) {
		delitem .tool[.@i], .tool[.@i + 1];
	}
	
	// Audio/visual effects
	soundeffect .sound$, 0;
	specialeffect .effect;
	
	// Drop random debris
	getmapxy(.@m$, .@x, .@y, 0);
	.@scatter = rand(1, .limit);
	for (.@i = 0; .@i < .@scatter; .@i++) {
		.@random = rand(2) * (!rand(1) ? -1 : 1);
		makeitem .debris, 1, .@m$, .@x + .@random, .@y + .@random;
	}
	
	// Randomize target mineral to mine
	do {
		.@target = rand(getarraysize(.mineral));
	} while (.@target % 2);
	
	// Max range of success
	.@range = .success[.@target + 1];
	
	// Check if failed
	if (rand(1, .@range) != .success[.@target]) {
		message strcharinfo(0), "Nothing valuable was excavated...";
	} else {
		// Get mineral(s)
		getitem .mineral[.@target], .mineral[.@target + 1];
		message strcharinfo(0), "You have successfully mined "+ .mineral[.@target + 1] +" "+ getitemname(.mineral[.@target]) +"!";
	}
	
	// Hide mineral
	if (!rand(.hide_chance)) {
		hideonnpc strnpcinfo(3);
	}
	
	end;
	
	
	/*-----------------------------------------------------
	Timer
	-----------------------------------------------------*/	
	OnMinute00:
		// Respawn minerals
		if (gettime(3) % .respawn_rate) {
			for (.@i = 1; .@i <= .var_amount; .@i++) {
				if (!rand(.respawn_chance)) {
					hideoffnpc strnpcinfo(1) +"#"+ .@i;
				}
			}
		}
		
		end;
	
	
	/*-----------------------------------------------------
	Configuration
	-----------------------------------------------------*/
	OnInit:
		// Minerals (constant/ID, amount)
		setarray .mineral[0], Phracon, 5, Emveretarcon, 3, Oridecon, 1, Elunium, 1;
		
		// Success rate: (x / y)% chance
		setarray .success[0],	4, 10,	// 4/10 (40%)
								3, 10,	// 3/10 (30%)
								1, 25,	// 1/25 (4%)
								1, 50;	// 1/50 (2%)
		
		// Equipment (constant/ID)
		setarray .equip[0], Safety_Helmet, Flu_Mask;
		
		// Tools (constant/ID, amount)
		setarray .tool[0], Old_Pick, 1, Headlamp, 1;
		
		// Mining time (in seconds)
		.progress = 5;
		
		// Audio/visual effects
		.sound$ = "chepet_attack.wav";
		.effect = EF_HIT5;
		
		// Debris
		.debris = Stone;	// Stone
		.limit = 5;			// Scatter limit
		
		// Hiding and Respawning
		.var_amount = 44;		// Amount of Variant Minerals
		.hide_chance = 4;		// Chance in x to hide (default: 4 [25%])
		.respawn_chance = 2;	// Chance in x to respawn (default: 2 [50%])
		.respawn_rate = 1;		// Every x hours (max: 12)
	
	end;
	
}


/*-----------------------------------------------------
Duplicates
-----------------------------------------------------*/
pay_dun00,54,147,0	duplicate(mining)	Variant Mineral#1	S_EMPEL_1
pay_dun00,55,147,0	duplicate(mining)	Variant Mineral#2	S_EMPEL_1
pay_dun00,53,146,0	duplicate(mining)	Variant Mineral#3	S_EMPEL_2
pay_dun00,53,145,0	duplicate(mining)	Variant Mineral#4	S_EMPEL_1

pay_dun00,69,148,0	duplicate(mining)	Variant Mineral#5	S_EMPEL_2
pay_dun00,70,147,0	duplicate(mining)	Variant Mineral#6	S_EMPEL_1
pay_dun00,70,146,0	duplicate(mining)	Variant Mineral#7	S_EMPEL_1

pay_dun00,84,140,0	duplicate(mining)	Variant Mineral#8	S_EMPEL_1
pay_dun00,85,140,0	duplicate(mining)	Variant Mineral#9	S_EMPEL_2
pay_dun00,86,139,0	duplicate(mining)	Variant Mineral#10	S_EMPEL_1

pay_dun00,83,126,0	duplicate(mining)	Variant Mineral#11	S_EMPEL_1

pay_dun00,60,125,0	duplicate(mining)	Variant Mineral#12	S_EMPEL_2

pay_dun00,46,124,0	duplicate(mining)	Variant Mineral#13	S_EMPEL_1
pay_dun00,45,123,0	duplicate(mining)	Variant Mineral#14	S_EMPEL_2

pay_dun00,53,117,0	duplicate(mining)	Variant Mineral#15	S_EMPEL_1
pay_dun00,53,118,0	duplicate(mining)	Variant Mineral#16	S_EMPEL_2

pay_dun00,44,109,0	duplicate(mining)	Variant Mineral#17	S_EMPEL_2

pay_dun00,50,69,0	duplicate(mining)	Variant Mineral#18	S_EMPEL_1
pay_dun00,51,70,0	duplicate(mining)	Variant Mineral#19	S_EMPEL_2

pay_dun00,35,54,0	duplicate(mining)	Variant Mineral#20	S_EMPEL_1

pay_dun00,75,84,0	duplicate(mining)	Variant Mineral#21	S_EMPEL_1
pay_dun00,75,85,0	duplicate(mining)	Variant Mineral#22	S_EMPEL_1
pay_dun00,76,86,0	duplicate(mining)	Variant Mineral#23	S_EMPEL_2

pay_dun00,123,100,0	duplicate(mining)	Variant Mineral#24	S_EMPEL_2
pay_dun00,123,101,0	duplicate(mining)	Variant Mineral#25	S_EMPEL_2
pay_dun00,124,102,0	duplicate(mining)	Variant Mineral#26	S_EMPEL_2

pay_dun00,131,157,0	duplicate(mining)	Variant Mineral#27	S_EMPEL_1
pay_dun00,132,158,0	duplicate(mining)	Variant Mineral#28	S_EMPEL_2

pay_dun00,139,164,0	duplicate(mining)	Variant Mineral#29	S_EMPEL_2
pay_dun00,139,165,0	duplicate(mining)	Variant Mineral#30	S_EMPEL_1
pay_dun00,140,166,0	duplicate(mining)	Variant Mineral#31	S_EMPEL_1
pay_dun00,141,166,0	duplicate(mining)	Variant Mineral#32	S_EMPEL_2

pay_dun00,147,171,0	duplicate(mining)	Variant Mineral#33	S_EMPEL_1
pay_dun00,147,172,0	duplicate(mining)	Variant Mineral#34	S_EMPEL_2
pay_dun00,147,173,0	duplicate(mining)	Variant Mineral#35	S_EMPEL_1
pay_dun00,148,174,0	duplicate(mining)	Variant Mineral#36	S_EMPEL_2
pay_dun00,149,174,0	duplicate(mining)	Variant Mineral#37	S_EMPEL_1

pay_dun00,154,174,0	duplicate(mining)	Variant Mineral#38	S_EMPEL_1
pay_dun00,155,174,0	duplicate(mining)	Variant Mineral#39	S_EMPEL_2
pay_dun00,156,173,0	duplicate(mining)	Variant Mineral#40	S_EMPEL_1
pay_dun00,156,172,0	duplicate(mining)	Variant Mineral#41	S_EMPEL_2
pay_dun00,156,171,0	duplicate(mining)	Variant Mineral#42	S_EMPEL_2
pay_dun00,156,170,0	duplicate(mining)	Variant Mineral#43	S_EMPEL_1
pay_dun00,156,169,0	duplicate(mining)	Variant Mineral#44	S_EMPEL_2
Edited by Elysium
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  164
  • Reputation:   16
  • Joined:  03/15/12
  • Last Seen:  

Ugh! i guess no one help me in :(

Kindly closed this.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  164
  • Reputation:   16
  • Joined:  03/15/12
  • Last Seen:  

/sob /sob /sob

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

something similar..

	// Check if failed
	if (rand(1, .@range) != .success[.@target]) {
		message strcharinfo(0), "Nothing valuable was excavated...";
	} else {
		
		.@random = rand( 100 );
		if ( .@random < 20 ) .@type = 1;
		else .@type = 2;
		
		.@size = getarraysize( getd( ".mineral_"+.@type ) );
		copyarray .@temp_array,getd( ".mineral_"+.@type ),.@size;
		
		// Randomize target mineral to mine
		do {
			.@target = rand( .@size );
		} while ( .@target % 2 );
		
		// Get mineral(s)
		getitem .@temp_array[.@target], .@temp_array[.@target + 1];
		message strcharinfo(0), "You have successfully mined "+ .@temp_array[.@target + 1] +" "+ getitemname(.@temp_array[.@target]) +"!";
	}
	
	.........
	.........
	.........

	OnInit:
	// Minerals (constant/ID, amount)
	setarray .mineral_1[0], Phracon, 5, Emveretarcon, 3, Oridecon, 1, Elunium, 1;
	setarray .mineral_2[0], Phracon, 5, Emveretarcon, 3, Oridecon, 1, Elunium, 1;
Link to comment
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
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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...