Jump to content
  • 0

MVP Kill Reward npc


Question

Posted (edited)

Can someone make a script that every time a player kills a MVP at their respective maps, they will receive 3 607(sample item). Only the one who killed the mvp will receive the reward. in-case of party, the reward randomly regardless on which one of them killed the MVP.

It would be preferable if it will be announce that Player1 has killed *MVPname* to all map and in partcase Partyname has killed *Mvpname* /thx/ok

Edited by MrVandalBus

18 answers to this question

Recommended Posts

  • 1
Posted

yeah lol you are right

-	script	jfksdhfkjs	-1,{
OnNPCKillEvent:
if ( getmonsterinfo( killedrid, MOB_MVPEXP ) && rand(100) < 40 ) {
	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 607, 3, .@partymemberaid[ rand( .@c ) ];
		announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
	}
	else {
		getitem 607, 3;
		announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
	}
}
end;
}

  • 0
Posted
On 12/19/2012 at 11:22 PM, AnnieRuru said:

yeah lol you are right

 

-	script	jfksdhfkjs	-1,{
OnNPCKillEvent:
if ( getmonsterinfo( killedrid, MOB_MVPEXP ) && rand(100) < 40 ) {
	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 607, 3, .@partymemberaid[ rand( .@c ) ];
		announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
	}
	else {
		getitem 607, 3;
		announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
	}
}
end;
}
 

 

How to make this rewards all party members online.

Posted

.... swt ...

I thought your script getting better and better, but it just getting more screw up

nvm, I do it

-	script	jfksdhfkjs	-1,{
OnNPCKillEvent:
if ( !getmonsterinfo( killedrid, MOB_MVPEXP ) ) 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 607, 3, .@partymemberaid[ rand( .@c ) ];
	announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
else {
	getitem 607, 3;
	announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
end;
}

your event script writing needs more experiences

@MrVandalBus

OnNPCKillEvent is correct

Posted

@a

.... swt ...

I thought your script getting better and better, but it just getting more screw up

nvm, I do it

-	script	jfksdhfkjs	-1,{
OnNPCKillEvent:
if ( !getmonsterinfo( killedrid, MOB_MVPEXP ) ) 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 607, 3, .@partymemberaid[ rand( .@c ) ];
	announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
else {
	getitem 607, 3;
	announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
end;
}

your event script writing needs more experiences

@MrVandalBus

OnNPCKillEvent is correct

Thanks AnnieRuru working great! /no1

Im sorry im noob at scripting /yawn

.... swt ...

I thought your script getting better and better, but it just getting more screw up

nvm, I do it

-	script	jfksdhfkjs	-1,{
OnNPCKillEvent:
if ( !getmonsterinfo( killedrid, MOB_MVPEXP ) ) 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 607, 3, .@partymemberaid[ rand( .@c ) ];
	announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
else {
	getitem 607, 3;
	announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
end;
}

your event script writing needs more experiences

@MrVandalBus

OnNPCKillEvent is correct

what if the reward will only be dropped at 40% chance? is it possible?

Posted
-	script	jfksdhfkjs	-1,{
OnNPCKillEvent:
if ( getmonsterinfo( killedrid, MOB_MVPEXP ) || rand(100) < 40 ) {
	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 607, 3, .@partymemberaid[ rand( .@c ) ];
		announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
	}
	else {
		getitem 607, 3;
		announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
	}
}
end;
}

Posted (edited)

thx for the reply.master

there is an error on line 13...

 

 

- script jfksdhfkjs -1,{
OnNPCKillEvent:
if ( getmonsterinfo( killedrid, MOB_MVPEXP ) && rand(100) < 40 ) {
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++;
}
}
#CASHPOINTS += 5, .@partymemberaid[ rand( .@c ) ];
announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
else {
#CASHPOINTS += 5;
dispbottom "You now have " +#CASHPOINTS+ " cash points";
announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
}
}
end;
}
Edited by Emistry
changed to code bbcode.
Posted
#CASHPOINTS += 5;

you cant add another "parameter" for it...

ow..sorry.. im just new in this kind of things..thank you for the reply..now its working ..your the master of scripting /no1

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