Jump to content
  • 0

MF_NoSave & MF_NoExpPenalty


llchrisll

Question


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Update: Deleted the script samples to prevent the usage of them. (security first D:)

Also close please ;).

------------------------------------------------------------------------------------------------------------

Hi guys, I got a few problems with the following two mapflags:

mf_nosave & mf_noexppenalty

I'm trying to make an PvP/GvG/MvP Arena with included ranking system.

I though about the mapflags and since I saw in an script I could that via their numbers and an array, I did it that way.

My only problem is that it doesn't work with those two mf_ above.

I dunno why though.

Here are screenshots, InGame Debug Messages & Map Server console.

InGame - Here I skipped the mf_nosave but it stopped at the second one.

pvpingerror.png

Map Server Error:

pvpmaperror.png

Uploaded with ImageShack.us

Regards,

Chris

Edited by calciumkid
Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

* bump * (wanted to that too D: at least once)

Can no one help me? My SVN is eAthena SQL 14484 Trunk (Test Server, so I don't need always the newest svn o.o)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  764
  • Reputation:   220
  • Joined:  11/14/11
  • Last Seen:  

Are you sure the error belongs to one of the snippets?

Actually the error is thrown when you try to compare integers and strings:

if( data_isstring(left) && data_isstring(right) )
{// ss => op_2str
 op_2str(st, op, left->u.str, right->u.str);
 script_removetop(st, -3, -1);// pop the two values before the top one
}
else if( data_isint(left) && data_isint(right) )
{// ii => op_2num
 int i1 = left->u.num;
 int i2 = right->u.num;
 script_removetop(st, -2, 0);
 op_2num(st, op, i1, i2);
}
else
{// invalid argument
 ShowError("script:op_2: invalid data for operator %sn", script_op2name(op));
 script_reportdata(left);
 script_reportdata(right);
 script_reportsrc(st);
 script_removetop(st, -2, 0);
 script_pushnil(st);
 st->state = END;
}

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Are you sure the error belongs to one of the snippets?

Actually the error is thrown when you try to compare integers and strings:

Yeah, I wasn't testing any other script at the moment, cuz when I commented it out and "restarted" my server it continued till it stopped at MF 44 > mf_noexppenalty.

I was confused about that first too >-<, why he shows errors at those mapflags....

To "restart" the server I used this

OnWhisperGlobal:
set .@re_in,0;
set $@debug,0;
if(select("- ReLoad:- Nevermind") == 2) end;
if(select("- Debug: Without Debug") == 1) set $@debug,1;
set .@re_in,1;
goto OnInit;
end;	
}

That's my way to bug hunt and it worked always so far o.o.

.@re_in is for to prevent "attachrid" error when the server really (re)start :).

Here is my whole script if you want, but it's with commented part....

