Jump to content
  • 0

drop mvp custom


Notorius

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

how do i make this work? I want to add a drop to mvp custom that gives it a rateof 1%

 

 

-	script	satan	-1,{
OnNPCKillEvent:
if ( !getmonsterinfo( killedgid, MOROCK ) ) end;
if ( getcharid(1) ) {
	getpartymember getcharid(1), 1;
	getpartymember getcharid(1), 2;
	for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/
			.@partymemberaid[.@c] = $@partymemberaid[.@i];
			.@c++;
		}
	}
	getitem 45018, 1, .@partymemberaid[ rand( .@c ) ];
	announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedgid, MOROCK ) +" at "+ strcharinfo(3), 0;
}
else {
	getitem 45018, 1;
	announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedgid, MOROCK ) +" at "+ strcharinfo(3), 0;
}
end;
}

 

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  132
  • Reputation:   53
  • Joined:  06/02/12
  • Last Seen:  

18 minutes ago, Notorius said:

-    script    satan    -1,{
OnNPCKillEvent:
if ( getmonsterinfo( killedrid, MOB_ID) != 31001 ) end;
if ( getcharid(1) ) {
    getpartymember getcharid(1), 1;
    getpartymember getcharid(1), 2;
    for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
        if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/
            .@partymemberaid[.@c] = $@partymemberaid[.@i];
            .@c++;
        }
    }
    getitem 45018, 1, .@partymemberaid[ rand( .@c ) ];
    announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
else {
    getitem 45018, 1;
    announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
end;
}

Hi, the script is working fine here.

Try changing that line to:

if ( killedrid != 31001 ) end;

 

-	script	satan	-1,{
OnNPCKillEvent:
if ( killedrid != 1002 ) end;
if ( getcharid(1) ) {
	getpartymember getcharid(1), 1;
	getpartymember getcharid(1), 2;
	for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/
			.@partymemberaid[.@c] = $@partymemberaid[.@i];
			.@c++;
		}
	}
	getitem 45018, 1, .@partymemberaid[ rand( .@c ) ];
	announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
else {
	getitem 45018, 1;
	announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
end;
} 

 

Edited by Racaae
missing info
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

i made it almost work now the problem is that the slaves that invoke the mvp also give the reward what can i do to fix it?

 

-	script	satan	-1,{
OnNPCKillEvent:
if ( !getmonsterinfo( killedgid, 31001 ) ) end;
if ( getcharid(1) ) {
	getpartymember getcharid(1), 1;
	getpartymember getcharid(1), 2;
	for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/
			.@partymemberaid[.@c] = $@partymemberaid[.@i];
			.@c++;
		}
	}
	getitem 45018, 1, .@partymemberaid[ rand( .@c ) ];
	announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
else {
	getitem 45018, 1;
	announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  132
  • Reputation:   53
  • Joined:  06/02/12
  • Last Seen:  

Hi, You need to fix your getmonsterinfo.

If you want this to trigger only for a specific mvp, you have two options:

if ( getmonsterinfo( killedrid, MOB_NAME ) != "Wounded Morocc" ) end;

or

if ( getmonsterinfo( killedrid, MOB_ID) != 31001 ) end;

 

If you want this to trigger for ANY mvp:

if ( !getmonsterinfo( killedrid, MOB_MVPEXP ) ) end;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

7 hours ago, Racaae said:

Hi, You need to fix your getmonsterinfo.

If you want this to trigger only for a specific mvp, you have two options:

if ( getmonsterinfo( killedrid, MOB_NAME ) != "Wounded Morocc" ) end;

or

if ( getmonsterinfo( killedrid, MOB_ID) != 31001 ) end;

 

If you want this to trigger for ANY mvp:

if ( !getmonsterinfo( killedrid, MOB_MVPEXP ) ) end;

 

https://prnt.sc/yRgj90bqgX1F

 

now i get this error ?

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  132
  • Reputation:   53
  • Joined:  06/02/12
  • Last Seen:  

On 3/29/2023 at 3:57 AM, Notorius said:

https://prnt.sc/yRgj90bqgX1F

 

now i get this error ?

 

Share your script here please

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

On 3/31/2023 at 9:09 AM, Racaae said:

Share your script here please

-    script    satan    -1,{
OnNPCKillEvent:
if ( getmonsterinfo( killedrid, MOB_ID) != 31001 ) end;
if ( getcharid(1) ) {
    getpartymember getcharid(1), 1;
    getpartymember getcharid(1), 2;
    for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
        if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/
            .@partymemberaid[.@c] = $@partymemberaid[.@i];
            .@c++;
        }
    }
    getitem 45018, 1, .@partymemberaid[ rand( .@c ) ];
    announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
else {
    getitem 45018, 1;
    announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
end;
}

 

On 3/31/2023 at 9:43 AM, Racaae said:

Hi, the script is working fine here.

Try changing that line to:

if ( killedrid != 31001 ) end;

 

-	script	satan	-1,{
OnNPCKillEvent:
if ( killedrid != 1002 ) end;
if ( getcharid(1) ) {
	getpartymember getcharid(1), 1;
	getpartymember getcharid(1), 2;
	for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/
			.@partymemberaid[.@c] = $@partymemberaid[.@i];
			.@c++;
		}
	}
	getitem 45018, 1, .@partymemberaid[ rand( .@c ) ];
	announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
else {
	getitem 45018, 1;
	announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
end;
} 

 

It is working thanks now how do I make the item give it with a rate of 10% or 15%

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  132
  • Reputation:   53
  • Joined:  06/02/12
  • Last Seen:  

16 minutes ago, Notorius said:

It is working thanks now how do I make the item give it with a rate of 10% or 15%

Use rand command before giving the item. Example:

-	script	satan	-1,{
OnNPCKillEvent:
if ( killedrid != 31001 ) end;
if ( getcharid(1) ) {
	getpartymember getcharid(1), 1;
	getpartymember getcharid(1), 2;
	for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/
			.@partymemberaid[.@c] = $@partymemberaid[.@i];
			.@c++;
		}
	}
	//Party has 10% chance to get the item 45018
	if (rand(100) < 10)
		getitem 45018, 1, .@partymemberaid[ rand( .@c ) ];
	announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
else {
	//Players without party has 15% chance to get the item 45018
	if (rand(100) < 15)
		getitem 45018, 1;
	announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
end;
} 

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

2 hours ago, Racaae said:

Use el comando rand antes de dar el artículo. Ejemplo:



   
     
	          
		       
			  
			
		
	
	
	           

 
	
	       

 

 

 

What should I do so that the item leaves it on the ground and does not fall into the inventory?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  132
  • Reputation:   53
  • Joined:  06/02/12
  • Last Seen:  

18 minutes ago, Notorius said:

 

What should I do so that the item leaves it on the ground and does not fall into the inventory?

Use makeitem instead of getitem.

Example:

if (rand(100) < 10) {
	getunitdata killedgid, .@data;
	makeitem 45018,1, mapid2name(.@data[UMOB_MAPID]),.@data[UMOB_X],.@data[UMOB_Y], true;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  1191
  • Reputation:   161
  • Joined:  06/12/12
  • Last Seen:  

On 3/31/2023 at 12:31 PM, Racaae said:

Use makeitem instead of getitem.

Example:

if (rand(100) < 10) {
	getunitdata killedgid, .@data;
	makeitem 45018,1, mapid2name(.@data[UMOB_MAPID]),.@data[UMOB_X],.@data[UMOB_Y], true;
}

 

already tried it but it doesn't drop the item.

Could you show how to put in the script.

Edit: sorry already working, forget to change item reward.

Edited by hendra814
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...