Jump to content
  • 0
Sign in to follow this  
MikZ

MVP PARTY REWARD

Question

Good day!

Wanted to ask how to make this script to give MVP reward to party within the screen area.

 

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

 

Im trying to improvise using the script from mission hunting yet i don't know how. T_T

OnNPCKillEvent:
	if (!getcharid(CHAR_ID_PARTY) || !.Party) {
		if (!#Mission_Count || !Mission0) end;
		for (set .@i, 0; .@i<.Quests; set .@i,.@i+1) {
			if (strmobinfo(1,killedrid) == strmobinfo(1,getd("Mission"+.@i))) {
				if (getd("Mission"+.@i+"_") < #Mission_Count) {
					dispbottom "[Hunting Mission] Killed "+(set(getd("Mission"+.@i+"_"),getd("Mission"+.@i+"_")+1))+" of "+#Mission_Count+" "+strmobinfo(1,killedrid)+".";
					end;
				}
			}
		}
	} else if (.Party) {
		set .@mob, killedrid;
		getmapxy(.@map1$, .@x1, .@y1, UNITTYPE_PC);
		getpartymember getcharid(CHAR_ID_PARTY),1;
		getpartymember getcharid(CHAR_ID_PARTY),2;
		for(set .@i,0; .@i<$@partymembercount; set .@i,.@i+1) {
			if (isloggedin($@partymemberaid[.@i], $@partymembercid[.@i])) {
				attachrid $@partymemberaid[.@i];
				if (#Mission_Count && Mission0 && Hp > 0) {
					getmapxy(.@map2$, .@x2, .@y2, UNITTYPE_PC);
					if ((.@map1$ == .@map2$ || .Party == 1) && (distance(.@x1,.@y1,.@x2,.@y2) <= 30 || .Party < 3)) {
						for(set .@j,0; .@j<.Quests; set .@j,.@j+1) {
							if (strmobinfo(1,.@mob) == strmobinfo(1,getd("Mission"+.@j))) {
								if (getd("Mission"+.@j+"_") < #Mission_Count) {
									dispbottom "[Hunting Mission] Killed "+(set(getd("Mission"+.@j+"_"),getd("Mission"+.@j+"_")+1))+" of "+#Mission_Count+" "+strmobinfo(1,.@mob)+".";
									break;
								}
							}
						}
					}
				}
			}
		}
	}
OnInit:
	set .Party,3;		// Party options: 0 (exclude party kills), 1 (include party kills), 2 (same map only), 3 (screen are only)

 

Edited by MikZ

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.