//===== eAthena Script =======================================
//= Arena Master
//===== By ===================================================
//= lllchrislll
//===== Version ==============================================
//= 1.0 - Script Made
//===== Compatible With ======================================
//= Every eAthena Version [sql]
//===== Description ==========================================
//= PvP / GvG & MvP Arena which also handles an ranking to it.
//= PvP Types:
//  - Normal
//  - Dispell: You'll be dispelled on Room entry.
//  - Deathmatch: You'll be auto resurrect when you die.
//	If you type @die or similar, you'll be warped to your save point.
//  - Party PvP: 2vs2, 3vs3, 4vs4, 5vs5
//= PvP:
//  - There are 5 Rooms: Prontera, Alberta, Izlude, Morroc
//	PvP Types: Normal - Deathmatch has one of these.
//	That means 5*3.
//  - Party PvP: There are 4 types and those also has one of room each.
//  > So 5*4.
//  -----------------------------------------------
//  = Total 35 Rooms !!!!
//  -----------------------------------------------
//= GvG: 5 Arenas, the default guild_vs1 - guild_vs5.
//= MvP: For the MvP Part I'm using the scripts in npc/custom/MVP_arena/
//	   Enable both in npc/scripts_custom.conf
//	   You can disable the warper of it or let it be as it is.
//===== Comments & Credits =============================================
//= Credits:
//  - MvP Arena: Darkchild, massdriller, Silent
//===== MySQL Entries ========================================
/*
DROP TABLE IF EXISTS `arena_master`;
CREATE TABLE `arena_master` (
 `char_id` int(10) unsigned NOT NULL,
 `kills` smallint(5) unsigned DEFAULT '0',
 `death` smallint(5) unsigned DEFAULT '0',
 `hscore` smallint(5) unsigned DEFAULT '0',
 `killer` smallint(5) unsigned DEFAULT '0',
 `domi` smallint(5) unsigned DEFAULT '0',
 `mega` smallint(5) unsigned DEFAULT '0',
 `ridic` smallint(5) unsigned DEFAULT '0',
 `unstopp` smallint(5) unsigned DEFAULT '0',
 `holys` smallint(5) unsigned DEFAULT '0',
 `horren` smallint(5) unsigned DEFAULT '0',
 `godlike` smallint(5) unsigned DEFAULT '0',
 `mvp` smallint(5) unsigned DEFAULT '0',
PRIMARY KEY (`char_id`)
) ENGINE=MyISAM;
*/
//============================================================
prontera,142,168,0	script	Arena Master	808,{
set .@n$,"["+strnpcinfo(1)+"]";
function getPartyMapUsers;

mes .@n$;
mes "How can I help you?";
next;
menu "- I wanna fight!!",-,"- See Rankings",R_Rank,"- Nevermind",R_Bye;

mes .@n$;
mes "Which room do you want?";
next;
switch(select("- GvG:- PvP:- MvP:- Nevermind")) {

case 1:
mes .@n$;
if(!getcharid(2)) {
	mes "I'm sorry, but you are not in a guild.";
	close;
}
mes "Please choose the room you want to join:";
mes "Each arena can hold up to "+$@mgvg+" player(s).";
if($@same_gld) mes "If guilds already are in this room, you have to be a member of it so that you can join.";
next;
set .@rchoi,select("- GvG 1 ["+getmapusers($@gvgr$[0])+"]:- GvG 2 ["+getmapusers($@gvgr$[1])+"]:- GvG 3 ["+getmapusers($@gvgr$[2])+"]:- GvG 4 ["+getmapusers($@gvgr$[3])+"]:- GvG 5 ["+getmapusers($@gvgr$[4])+"]") - 1;
set @gvgc,@menu;
mes .@n$;
if($@same_gld) {
	if(getd("$@gvg_"+@gvgc+"_gld_1") == 0) {
		mes "I will warp you now.";
		close2;
		warp $@gvgr$[.@rchoi],$@gvg_gld1_x[.@rchoi],$@gvg_gld1_y[.@rchoi];
		setd("$@gvg_"+@gvgc+"_gld_1"),getcharid(2);
		setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") + 1;
		end;
	} else if(getd("$@gvg_"+@gvgc+"_gld_2") == 0) {
		mes "I will warp you now.";
		close2;
		warp $@gvgr$[.@rchoi],$@gvg_gld2_x[.@rchoi],$@gvg_gld2_x[.@rchoi];
		setd("$@gvg_"+@gvgc+"_gld_2"),getcharid(2);
		setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") + 1;
		end;
	}
	if(getd("$@gvg_"+@gvgc+"_gld_1") == getcharid(2)) {
		if(getd("$@gvg_"+@gvgc+"_1_ppl") >= $@mpgld) {
			mes "I'm sorry, but your guild's side is already full.";
			close;
		}
		mes "I will warp you now.";
		close2;
		warp $@gvgr$[.@rchoi],$@gvg_gld1_x[.@rchoi],$@gvg_gld1_y[.@rchoi];
		setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") + 1;
		end;
	} else if(getd("$@gvg_"+@gvgc+"_gld_2") == getcharid(2)) {
		if(getd("$@gvg_"+@gvgc+"_2_ppl") >= $@mpgld) {
			mes "I'm sorry, but your guild's side is already full.";
			close;
		}
		mes "I will warp you now.";
		close2;
		warp $@gvgr$[.@rchoi],$@gvg_gld2_x[.@rchoi],$@gvg_gld2_x[.@rchoi];
		setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") + 1;
		end;
	}
} else {
	if(getmapusers($@gvgr$[.@rchoi]) >= $@mgvg) {
		mes "I'm sorry, but this Arena is already full.";
		close;
	}
	mes "I will warp you now.";
	close2;
	warp $@gvgr$[.@rchoi],0,0;
	end;
}
break;

case 2:
set @map,select("- Prontera:- Alberta:- Izlude:- Payon:- Morroc") - 1;
mes .@n$;
mes "Please choose the PvP Type:";
mes "Each arena can hold up to "+$@mpvp+" player(s).";
mes "Party PvP is different of course.";
next;
switch(select("- PvP (Dispell) ["+getmapusers($@disppvp$[@map])+"]:- Normal PvP ["+getmapusers($@npvp$[@map])+"]:- PvP Deathmatch["+getmapusers($@dmpvp$[@map])+"]:- Party PvP["+getPartyMapUsers(6)+"]")) {

	case 1:
	mes .@n$;
	if(getmapusers($@disppvp$[@map]) >= $@mpvp) {
		mes "I'm sorry, but this room is already full.";
		close;
	}
	mes "I'll warp you now to the "+ $@room$[@map]+" PvP Room, also remove all your buffs.";
	close2;
	sc_end SC_ALL;
	warp $@disppvp$[@map],0,0;
	end;

	case 2:
	mes .@n$;
	if(getmapusers($@npvp$[@map]) >= $@mpvp) {
		mes "I'm sorry, but this room is already full.";
		close;
	}
	mes "I'll warp you now to the "+ $@room$[@map]+" PvP Room.";
	close2;
	warp $@npvp$[@map],0,0;
	end;

	case 3:
	mes .@n$;
	if(getmapusers($@dmpvp$[@map]) >= $@mpvp) {
		mes "I'm sorry, but this room is already full.";
		close;
	}
	mes "I'll warp you now to the "+ $@room$[@map]+" PvP Deathmatch Room.";
	close2;
	warp $@dmpvp$[@map],0,0;
	end;

	case 4:
	mes .@n$;
	if(!getcharid(1)) {
		mes "I'm sorry, but you are not in a party.";
		mes "Please come back as soon you have found one.";
		close;
	}
	mes "Please choose the Party vs Party Mode:";
	next;
	set .@pt,select("- 2vs2:- 3vs3:- 4vs4:- 5vs5") + 1;
	mes .@n$;
	if(getPartyMapUsers(.@pt,@map) >= (.@pt*.@pt)) {
		mes "I'm sorry, but this "+.@pt+"vs"+.@pt+" Arena is already full.";
		mes "Please try another.";
		close;
	}
	set @pty_id,getcharid(1);
	if(getpartyleader(@pty_id) != strcharinfo(0)) {
		mes "I'm sorry, but only your leader can register your party.";
		close;
	}

	getpartymember(@pty_id,1);
	set @ptymem,$@partymembercount;
	if(@ptymem != .@pt) {
		mes "I'm sorry, but you have not the required amount of members in your party.";
		mes "Please make sure that you have exact "+.@pt+" members, not more not less.";
		close;
	}
	getpartymember(@pty_id,2);
	copyarray @ptymemid[0],$@partymembercid,@ptymem;
	copyarray @ptymemaid[0],$@partymemberaid,@ptymem;
	set .@pt_ct,0;
	for ( set .@pm,0; .@pm < @ptymem; set .@pm,.@pm + 1)
		if(isloggedin(@ptymemid[.@pm],@ptymemaid[.@pm]) == 0)
			set .@pt_ct,.@pt_ct + 1;
	if(.@pt_ct) {
		mes "It seems like that members are offline.";
		mes "Please kick them and gather new members.";
		close;
	}
	mes "I'll warp your party now.";
	mes "Good luck.";
	close2;
	warpparty getd("$@pt"+.@pt+"pvp$["+@map+"]"),0,0,@pty_id;
	end;
}

case 3:
mes .@n$;
mes "I will now warp you to the MvP Master.";
mes "There you can choose 4 Arena Types with each 8 seperate rooms.";
close2;
warp "quiz_00",50,24;
end;

case 4:
goto R_Bye;
break;
}

function	getPartyMapUsers	{
// Total Map Users of the Party PvP Maps
if(getarg(0) == 6) {
set @pt2play,getmapusers($@pt2pvp$[0]) + getmapusers($@pt2pvp$[1]) + getmapusers($@pt2pvp$[2]) + getmapusers($@pt2pvp$[3]) + getmapusers($@pt2pvp$[4]);
set @pt3play,getmapusers($@pt3pvp$[0]) + getmapusers($@pt3pvp$[1]) + getmapusers($@pt3pvp$[2]) + getmapusers($@pt3pvp$[3]) + getmapusers($@pt3pvp$[4]);
set @pt4play,getmapusers($@pt4pvp$[0]) + getmapusers($@pt4pvp$[1]) + getmapusers($@pt4pvp$[2]) + getmapusers($@pt4pvp$[3]) + getmapusers($@pt4pvp$[4]);
set @pt5play,getmapusers($@pt5pvp$[0]) + getmapusers($@pt5pvp$[1]) + getmapusers($@pt5pvp$[2]) + getmapusers($@pt5pvp$[3]) + getmapusers($@pt5pvp$[4]);
return @pt2play + @pt3play + @pt4play + @pt5play;

} else return getmapusers(getd("$@pt"+getarg(0)+"pvp$["+getarg(1)+"]"));
}

R_Rank:
mes .@n$;
mes "Which ranking do you wanna see?";
next;
switch(select("- Kill:- Death:- High Score:- Killing Sphree:- Dominating:- Mega Kill:- Ridiculous:- Unstoppable:- Holy Shit:- Horrendous:- GodLike:- MvP")) {
case 1:	set .@listr$,"kill";	break;
case 2:	set .@listr$,"death";	break;
case 3: set .@listr$,"hscore";	break;
case 4: set .@listr$,"killer";	break;
case 5: set .@listr$,"domi";	break;
case 6: set .@listr$,"mega";	break;
case 7: set .@listr$,"ridic";	break;
case 8: set .@listr$,"unstopp";	break;
case 9: set .@listr$,"holys";	break;
case 10: set .@listr$,"horren";	break;
case 11: set .@listr$,"godlike";	break;
case 12: set .@listr$,"mvp";	break;
}
set @rank,@menu;
mes .@n$;
mes "Which list do you want to see?";
next;
switch(select("- Top 5:- Top 10:- Top 15:- Top 20:- Top 25:- Top 30:- Nevermind")) {

default:
set .@limit,5*@menu;
break;

case 7:
goto R_Bye;
break;
}
mes .@n$;
mes "Ranking:";
switch(@rank) {

case 1:	mes set(.@rankn$,"Top "+.@limit+" Killers");	set .@rankt$,"Kills";	break;
case 2:	mes set(.@rankn$,"Top "+.@limit+" Victims");	set .@rankt$,"Deaths";	break;
case 3:	mes set(.@rankn$,"Top "+.@limit+" High Scores");	set .@rankt$,"High Score";	break;
default:	mes set(.@rankn$,"Top "+.@limit+" "+$@sphree$[@rank-3]);	set .@rankt$,$@sphree$[@rank-3];	break;
}
mes "Correct?";
next;
if(select("- Yes:- No") == 2) goto R_Bye;
mes .@n$;
mes "I will now list the ranking in your Chat Box.";
close2;
dispbottom "======= "+.@rankn$+" ===========";
dispbottom "Player Name:	"+.@rankt$;
query_sql "SELECT `char_id` , `"+.@listr+"` FROM `arena_master` WHERE `"+.@listr+"` > 0 ORDER BY `"+.@listr+"` ASC LIMIT "+.@limit,.@ch_id,.@sh_r;
if(!.@sh_r) {
dispbottom "No Player found.";
end;
}
for( set .@r,0; .@r < getarraysize(.@sh_r); set .@r,.@r + 1) {
query_sql "SELECT `name` FROM `char` WHERE `char_id` = '"+.@ch_id[.@r]+"'",.@ch_na$;
dispbottom .@ch_na$+":	"+.@sh_r[.@r];
}
end;

R_Bye:
mes .@n$;
mes "Okay, see ya.";
close;

}
-	script	PvPGvGMain	-1,{
end;

OnInit:
if($@debug) announce "====== Arena Master - Debug initiate... ========",bc_self;
// ============ GvG Settings ============//
setarray $@gvgr$[0],"guild_vs1","guild_vs2","guild_vs3","guild_vs4","guild_vs5";
if($@debug) announce "Guild Maps loaded: "+$@gvgr$[0],bc_self;
// If you want to add more mapflags, add them before the "10" > mf_gvg_noparty
setarray $@gvg_mf[0],0,1,/*2,*/3,4,5,9,11,13,15,22,33,34,35,38,41,44,10;
if($@debug) announce "Guild Mapflags loaded: "+getarraysize($@gvg_mf),bc_self;
setarray $@gvg_gld1_x1[0],9,9,12,8,18;
setarray $@gvg_gld1_y1[0],50,50,51,49,50;
setarray $@gvg_gld1_x2[0],50,50,50,50,49;
setarray $@gvg_gld1_y2[0],7,7,13,8,23;
setarray $@gvg_gld2_x1[0],50,50,49,50,49;
setarray $@gvg_gld2_y1[0],91,91,86,91,76;
setarray $@gvg_gld2_x2[0],92,92,86,91,79;
setarray $@gvg_gld2_y2[0],50,50,51,49,49;
if($@debug) announce "Guild 1 Map Coordinates 1 loaded: X - "+getarraysize($@gvg_gld1_x1) +" & Y - "+getarraysize($@gvg_gld1_y1),bc_self;
if($@debug) announce "Guild 1 Map Coordinates 2 loaded: X - "+getarraysize($@gvg_gld1_x2) +" & Y - "+getarraysize($@gvg_gld1_y2),bc_self;
if($@debug) announce "Guild 2 Map Coordinates 1 loaded: X - "+getarraysize($@gvg_gld2_x1) +" & Y - "+getarraysize($@gvg_gld2_y1),bc_self;
if($@debug) announce "Guild 2 Map Coordinates 2 loaded: X - "+getarraysize($@gvg_gld2_x2) +" & Y - "+getarraysize($@gvg_gld2_y2),bc_self;
set $@same_gld,1; // Have to be same guild to be able to join?
if($@debug) announce "Same Guild Requirement loaded: "+$@same_gld,bc_self;
set $@mpgld,20; //Max Guild Members per Guild
if($@debug) announce "Max Members per Guild loaded: "+$@mpgld,bc_self;
set $@mgvg,$@mpgld*2; // Total Members per Arena.
if($@debug) announce "Max Members per Arena loaded: "+$@mgvg,bc_self;
// ======= Auto Mapflag Adding ===============//
for ( set .@m,0; .@m < getarraysize($@gvgr$); set .@m,.@m + 1 ) {
if($@debug) announce "Array Reading of GvG Maps complete",bc_self;
if($@debug) announce "Mapflag set at "+$@gvgr$[.@m] + " initiate...",bc_self;

// Use this if you disallows parties
//	for ( set .@mf,0; .@mf < getarraysize($@gvg_mf); set .@mf,.@mf + 1 ) {

// Use this if you allow parties
for ( set .@mf,0; .@mf < (getarraysize($@gvg_mf) - 1); set .@mf,.@mf + 1 )	{
	/*
	if($@gvg_mf[.@mf] == 2) {
	if($@debug) announce "Mapflag 2 (mf_nosave) initiate...",bc_self;
		if(getmapflag($@gvgr$[.@m],mf_nosave) == 0) setmapflagnosave $@gvgr$[.@m],"prontera",156,191;
		if($@debug) announce "Mapflag 2 (mf_nosave) completed...",bc_self;
		continue;
	} else
	*/
	if(getmapflag($@gvgr$[.@m],$@gvg_mf[.@mf]) == 0) setmapflag $@gvgr$[.@m],$@gvg_mf[.@mf];
	if($@debug) announce "Mapflag "+ $@gvg_mf[.@mf] +" set at "+$@gvgr$[.@m] + " complete",bc_self;
}
}
if($@debug) announce "Guild Mapflag loading completed",bc_self;
// ============ PvP Settings ============//
// If you want to add more mapflags, add them before the "7" > mf_pvp_noparty
setarray $@pvp_mf[0],0,1,2,3,4,5,7,11,13,22,33,34,35,38,41,44,7;
if($@debug) announce "PvP Mapflags loaded: "+getarraysize($@pvp_mf),bc_self;
set $@mpvp,50; // Max Player each Arena.
setarray $@sphree$[0],"Killing Sphree","Dominating","Mega Kill","Ridiculous","Unstoppable","Holy Shit","Horrendous","GodLike";
if($@debug) announce "PvP Sphree Names loaded: "+$@sphree$[0],bc_self;
// Map Order: Prontera, Alberta, Izlude, Payon, Morroc
setarray $@room$[0],"Prontera","Alberta","Izlude","Payon","Morroc";
if($@debug) announce "PvP Town Maps loaded: "+$@room$[0],bc_self;

// Dispell PvP
setarray $@disppvp$[0],"pvp_y_1-1","pvp_y_1-4","pvp_y_1-2","pvp_y_1-3","pvp_y_1-5";
if($@debug) announce "PvP Dispell Maps loaded: "+$@disppvp$[0],bc_self;
// ======= Auto Mapflag Adding - Dispell PvP ===============//
for ( set .@m,0; .@m < getarraysize($@disppvp$); set .@m,.@m + 1 )

// Use this if you disallows parties
//	for ( set .@mf,0; .@mf < getarraysize($@pvp_mf); set .@mf,.@mf + 1 )

// Use this if you allow parties
for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 )
	if(getmapflag($@disppvp$[.@m],$@pvp_mf[.@mf]) == 0) setmapflag $@disppvp$[.@m],$@pvp_mf[.@mf];
