Jump to content
  • 0

[MVP COIN] MvP Drop Coin


JoseRicart

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  02/19/14
  • Last Seen:  

good morning, my name is Jose and it is a pleasure to return to these whereabouts of the world of rathena after a long break for personal reasons, as usual I come to disturb a bit here.

About 4-5 years ago I had a script which when you killed an MvP gave you a coin automatically, it turns out that when I added it to the server's custom scripts it is, let's say, "half-working" since it is true that the script when you kill an MvP, it drops the coin, but also when you kill a poring, a skeleton, a zombie, a plant, a spore, in short, when you kill everything.

Could someone help me or give me some support?

I upload the script with an imagen for example

 

drop.png

mvpdropcoin.txt

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1536
  • Reputation:   237
  • Joined:  08/03/12
  • Last Seen:  

4 hours ago, JoseRicart said:

good morning, my name is Jose and it is a pleasure to return to these whereabouts of the world of rathena after a long break for personal reasons, as usual I come to disturb a bit here.

About 4-5 years ago I had a script which when you killed an MvP gave you a coin automatically, it turns out that when I added it to the server's custom scripts it is, let's say, "half-working" since it is true that the script when you kill an MvP, it drops the coin, but also when you kill a poring, a skeleton, a zombie, a plant, a spore, in short, when you kill everything.

Could someone help me or give me some support?

I upload the script with an imagen for example

 

drop.png

mvpdropcoin.txt 282 B · 2 downloads

Try to use this line, change your script a bit.

if ( getmonsterinfo( killedrid, MOB_MVPEXP ))
Edited by Chaos92
missing a curly bracket
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  02/19/14
  • Last Seen:  

Still the same, i add an image,

 

Red Reference means i killed an MvP = Drop coin and announce it

Green referente means i killed poring = drop coin no announce it

drop2.png

Edited by JoseRicart
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  65
  • Reputation:   10
  • Joined:  08/02/18
  • Last Seen:  

58 minutes ago, JoseRicart said:

Still the same, i add an image,

 

Red Reference means i killed an MvP = Drop coin and announce it

Green referente means i killed poring = drop coin no announce it

drop2.png

 this?

Spoiler

OnNPCKillEvent:
    .@it = 607;
    if(getmonsterinfo(killedrid,MOB_MVPEXP)){
        announce strcharinfo(0)+" killed "+getmonsterinfo(killedrid,MOB_NAME)+" get "+getitemname(.@it),bc_all,0x00FF00;
        getitem .@it,1;
    }
    end;

 

  • Upvote 2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  02/19/14
  • Last Seen:  

36 minutes ago, Mahiro said:

 this?

  Hide contents

OnNPCKillEvent:
    .@it = 607;
    if(getmonsterinfo(killedrid,MOB_MVPEXP)){
        announce strcharinfo(0)+" killed "+getmonsterinfo(killedrid,MOB_NAME)+" get "+getitemname(.@it),bc_all,0x00FF00;
        getitem .@it,1;
    }
    end;

 

 

oh wow your amazin, was missing a curly but now all work, tysm

 

 

in case someone wants the script working, here the script

NOTE: IGNORE THE COMMENT ON THE CODE

 

curly.png

mvpdropcoin.txt

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  90
  • Reputation:   34
  • Joined:  10/01/18
  • Last Seen:  

6 hours ago, JoseRicart said:

good morning, my name is Jose and it is a pleasure to return to these whereabouts of the world of rathena after a long break for personal reasons, as usual I come to disturb a bit here.

About 4-5 years ago I had a script which when you killed an MvP gave you a coin automatically, it turns out that when I added it to the server's custom scripts it is, let's say, "half-working" since it is true that the script when you kill an MvP, it drops the coin, but also when you kill a poring, a skeleton, a zombie, a plant, a spore, in short, when you kill everything.

Could someone help me or give me some support?

I upload the script with an imagen for example

 

drop.png

mvpdropcoin.txt 282 B · 4 downloads

I made this on a phone...Please give a try (based on your script and optimized it).

I added some multiple items  reward with chances added some flavor to your server. ?

//Created Date: 04/07/2022
-	script	AEOUS_MVP_DROP	FAKE_NPC,{
	end;
OnNPCKillEvent:
	.@rnd = rand(1,100);
	if( getmonsterinfo( killedrid,MOB_MVPEXP ) ) {
	for( .@i = 0; .@i < getarraysize(.item_arrays); .@i += 3 ) {
		if( .@rnd < .item_arrays[.@i+2] ) {
			getitem .item_arrays[.@i], .item_arrays[.@i+1];
			announce "Congratulations! Player "+ strcharinfo(0) +" has obtained "+ getitemname( .item_arrays[.@i] ) +" ["+ .item_arrays[.@i+1] +"] from "+ getmonsterinfo(killedrid, 0) +" (chance: "+.item_arrays[.@i+2]+"%) MVP Drop(s).",bc_all,0x00FF00;
		}
	}
	end;
}

OnInit:
//	(<structure,<item_id>,<chances>)
	setarray .item_arrays[0],
		675,	1,	10,
		677,	1,	30,
		7539,	1,	100;
	end;
}

 

Edited by Royr
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  02/19/14
  • Last Seen:  

2 hours ago, Royr said:

I made this on a phone...Please give a try (based on your script and optimized it).

I added some multiple items  reward with chances added some flavor to your server. ?

