Jump to content
  • 0

MVP Announcer Bug


mawjustin

Question


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  121
  • Reputation:   6
  • Joined:  09/26/14
  • Last Seen:  

Hi guys, I'm having problems with this script that I got from here, there are times that it does not give rewards, and there are also times that it duplicates rewards when a player dies from an MVP on the map array. I tried to loop this so that I can avoid duplicates and not giving rewards, but I am unsuccessful in doing so, is there a way to fix this? No errors in server log is showing.

// =================== MVP KILL ===============
// ====== MVP will drop an item only ==========
// ====== at specific maps. ===================
// ====== if players are on a party ===========
// ====== item will be given randomly =========
// ====== to any online party members =========
// ============== by : pajodex ================
// ==== Additional Comments: ==================
// 1.0 - Initial release (MVP Kill standalone)
// 1.1 - used setarray function to optimize script
// 1.2 - Added modified Euphy MVP ladder
//		 slight rework on the script
// 1.3 - Fixed on reset function (Report by: celeron0134)
// ============================================  

-	script	#MVP_Hunt_Shop	-1,{

GoBackToLoop_iii: // run loop again.

OnInit:
	set .mvppointshunt,1;
	setarray .p_rwd, 61100,1,50000,1;	// Party reward <item>,<amount> 
	setarray .s_rwd, 61100,2,50000,1;	// Solo reward <item>,<amount>
	.chance = 100;	// Drop rate chances % 
	.gm = 100;  // Prevents gm level and above to trigger the event

	// MVP Map list 
setarray .t_mvphunt_maps$[0],
//"ordeal_1-1", // Devil Square	
//"1@tower", // Endless Tower 1
//"2@tower", // Endless Tower 2
//"3@tower", // Endless Tower 3
//"4@tower", // Endless Tower 4
//"5@tower", // Endless Tower 5
//"6@tower", // Endless Tower 6 
"cmd_fild03","gef_fild01", // Toad   (TOAD)   Mob-ID#1089
"pay_fild04","prt_maze03","xmas_dun01","yuno_fild04", // Mastering   (MASTERING)   Mob-ID#1090
"moc_pryd06", // Amon Ra   (AMON_RA)   Mob-ID#1511
"lhz_dun03", // Assassin Cross Eremes   (B_EREMES)   Mob-ID#1647
"gld_dun03_2","ra_fild02","ra_fild03","ra_fild04","ve_fild01","ve_fild02", // Atroce   (ATROCE)   Mob-ID#1785
"lou_dun03", // Bacsojin / White Lady   (BACSOJIN_)   Mob-ID#1630
"prt_maze03", // Baphomet   (BAPHOMET)   Mob-ID#1039
"bra_dun02", // Boitata   (BOITATA)   Mob-ID#2068
"gld_dun04","gld_dun04_2","gl_chyard", // Dark Lord   (DARK_LORD)   Mob-ID#1272
"abyss_03", // Detale / Detardeurus   (DETALE)   Mob-ID#1719
"gef_dun02","gld_dun02", // Doppelganger   (DOPPELGANGER)   Mob-ID#1046
"gef_dun01", // Dracula   (DRACULA)   Mob-ID#1389
"treasure02", // Drake   (DRAKE)   Mob-ID#1112
"gld_dun01","gld_dun01_2","pay_fild11", // Eddga   (EDDGA)   Mob-ID#1115
"gon_dun03", // Evil Snake Lord   (DARK_SNAKE_LORD)   Mob-ID#1418
"abbey02", // Fallen Bishop / Fallen Bishop Hibram   (FALLINGBISHOP)   Mob-ID#1871
"xmas_fild01", // Garm / Hatii   (GARM)   Mob-ID#1252
"ra_san05", // Gloom Under Night   (GLOOMUNDERNIGHT)   Mob-ID#1768
"prt_sewb4", // Golden Thief Bug   (GOLDEN_BUG)   Mob-ID#1086
"mosk_dun03", // Gopinich   (GOPINICH)   Mob-ID#1885
"lhz_dun03", // High Priest Magaleta / High Priest Margaretha   (B_MAGALETA)   Mob-ID#1649
"lhz_dun03", // High Wizard Katrinn / High Wizard Kathryne   (B_KATRINN)   Mob-ID#1651
"thor_v03", // Ifrit   (IFRIT)   Mob-ID#1832
"ama_dun03", // Incantation Samurai / Samurai Specter   (INCANTATION_SAMURAI)   Mob-ID#1492
"kh_dun02", // Kiel D-01   (KIEL_)   Mob-ID#1734
"xmas_dun02", // Knight of Windstorm / Stormy Knight   (KNIGHT_OF_WINDSTORM)   Mob-ID#1251
"ice_dun03", // Ktullanux   (KTULLANUX)   Mob-ID#1779
"ayo_dun02", // Lady Tanee   (LADY_TANEE)   Mob-ID#1688
"lhz_dun03", // Lord Knight Seyren   (B_SEYREN)   Mob-ID#1646
"niflheim", // Lord of Death / Lord of the Dead   (LORD_OF_DEATH)   Mob-ID#1373
"anthell02","gld_dun02_2","gld_dun03", // Maya   (MAYA)   Mob-ID#1147
"mjolnir_04", // Mistress   (MISTRESS)   Mob-ID#1059
"pay_dun04", // Moonlight Flower   (MOONLIGHT)   Mob-ID#1150
"2@nyd", // Nidhoggr's Shadow   (S_NYDHOG)   Mob-ID#2022
"gef_fild02","gef_fild14", // Orc Hero   (ORK_HERO)   Mob-ID#1087
"gef_fild10", // Orc Lord   (ORC_LORD)   Mob-ID#1190
"moc_pryd04", // Osiris   (OSIRIS)   Mob-ID#1038
"in_sphinx5", // Pharaoh   (PHARAOH)   Mob-ID#1157
"moc_fild17", // Phreeoni   (PHREEONI)   Mob-ID#1159
"ein_dun02", // RSX 0806 / RSX-0806   (RSX_0806)   Mob-ID#1623
"lhz_dun03", // Sniper Shecil / Sniper Cecil   (B_SHECIL)   Mob-ID#1650
"beach_dun", // Tao Gunka   (TAO_GUNKA)   Mob-ID#1583
"thana_boss", // Thanatos / Memory of Thanatos   (THANATOS)   Mob-ID#1708
"tur_dun04", // Turtle General   (TURTLE_GENERAL)   Mob-ID#1312
"odin_tem03", // Valkyrie Randgris   (RANDGRIS)   Mob-ID#1751
"jupe_core", // Vesper   (APOCALIPS_H)   Mob-ID#1685
"lhz_dun03", // Whitesmith Harword / Whitesmith Howard   (B_HARWORD)   Mob-ID#1648
"moc_fild22", // Wounded Morroc   (MOROCC_)   Mob-ID#1917
"lhz_dun02"; // Ygnizem / Egnigem Cenia   (B_YGNIZEM)   Mob-ID#1658
	end;

