Jump to content
  • 0

MVP Kill Reward npc


Mabuhay

Question


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

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
Link to comment
Share on other sites

18 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   0
  • Joined:  03/02/12
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

try this

http://pastebin.com/raw.php?i=f0MVHLMc

http://pastebin.com/raw.php?i=yw729EYR

Edited by Emistry
Add Announce part.
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

OnNPCKillEvent:
i thing it should be
OnPCKillEvent:

i get errors but its alright! :D thanks for the reply emistry and no npc name btw XD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

@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?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

thanks ur the best :)

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

@Annie

it should be

if ( getmonsterinfo( killedrid, MOB_MVPEXP ) && rand(100) < 40 ) {

otherwise this event will be triggered by all monster.. >.<

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

yteah just found out that eveymonster killed dropped yggdrasil hahaha thanks emistry

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  38
  • Reputation:   1
  • Joined:  07/27/12
  • Last Seen:  

what if i only want it in normal monsters?

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

what if i only want it in normal monsters?

remove getmonsterinfo( killedrid, MOB_MVPEXP )

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  8
  • Reputation:   0
  • Joined:  08/06/13
  • Last Seen:  

hello ..how to change the reward to cashpoint??

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

change all getitem to

#CASHPOINTS += 1234;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  8
  • Reputation:   0
  • Joined:  08/06/13
  • Last Seen:  

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.
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

#CASHPOINTS += 5;

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  8
  • Reputation:   0
  • Joined:  08/06/13
  • Last Seen:  

#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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   2
  • Joined:  07/24/12
  • Last Seen:  

fixed~

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