if($@debug) announce "PvP Dispell Mapflags loaded.",bc_self;		
// Normal PvP
setarray $@npvp$[0],"pvp_y_2-1","pvp_y_2-4","pvp_y_2-2","pvp_y_2-3","pvp_y_2-5";
if($@debug) announce "PvP Normal Maps loaded: "+$@npvp$[0],bc_self;
// ======= Auto Mapflag Adding  - Normal PvP ===============//
for ( set .@m,0; .@m < getarraysize($@npvp$); set .@m,.@m + 1 )

// Use this if you disallows parties
//	for ( set .@mf,0; .@mf < getarraysize($@pvp_mf); set .@mf,.@mf + 1 )

// Use this if you allow parties
for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 )
	if(getmapflag($@npvp$[.@m],$@pvp_mf[.@mf]) == 0) setmapflag $@npvp$[.@m],$@pvp_mf[.@mf];
if($@debug) announce "PvP Normal Mapflags loaded.",bc_self;			
// ================== Deathmatch Settings + Maps ================
setarray $@dmpvp$[0],"pvp_y_3-1","pvp_y_3-4","pvp_y_3-2","pvp_y_3-3","pvp_y_3-5";
if($@debug) announce "PvP DM Maps loaded: "+$@dmpvp$[0],bc_self;
// ======= Auto Mapflag Adding  - DM PvP ===============//
for ( set .@m,0; .@m < getarraysize($@dmpvp$); set .@m,.@m + 1 )

