PK in a specific location x y

Center > 155,204

Lower Left > 160,199

Lower Right > 151,199

Upper Right > 151,208

Upper Left > 160,208

if there's something wrong with my spot.. i will change it ...

 
LoL, the center of the script is in 155,155 and it works in an 8x8 area from that center. You've got your problem here
default_tongue.png


NP, changing script to fit it:

Code:
prontera,155,204,0	script	killable	-1,5,5,{OnTouch:	if (!@killable) {		@killable = 1; // Variable for keeping track of the status		atcommand "@killable"; // Don't remember if it needed a parameter, I think it doesn't		addtimer 100, strnpcinfo(3)+"::OnKillable"; // Will check after a second	}	end;OnKillable:	getmapxy(.@map$, .@x, .@y, 0);	if ( (.@map$ != "prontera" || // Outside of the map	  .@x < (155 - 5) || .@x < (155 + 5) || // Out of the area of effect in X side	  .@y < (204 - 5) || .@y < (204 + 5) ) && // Out of the area of effect in Y side	  @killable) { 		@killable = 0;		atcommand "@killable"; // Don't remember if it needed a parameter, I think it doesn't	}	else addtimercount 1000, strnpcinfo(3)+"::OnKillable"; // Will check again after a second until player goes out of the square	end;}
 
Oh bummer, just spotted yet another (serious) fault on the script. I'm feeling useless now.

prontera,155,204,0 script killable -1,5,5,{OnTouch: if (!@killable) { @killable = 1; // Variable for keeping track of the status atcommand "@killable"; // Don't remember if it needed a parameter, I think it doesn't addtimer 100, strnpcinfo(3)+"::OnKillable"; // Will check after a second } end;OnKillable: getmapxy(.@map$, .@x, .@y, 0); if ( (.@map$ != "prontera" || // Outside of the map .@x < (155 - 5) || .@x > (155 + 5) || // Out of the area of effect in X side .@y < (204 - 5) || .@y > (204 + 5) ) && // Out of the area of effect in Y side @killable) { @killable = 0; atcommand "@killable"; // Don't remember if it needed a parameter, I think it doesn't } else addtimercount 1000, strnpcinfo(3)+"::OnKillable"; // Will check again after a second until player goes out of the square end;}

Mhmmm... Try?

(me crosses fingers)

P.S.: Not sure that diff patch will work since it's quite outdated right now, but would give it a try on a separate emulator folder so that you can get rid of it if it doesn't do its job right.

 
Last edited by a moderator:
Oh bummer, just spotted yet another (serious) fault on the script. I'm feeling useless now.

prontera,155,204,0 script killable -1,5,5,{OnTouch: if (!@killable) { @killable = 1; // Variable for keeping track of the status atcommand "@killable"; // Don't remember if it needed a parameter, I think it doesn't addtimer 100, strnpcinfo(3)+"::OnKillable"; // Will check after a second } end;OnKillable: getmapxy(.@map$, .@x, .@y, 0); if ( (.@map$ != "prontera" || // Outside of the map .@x < (155 - 5) || .@x > (155 + 5) || // Out of the area of effect in X side .@y < (204 - 5) || .@y > (204 + 5) ) && // Out of the area of effect in Y side @killable) { @killable = 0; atcommand "@killable"; // Don't remember if it needed a parameter, I think it doesn't } else addtimercount 1000, strnpcinfo(3)+"::OnKillable"; // Will check again after a second until player goes out of the square end;}

Mhmmm... Try?

(me crosses fingers)

P.S.: Not sure that diff patch will work since it's quite outdated right now, but would give it a try on a separate emulator folder so that you can get rid of it if it doesn't do its job right.
i got this sir... "YOU'RE NOT USELESS"... don't ever say that 
default_sad.png
 
default_sad.png
  im the one who is useless here LOL

2vv3qs7.jpg


EDIT: i change the location in a wide area and also the parameters inside the script...

 
Last edited by a moderator:
This time it isn't my fault but documentation's
default_tongue.png
 

conflicting line of code:

else addtimercount 1000, strnpcinfo(3)+"::OnKillable"; // Will check again after a second until player goes out of the square

What documentation says:

addtimercount <ticks>,"NPC::OnLabel";
What the code says:

BUILDIN(addtimercount){const char *event;int tick;TBL_PC* sd;event=script_getstr(st, 2);tick=script_getnum(st,3);sd = script->rid2sd(st);if( sd == NULL )return true;script->check_event(st, event);pc->addeventtimercount(sd,event,tick);return true;}
(If you can't read it, it just wants the event first, then the amount of ticks).

I'll report this as a bug just after I make this reply. Common sense is that the order in which the script command wants it will be reversed to match the other script command's. You can change it if you want it working now, but be wary it may change over time to match the other command.

Fixed line of code (at least until we do something regarding that):

Code:
else addtimercount strnpcinfo(3)+"::OnKillable",1000; // Will check again after a second until player goes out of the square
 
i think i have to wait for the update till they fix that bug or wait till someone make a source mod for cell_pvp ... hmm anyway thanks a lot for helping me sir jaBote more power to you and to the Hercules Team
default_smile.png
 
default_smile.png
 
default_smile.png


 
The bug has been fixed by myself.

I've also made a blog entry to give a shoutout to people since it's been there for more than 9 years and none of the staff has notice because of the precise lack of bugreports till I stumbled upon it. I apologize for that problem I couldn't expect.

Another fix for this mistake-filled script, try check if it has issues now
default_tongue.png
:

Code:
prontera,155,204,0	script	killable	-1,5,5,{OnTouch:	if (!@killable) {		@killable = 1; // Variable for keeping track of the status		atcommand "@killable"; // Don't remember if it needed a parameter, I think it doesn't		addtimer 1000, strnpcinfo(3)+"::OnKillable"; // Will check after a second	}	end;OnKillable:	getmapxy(.@map$, .@x, .@y, 0);	if ( (.@map$ != "prontera" || // Outside of the map	  .@x < (155 - 5) || .@x > (155 + 5) || // Out of the area of effect in X side	  .@y < (204 - 5) || .@y > (204 + 5) ) && // Out of the area of effect in Y side	  @killable) { 		@killable = 0;		atcommand "@killable"; // Don't remember if it needed a parameter, I think it doesn't	}	else addtimercount strnpcinfo(3)+"::OnKillable",1000; // Will check again after a second until player goes out of the square	end;}
 
still the same sir ... I don't know whats problem.. but I think "addtimer or addtimercount" is cause of the problem .. im not sure about this .. 

screenHercules004.jpg

screenHercules005.jpg

 
Why using timer here? May be simpler to use OnUnTouch event? it triggered if player move away from npc area.

 
Back
Top