Notorius Posted March 27, 2023 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 109 Reputation: 1 Joined: 09/24/19 Last Seen: March 11 Share Posted March 27, 2023 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; } Quote Link to comment Share on other sites More sharing options...
0 Racaae Posted March 31, 2023 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 214 Reputation: 94 Joined: 06/02/12 Last Seen: 33 minutes ago Share Posted March 31, 2023 (edited) 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 March 31, 2023 by Racaae missing info Quote Link to comment Share on other sites More sharing options...
0 Notorius Posted March 28, 2023 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 109 Reputation: 1 Joined: 09/24/19 Last Seen: March 11 Author Share Posted March 28, 2023 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; } Quote Link to comment Share on other sites More sharing options...
0 Racaae Posted March 28, 2023 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 214 Reputation: 94 Joined: 06/02/12 Last Seen: 33 minutes ago Share Posted March 28, 2023 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; Quote Link to comment Share on other sites More sharing options...
0 Notorius Posted March 29, 2023 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 109 Reputation: 1 Joined: 09/24/19 Last Seen: March 11 Author Share Posted March 29, 2023 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 Quote Link to comment Share on other sites More sharing options...
0 Racaae Posted March 31, 2023 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 214 Reputation: 94 Joined: 06/02/12 Last Seen: 33 minutes ago Share Posted March 31, 2023 On 3/29/2023 at 3:57 AM, Notorius said: https://prnt.sc/yRgj90bqgX1F now i get this error Share your script here please Quote Link to comment Share on other sites More sharing options...
0 Notorius Posted March 31, 2023 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 109 Reputation: 1 Joined: 09/24/19 Last Seen: March 11 Author Share Posted March 31, 2023 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% Quote Link to comment Share on other sites More sharing options...
0 Racaae Posted March 31, 2023 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 214 Reputation: 94 Joined: 06/02/12 Last Seen: 33 minutes ago Share Posted March 31, 2023 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; } 1 Quote Link to comment Share on other sites More sharing options...
0 Notorius Posted March 31, 2023 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 109 Reputation: 1 Joined: 09/24/19 Last Seen: March 11 Author Share Posted March 31, 2023 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? Quote Link to comment Share on other sites More sharing options...
0 Racaae Posted March 31, 2023 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 214 Reputation: 94 Joined: 06/02/12 Last Seen: 33 minutes ago Share Posted March 31, 2023 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; } Quote Link to comment Share on other sites More sharing options...
0 hendra814 Posted April 24, 2023 Group: Members Topic Count: 59 Topics Per Day: 0.01 Content Count: 1281 Reputation: 170 Joined: 06/12/12 Last Seen: 9 hours ago Share Posted April 24, 2023 (edited) 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 April 24, 2023 by hendra814 Quote Link to comment Share on other sites More sharing options...
Question
Notorius
how do i make this work? I want to add a drop to mvp custom that gives it a rateof 1%
Link to comment
Share on other sites
10 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.