// Use this if you disallows parties
//	for ( set .@mf,0; .@mf < getarraysize($@pvp_mf); set .@mf,.@mf + 1 )

// Use this if you allow parties
for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 )
	if(getmapflag($@dmpvp$[.@m],$@pvp_mf[.@mf]) == 0) setmapflag $@dmpvp$[.@m],$@pvp_mf[.@mf];
if($@debug) announce "PvP DM Mapflags loaded.",bc_self;		
set $@killstart,5; // Kills required for Killing Sphree Start
if($@debug) announce "Kill Requiremnt for Killing Sphree Start loaded.",bc_self;
// ================= Party PvP Settings =================
// ========= 2vs2 Party PvP ==========//
setarray $@pt2pvp$[0],"pvp_y_4-1","pvp_y_4-4","pvp_y_4-2","pvp_y_4-3","pvp_y_4-5";
if($@debug) announce "Party PvP 2vs2 Maps loaded: "+$@pt2pvp$[0],bc_self;
// 3vs3 Party PvP
setarray $@pt3pvp$[0],"pvp_y_5-1","pvp_y_5-4","pvp_y_5-2","pvp_y_5-3","pvp_y_5-5";
if($@debug) announce "Party PvP 3vs3 Maps loaded: "+$@pt3pvp$[0],bc_self;
// 4vs4 Party PvP
setarray $@pt4pvp$[0],"pvp_y_6-1","pvp_y_6-4","pvp_y_6-2","pvp_y_6-3","pvp_y_6-5";
if($@debug) announce "Party PvP 4vs4 Maps loaded: "+$@pt4pvp$[0],bc_self;
// 5vs5 Party PvP
setarray $@pt5pvp$[0],"pvp_y_7-1","pvp_y_7-4","pvp_y_7-2","pvp_y_7-3","pvp_y_7-5";
if($@debug) announce "Party PvP 5vs5 Maps loaded: "+$@pt5pvp$[0],bc_self;
// ======= Auto Mapflag Adding ===============//
for ( set .@m,0; .@m < getarraysize($@pt2pvp$); set .@m,.@m + 1 )
for ( set .@mf,0; .@mf < (getarraysize($@pvp_mf) - 1); set .@mf,.@mf + 1 ) {
	if(getmapflag($@pt2pvp$[.@m],$@pvp_mf[.@mf]) == 0) setmapflag $@pt2pvp$[.@m],$@pvp_mf[.@mf];
	if(getmapflag($@pt3pvp$[.@m],$@pvp_mf[.@mf]) == 0) setmapflag $@pt3pvp$[.@m],$@pvp_mf[.@mf];
	if(getmapflag($@pt4pvp$[.@m],$@pvp_mf[.@mf]) == 0) setmapflag $@pt4pvp$[.@m],$@pvp_mf[.@mf];
	if(getmapflag($@pt5pvp$[.@m],$@pvp_mf[.@mf]) == 0) setmapflag $@pt5pvp$[.@m],$@pvp_mf[.@mf];
}
if($@debug) announce "Party PvP Mapflags loaded.",bc_self;
function writeStats;
if($@debug) announce "Write Stats Function loaded.",bc_self;
end;

