Jump to content
  • 0

Question

Posted

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

13 answers to this question

Recommended Posts

  • 0
Posted (edited)
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
  • 0
Posted (edited)

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
  • 0
Posted
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
  • 0
Posted
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

  • 0
Posted (edited)
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
  • 0
Posted
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

  • 0
Posted

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;
}

 

  • 0
Posted
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

  • 0
Posted
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

  • 0
Posted (edited)
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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...