Jump to content
  • 0

Random item drop on specific map


InfectedX

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  65
  • Reputation:   1
  • Joined:  01/12/12
  • Last Seen:  

Hi guys, 

im trying make a specific drop on lhz_dun_n but for some reason it doens work 

	Example1
//	OnNPCKillEvent:
//		setarray .@mob_idd, 3227, 3231, 3232, 3209, 3210, 3212, 3226, 3228, 3229, 3230, 3208, 3211, 3213;
//
//		if (rand(100) < 1) { // 1% de probabilidad
//			// Realiza un segundo control para verificar si el NPC muerto es uno de los monstruos específicos
//			if (isinarray(killedrid, .@mob_idd)) {
//				.@itemm_id = F_Rand(25786, 25787);
//				getitem .@itemm_id, 1;
//			}
//		}
//	end;
//}
                          
         Example 2                 
	//OnNPCKillEvent:
	//	if (rand(100) < 100) { // 1% de probabilidad
	//		// Realiza un segundo control de mapa
	//		if (strnpcinfo(3) == "lhz_dun_n") {
	//			.@itemm_id = F_Rand(25786,25787);
	//			getitem .@itemm_id, 1;
	//		}
	//	}
	// end;
        // }

i have been trying with this 2 codes but i doesnt work 

i also try the mapdrops but i dont know how to insert de info correct

- Map: lhz_dun_n
	Globaldrops:
	-Index:0
	 Item:Bio_Reseearch_Docu
	 Rate:2
	-Index:1
	 Item:Bio_Test_Fragment
	 Rate:2

i also do a 3rd one more in a more simple way, dont send an error but didnt drop anything
 


OnNPCKillEvent:

if ( strcharinfo( 3 ) == "lhz_dun_n"&& rand( 100 ) < 5 ) end;

getitem 25786, 1;
getitem 25787, 1;

 

 

Thx in advance for the help 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

For your script: The OnNPCKillEvent only gets executed when the killed mob doesn't have an attached label. 
For your YAML: You can't use tabs for indentation in YAML files, you also forgot to place a space between - and Index and between each parameter and its value.

Here is an example of the YAML:

Header:
  Type: MAP_DROP_DB
  Version: 2

Body:
      - Map: lhz_dun_n
        Globaldrops:
        - Index: 0
          Item: Bio_Reseearch_Docu
          Rate: 2
        - Index: 1
          Item: Bio_Test_Fragment
          Rate: 2

 

Edited by Winterfox
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

for map_drop.yml i guess you missing space  betwen :

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  65
  • Reputation:   1
  • Joined:  01/12/12
  • Last Seen:  

13 hours ago, Winterfox said:

For your script: The OnNPCKillEvent only gets executed when the killed mob doesn't have an attached label. 
For your YAML: You can't use tabs for indentation in YAML files, you also forgot to place a space between - and Index and between each parameter and its value.

Here is an example of the YAML:

Header:
  Type: MAP_DROP_DB
  Version: 2

Body:
      - Map: lhz_dun_n
        Globaldrops:
        - Index: 0
          Item: Bio_Reseearch_Docu
          Rate: 2
        - Index: 1
          Item: Bio_Test_Fragment
          Rate: 2

 

The map_drop configuration work for mobs with different names? or does it only apply to mobs without specific tags?

for example the name of the mobs on tomb of fallen and bio lab 3 and 4

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

4 hours ago, InfectedX said:

The map_drop configuration work for mobs with different names? or does it only apply to mobs without specific tags?

for example the name of the mobs on tomb of fallen and bio lab 3 and 4

 

I never used map_drop myself, but I assume that it works for all mobs that are on the specified map regardless of if they have a label or something.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  65
  • Reputation:   1
  • Joined:  01/12/12
  • Last Seen:  

Map_drop.yml is not working in any case, is like it doesn't exist, with normal or any other mob... Such a weird thing... Why would Rathena had a yml file that is useless? It doesn't matter if it has labelled mobs or not 

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