OnPCKillEvent:
if(compare(strcharinfo(3),"pvp_y_") == 0 || compare(strcharinfo(3),"guild_vs") == 0) end;
if(getmapflag(strcharinfo(3),mf_pvp) == 0 || getmapflag(strcharinfo(3),mf_gvg) == 0) end;
set .@k,getcharid(3);
set .@v,killedrid;
mapannounce strcharinfo(3),strcharinfo(0) + " has killed "+rid2name(.@v)+".",0;
set @killct,@killct + 1;
if(@killct >= $@killstart) {
if(@killct < 10) {
	set @sphr,1;
	set @killer,@killer + 1;
} else if(@killct >= 10 && @killct < 15) {
	set @sphr,2;
	set @domi,@domi + 1;
} else if(@killct >= 15 && @killct < 20) {
	set @sphr,3;
	set @mega,@mega + 1;
} else if(@killct >= 20 && @killct < 25) {
	set @sphr,4;
	set @ridic,@ridic + 1;
} else if(@killct >= 25 && @killct < 30) {
	set @sphr,5;
	set @unstopp,@unstopp + 1;
} else if(@killct >= 30 && @killct < 50) {
	set @sphr,6;
	set @holys,@holys + 1;
} else if(@killct >= 50 && @killct < 80) {
	set @sphr,7;
	set @horren,@horren + 1;
} else if(@killct >= 80) {
	set @sphr,8;
	set @godlike,@godlike + 1;
}
mapannounce strcharinfo(3),strcharinfo(0) + " is now on "+ $@sphree$[@sphr]+"!!!!",0;
message strcharinfo(0),"You have killed "+@killct+" Player(s) so far.";
}
detachrid;

