Quote:
|
Originally Posted by Projectshifter
I don't see the use of it being added in all seriousness. If you really want that functionality you could do it with a while() loop or so if you were so compelled using a combination of npc.x/y/width/height and player coords. Sadly the few times that I've used while() loops in conjunction with coord and keydown checks (with simple commands) seemed to make Graal unstable and often times crash. Sad day.
|
AS SERVERSIDE EVENTS.....
There would be no way to create that functionality serverside without crashing the NPC server.
If you don't see the use of it being added, it's your sad day.
Here's one scenario: say we have a sparring area within a level. You want to lock the sparring area when two players are in the arena and warp anyone else out.
What you would never be able to script as effectively without this event handler:
PHP Code:
function onCreated() {
setshape(1,widthofspar*16,heightofspar*16);
}
function onPlayerEntersMyShape() {
this.myPlayers.add(player); //keep of track of all players in area
//two players per spar
if (this.myPlayers.size() == 2) {
//to keep the spar civil
lockArena();
healPlayers();
initializeSpar();
} else if (this.myPlayers.size() > 2) {
//keep extra people from getting into the sparring area
kickFromSpar(player);
}
}
function onPlayerLeavesMyShape() {
this.myPlayers.remove(player); //keep track of players in area
if (this.myPlayers.size() < 2)
unlockArena();
}
They can be used in any similar script. The "playertouchsme" event handler would be similar to "PlayerEntersMyShape", but it wouldn't be the same functionality because the player doesn't have to be touching the NPC to touch it. In addition, a "PlayerLeavesMyShape" would help to more easily keep track of who's in the area. That would bring a lot of functionality upon itself. Sparring, guild wars, special areas on a gmap, nopk zones, pk-specific zones... It would be like having "playerenters" and "playerleaves" but on a sub-level scale that offers a huge amount of flexibility. It could also be used in damage systems (which I'm all ready to do).