Jump to content
  • 0

Killing Monster Recieved Item Per Rate


KucingHitam

Question


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  42
  • Reputation:   4
  • Joined:  01/23/12
  • Last Seen:  

Is it possible to make a script with the following conditions?

if kill this monster ID 1893

-Poring Coin Drop 80%

-Potion Drop 100%

-Custom Box 1 10%

-Custom Box 2 10%

-Custom Box 3 30%

 
Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

I don't see why not.
 

-	script	Drop Emulator	-1,{
OnNPCKillEvent:
	set .@mid, killedrid;
	set .@ar$, ".mob"+.@mid;
	set .@len, getarraysize(getd(.@ar$));
	if(.@len){
		for(set .@p,1; .@p<.@len;set .@p,.@p+2 ) {
			set .@itm, getd(.@ar$+"["+(.@p-1)+"]");
			set @itmtyp, getiteminfo(.@itm,2);
			set .@btflg, callfunc("Monster_DB",.@mid);
			set .@itmrt, getd(.@ar$+"["+.@p+"]");
			query_sql("SELECT ROUND("+.@itmrt+"*("+.@btflg+"/100));",.@rte);
			if(((.@rte<=10000)?((rand(1,10000/.@rte)==1)?1:0):1)) {
				getitem .@itm,1;
			}
		}
	}
	end;
	
OnInit: //By Skorm
	//Example Poring Apple, 10%, Apple, 1.5%....etc
	setarray .mob1893, 7539, 8000, 512, 150, 619, 20, 713, 1500, 909, 7000, 938, 400, 1202, 100, 4001, 1; // Mob List 10000=100% can support up to 128 values
}

function	script	Monster_DB	{
	switch(getarg(0)){
		case 1893:
			switch(@itmtyp){
				// Keep in mind these are precents overall so 20% is actually lower while 140% is actually 40% higher.
				// Where 200% is double... It's like saying 2*400=800.
				case 0: // Heal Item Rate (Healing Items)
					return 100; // 100% for  healing items.
				
				case 2: case 7: case 11: case 18: // Uasable Item Rate (Anything Usable that doesn't heal)
					return 100; // 100% for healing items.
					
				case 3: // Common Item Rate (ETC)
					return 100; //100% more for Common Items.
				
				case 4: case 5: case 8: case 10: // Equip Item Rate (Ammo, Pet Equip, Weapon, Armor)
					return 100; // 100% more for equip items.
				
				case 6: // Card Item Rate (Card)
					return 100; // 100% more for cards.
			}
		case 1003:
		case 1004:
		case 1005:
		//...to add new monsters simply do as I've done.
	}
}



I don't know the IDs of your potion drop or your custom box drops so you'll have to add them.
 

	//Example Poring Apple, 10%, Apple, 1.5%....etc
	setarray .mob1893, 7539, 8000, 512, 150, 619, 20, 713, 1500, 909, 7000, 938, 400, 1202, 100, 4001, 1; // Mob List 10000=100% can support up to 128 values
Edited by Skorm
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  90
  • Topics Per Day:  0.02
  • Content Count:  361
  • Reputation:   18
  • Joined:  01/09/13
  • Last Seen:  

I don't see why not.

 

-	script	Drop Emulator	-1,{
OnNPCKillEvent:
	set .@mid, killedrid;
	set .@ar$, ".mob"+.@mid;
	set .@len, getarraysize(getd(.@ar$));
	if(.@len){
		for(set .@p,1; .@p<.@len;set .@p,.@p+2 ) {
			set .@itm, getd(.@ar$+"["+(.@p-1)+"]");
			set @itmtyp, getiteminfo(.@itm,2);
			set .@btflg, callfunc("Monster_DB",.@mid);
			set .@itmrt, getd(.@ar$+"["+.@p+"]");
			query_sql("SELECT ROUND("+.@itmrt+"*("+.@btflg+"/100));",.@rte);
			if(((.@rte<=10000)?((rand(1,10000/.@rte)==1)?1:0):1)) {
				getitem .@itm,1;
			}
		}
	}
	end;
	
OnInit: //By Skorm
	//Example Poring Apple, 10%, Apple, 1.5%....etc
	setarray .mob1893, 7539, 8000, 512, 150, 619, 20, 713, 1500, 909, 7000, 938, 400, 1202, 100, 4001, 1; // Mob List 10000=100% can support up to 128 values
}

function	script	Monster_DB	{
	switch(getarg(0)){
		case 1893:
			switch(@itmtyp){
				// Keep in mind these are precents overall so 20% is actually lower while 140% is actually 40% higher.
				// Where 200% is double... It's like saying 2*400=800.
				case 0: // Heal Item Rate (Healing Items)
					return 100; // 100% for  healing items.
				
				case 2: case 7: case 11: case 18: // Uasable Item Rate (Anything Usable that doesn't heal)
					return 100; // 100% for healing items.
					
				case 3: // Common Item Rate (ETC)
					return 100; //100% more for Common Items.
				
				case 4: case 5: case 8: case 10: // Equip Item Rate (Ammo, Pet Equip, Weapon, Armor)
					return 100; // 100% more for equip items.
				
				case 6: // Card Item Rate (Card)
					return 100; // 100% more for cards.
			}
		case 1003:
		case 1004:
		case 1005:
		//...to add new monsters simply do as I've done.
	}
}

I don't know the IDs of your potion drop or your custom box drops so you'll have to add them.

 

	//Example Poring Apple, 10%, Apple, 1.5%....etc
	setarray .mob1893, 7539, 8000, 512, 150, 619, 20, 713, 1500, 909, 7000, 938, 400, 1202, 100, 4001, 1; // Mob List 10000=100% can support up to 128 values

Well Done Skorm. a True Professional.... I admire your talent /OTL 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  42
  • Reputation:   4
  • Joined:  01/23/12
  • Last Seen:  

thanks a lot sir its work

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:  


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  276
  • Reputation:   24
  • Joined:  07/06/13
  • Last Seen:  

How can i make it work?

--------------------------

npc invinsible on map.

case level not integer:

--------------------------

case mob3000:

Edited by Lil Troll
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


case 3000:

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