attachrid(.@v);
writeStats(getcharid(0),@killct);
set @killct,0;
if($@same_gld) {
if(getd("$@gvg_"+@gvgc+"_gld_1") == getcharid(2)) setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") - 1;
if(getd("$@gvg_"+@gvgc+"_gld_2") == getcharid(2)) setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") - 1;
}
for ( set @d,0; @d < getarraysize($@dmpvp$); set @d,@d + 1)
if(strcharinfo(3) == $@dmpvp$[@d]) {
	sleep2 1500;
	if(.@k != getcharid(3)) {
		warp strcharinfo(3),0,0;
		if(HP == 0) atcommand "@alive";
		percentheal 100,100;
	} else warp "SavePoint",0,0;
}
end;

OnPCLogOutEvent:
if(compare(strcharinfo(3),"pvp_y_") == 0 || compare(strcharinfo(3),"guild_vs") == 0) end;
if(getmapflag(strcharinfo(3),mf_pvp) == 0 || getmapflag(strcharinfo(3),mf_gvg) == 0) end;
writeStats(getcharid(0),@killct);
if($@same_gld) {
if(getd("$@gvg_"+@gvgc+"_gld_1") == getcharid(2)) setd("$@gvg_"+@gvgc+"_1_ppl"),getd("$@gvg_"+@gvgc+"_1_ppl") - 1;
if(getd("$@gvg_"+@gvgc+"_gld_2") == getcharid(2)) setd("$@gvg_"+@gvgc+"_2_ppl"),getd("$@gvg_"+@gvgc+"_2_ppl") - 1;
}
end;