OnPCDieEvent:
for (.@aa = 0; .@aa < getarraysize(.t_mvphunt_maps$); .@aa++) {
	if ( strcharinfo(3) == .t_mvphunt_maps$[.@aa]) {
		dispbottom "[Hunt]: You died!";
		goto GoBackToLoop_iii;
	}
}
end;

if (.mvppointshunt == 0) {
set .mvppointshunt,1;
goto GoBackToLoop_iii;
end;
}

OnNPCKillEvent:
sleep2 500;
if (getgmlevel() >= .gm ) { end; } // If gm = event wont happen 	
if ( getmonsterinfo( killedrid, MOB_MVPEXP )) {
	for (.@aaa = 0; .@aaa < getarraysize(.t_mvphunt_maps$); .@aaa++) {
	if ( strcharinfo(3) == .t_mvphunt_maps$[.@aaa]) { 
			if ( getcharid(1) ) {
				getpartymember getcharid(1), 1;
				getpartymember getcharid(1), 2;
				for ( .@iii = 0; .@iii < $@partymembercount; .@iii++ ) {
					if ( isloggedin( $@partymemberaid[.@iii], $@partymembercid[.@iii] ) ) { 
						.@partymemberaid[.@ccc] = $@partymemberaid[.@iii];
						.@ccc++;
					}
				}
				set .@mvppointshunt,0;
				getitem .p_rwd[0], .p_rwd[1], .@partymemberaid[ rand( .@ccc ) ];
				getitem .p_rwd[2], .p_rwd[3], .@partymemberaid[ rand( .@ccc ) ];
				announce "[ System ] : Player ["+ strcharinfo(0) +"] of party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), bc_all,0xffb6c1;
			}
			else {
				set .@mvppointshunt,0;
				getitem .s_rwd[0], .s_rwd[1];
				getitem .s_rwd[2], .s_rwd[3];
				announce "[ System ] : Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" alone at "+ strcharinfo(3), bc_all,0xffb6c1;
			}
		MVPHunts = MVPHunts+1;
		dispbottom "---------------------------------------------------";
		dispbottom "You killed a total of "+MVPHunts+" MVP"+((MVPHunts == 1)?"":"s")+".";
		dispbottom "---------------------------------------------------";
	dispbottom "[Hunt]: MVP Killed!";
	goto GoBackToLoop_iii;
		end;
		}
	}
	end;
	}	
}

I added this bit of code in hopes to fix the problem, but I was unsuccessful.

OnPCDieEvent:
for (.@aa = 0; .@aa < getarraysize(.t_mvphunt_maps$); .@aa++) {
	if ( strcharinfo(3) == .t_mvphunt_maps$[.@aa]) {
		dispbottom "[Hunt]: You died!";
		goto GoBackToLoop_iii;
	}
}
end;

if (.mvppointshunt == 0) {
set .mvppointshunt,1;
goto GoBackToLoop_iii;
end;
}

Thank you guys.

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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