//Created Date: 04/07/2022
-	script	AEOUS_MVP_DROP	FAKE_NPC,{
	end;
OnNPCKillEvent:
	.@rnd = rand(1,100);
	if( getmonsterinfo( killedrid,MOB_MVPEXP ) ) {
	for( .@i = 0; .@i < getarraysize(.item_arrays); .@i += 3 ) {
		if( .@rnd < .item_arrays[.@i+2] ) {
			getitem .item_arrays[.@i], .item_arrays[.@i+1];
			announce "Congratulations! Player "+ strcharinfo(0) +" has obtained "+ getitemname( .item_arrays[.@i] ) +" ["+ .item_arrays[.@i+1] +"] from "+ getmonsterinfo(killedrid, 0) +" (chance: "+.item_arrays[.@i+2]+"%) MVP Drop(s).",bc_all,0x00FF00;
		}
	}
	end;
}

OnInit:
//	(<structure,<item_id>,<chances>)
	setarray .item_arrays[0],
		675,	1,	10,
		677,	1,	30,
		7539,	1,	100;
	end;
}

 

wow man you give me a fucking idea and sorry for the word ffs, your a fking legend.

Basically i can add custom items wiht % of drop whenever you kill an MvP omfg asjhkdhjksfjhdsfjhkdashfnbjkh im so excited

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.07
  • Content Count:  95
  • Reputation:   1
  • Joined:  11/15/22
  • Last Seen:  

Hi ive been looking for something like this, I wonder if it's possible that all players that dealt certain damage to the MVP get chance to get item reward?

 

Thank you so much

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:  

There is a slight mistake in the script, it has a chance of 1:99 instead of 1:100.

if( .@rnd < .item_arrays[.@i+2] ) {

Makes it range from 1 to 99 since the last check is: 1 - 100 < 100.

//Created Date: 04/07/2022
-	script	AEOUS_MVP_DROP	FAKE_NPC,{
	OnNPCKillEvent:
		.@rnd = rand(1,100);
		if( getmonsterinfo( killedrid,MOB_MVPEXP ) <= 0) end;

		for( .@i = 0; .@i < getarraysize(.item_arrays); .@i += 3 ) {
			if( .@rnd <= .item_arrays[.@i+2] ) {
				getitem .item_arrays[.@i], .item_arrays[.@i+1];
				announce "Congratulations! Player "+ strcharinfo(0) +" has obtained "+ getitemname( .item_arrays[.@i] ) +" ["+ .item_arrays[.@i+1] +"] from "+ getmonsterinfo(killedrid, 0) +" (chance: "+.item_arrays[.@i+2]+"%) MVP Drop(s).",bc_all,0x00FF00;
			}
		}
		end;
	}

	OnInit:
		//	(<structure,<item_id>,<chances>)
		setarray .item_arrays[0],
			675,	1,	10,
			677,	1,	30,
			7539,	1,	100;
		end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.07
  • Content Count:  95
  • Reputation:   1
  • Joined:  11/15/22
  • Last Seen:  

On 7/31/2023 at 5:17 PM, Winterfox said:

There is a slight mistake in the script, it has a chance of 1:99 instead of 1:100.

if( .@rnd < .item_arrays[.@i+2] ) {

Makes it range from 1 to 99 since the last check is: 1 - 100 < 100.

//Created Date: 04/07/2022
-	script	AEOUS_MVP_DROP	FAKE_NPC,{
	OnNPCKillEvent:
		.@rnd = rand(1,100);
		if( getmonsterinfo( killedrid,MOB_MVPEXP ) <= 0) end;

		for( .@i = 0; .@i < getarraysize(.item_arrays); .@i += 3 ) {
			if( .@rnd <= .item_arrays[.@i+2] ) {
				getitem .item_arrays[.@i], .item_arrays[.@i+1];
				announce "Congratulations! Player "+ strcharinfo(0) +" has obtained "+ getitemname( .item_arrays[.@i] ) +" ["+ .item_arrays[.@i+1] +"] from "+ getmonsterinfo(killedrid, 0) +" (chance: "+.item_arrays[.@i+2]+"%) MVP Drop(s).",bc_all,0x00FF00;
			}
		}
		end;
	}

	OnInit:
		//	(<structure,<item_id>,<chances>)
		setarray .item_arrays[0],
			675,	1,	10,
			677,	1,	30,
			7539,	1,	100;
		end;
}

 

Hi, can you help me so I can make every player that dealt damage to the mvp get a coin?

Thank you so much

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:  

I don't think this is possible without a source code change, since there is no event to know when a specific mob is attacked by a player.

  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.07
  • Content Count:  95
  • Reputation:   1
  • Joined:  11/15/22
  • Last Seen:  

On 8/10/2023 at 8:55 PM, Winterfox said:

I don't think this is possible without a source code change, since there is no event to know when a specific mob is attacked by a player.

There's  a function here ONPCAttackEvent() but I cant make it work coz i think i am using newer client. Thank you

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:  

8 hours ago, namerpus18 said:

There's  a function here ONPCAttackEvent() but I cant make it work coz i think i am using newer client. Thank you

Where is this function exactly?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.07
  • Content Count:  95
  • Reputation:   1
  • Joined:  11/15/22
  • Last Seen:  

6 hours ago, Winterfox said:

Where is this function exactly?

I tried to add it manually because the client diff is outdated and I am using a newer client. I am getting an error on an identifier of the function do_battle_events as others do. Here's my src code I edited don't mind the "+" sign I intentionally leave it there. If you mind

AttackEvent.diff battleCCPsrc.txt

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