OnNPCKillEvent:
if(compare(strcharinfo(3),"pvp_n_") == 0) end;
if(query_sql("SELECT `char_id` FROM `arena_master` WHERE `char_id` = '"+@c+"'",@charid) != 0)
query_sql "UPDATE `arena_master` SET `mvp` = `mvp` + 1  WHERE `char_id` = '"+@c+"'";
else query_sql "INSERT INTO `arena_master` ( `char_id` , `mvp`) VALUES ( '"+@c+"' , '1' )";
end;

function	writeStats	{
set @c,getarg(0);
set @k,getarg(1);

if(query_sql("SELECT `char_id` FROM `arena_master` WHERE `char_id` = '"+@c+"'",@charid) != 0) {
	if(@k > query_sql("SELECT `hscore` FROM `arena_master` WHERE `char_id` = '"+@c+"'",@hscore)) set @hscore,@k;
	query_sql "UPDATE `arena_master` SET `kills` = `kills` + "+@k+", `death` = `death` + 1 , `hscore` = '"+@hscore+"' , `killer` = `killer` + "+@killer+" , `domi` = `domi` + "+@domi+" , `mega` = `mega` + "+@mega+" , `ridic` = `ridic` + "+@ridic+" , `unstopp` = `unstopp` + "+@unstopp+" , `holys` = `holys` + "+@holys+" , `horren` = `horren` + "+@horren+" , `godlike` = `godlike` + "+@godlike+"  WHERE `char_id` = '"+@c+"'";
} else query_sql "INSERT INTO `arena_master` ( `char_id` , `kills` , `death` , `hscore` , `killer` , `domi` , `mega` , `ridic` , `unstopp` , `holys` , `horren` , `godlike` , `mvp`) VALUES ( '"+@c+"' , '"+@k+"' , '1' , '"+@hscore+"' , '"+@killer+"' , '"+@domi+"' , '"+@mega+"' , '"+@ridic+"' , '"+@unstopp+"' , '"+@holys+"' , '"+@horren+"' , '"+@godlike+"' , '0' )";
return;
}

