Okay, I have an expansion of this idea now that my mind's eye wandered across when in another thread.
new event handlers:
onPlayerEntersMyShape
onPlayerLeavesMyShape
These would offer extraordinary functionality.
First things first. It would solve the hit detection problem on Classic simply with onPlayerEntersMyShape().
However, that is not where it ends.
Say you have a sparring arena inside of a level. You want weapons to be disabled outside of the sparring area but not inside of the sparring area.
So... You could place an NPC over the entire sparring area and define it as such:
PHP Code:
onPlayerEntersMyShape() {
this.myPlayers.add(player.account);
enableweapons();
focusArena();
if (myPlayers.size() == 2) {
closedoors();
matchHPperSword();
} else if (myPlayers.size() > 2) {
kickoutofarena(player);
}
}
onPlayerLeavesMyShape() {
this.myPlayers.remove(player.account);
disableweapons();
//anything else taken away
}
In essence it would be like having onPlayerEnters and onPlayerLeaves but on a scale that isn't the level (would be simply awesome for dealing with a GMAP). Treating it like such, it would make sense that if the player were on the NPC's shape and left the level, that onPlayerLeavesMyShape be called on that NPC, and then on the level's level onPlayerLeaves would be called.