OnWhisperGlobal:
set .@re_in,0;
set $@debug,0;
if(select("- ReLoad:- Nevermind") == 2) end;
if(select("- Debug: Without Debug") == 1) set $@debug,1;
set .@re_in,1;
goto OnInit;
end;	
}

Another question, see 'R_Rank:' :

I saw you can insert table names like this too:

query_sql "SELECT `char_id` , `"+.@listr+"` FROM `arena_master` WHERE `"+.@listr+"` > 0 ORDER BY `"+.@listr+"` ASC LIMIT "+.@limit,.@ch_id,.@sh_r;

Couldn't test it yet though :I.

Wanna fix my mf_ errors first :I.

Thanks Kenpachi for in advance :).

Regards,

Chris

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  106
  • Reputation:   28
  • Joined:  11/08/11
  • Last Seen:  

getmapflag does not return any value for MF_NOSAVE, MF_NOEXPPENALTY and maybe some other map flags. Therefore the server says you tried to use invalid data.

Edited by Toshiro
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

And why is that o.o?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  106
  • Reputation:   28
  • Joined:  11/08/11
  • Last Seen:  

And why is that o.o?

Don't know. Probably someone just forgot to add it when adding the command and/or mapflags. Anyways, submitted a bug report about this matter. [bug]5097[/bug]

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Well, it could also be a bug in the eAthena version I'm using for my test server, 14424 SQL Trunk was it.

I deleted the whole if(getmapflag part, but just in case...

Would an error show up when he tries to readd an mapflag to the same map again?

I didn't try it yet,so I'm asking first to prevent another "brain burner" :). Would have an different solution too though.

Regards,

Chris

Edit: Can be closed, solved it by deleting the "getmapflag" commands >_>, my server doesn't show any error so it should be fine.

Edited by llchrisll
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  764
  • Reputation:   220
  • Joined:  11/14/11
  • Last Seen:  

Well, removing parts of a script because the emulator is "broken" doesn't make sense.

Here is a patch that allows you to check, set or remove every mapflag that's listed in the mapflag enumeration in script.c.RAthena-mapflags_15008_trunk.patch

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