quest::pvp / SetPVP() on EVENT_ENTERZONE broken
I've tried this with both PvP disabled/enabled by default and it seems to have the same problem. It works fine if it's triggered a few seconds later after the ENTERZONE event but otherwise it gets overwritten.
Example:
ENTERZONE, SetPVP(0): name turns blue and message "no longer following the ways of discord"
1 second elapses, name turns red again
sub EVENT_ENTERZONE {
if($zonesn =~ /^freportw$/) {
$client->SetPVP(0);
$client->Message(15, "You've entered a safe zone, PvP is disabled");
}
else {
quest::pvp("on");
$client->Message(15, "You've entered a PvP zone, PvP is ENABLED!!!!");
}
}
If I set a timer for a few seconds after the event and turn pvp off again it will stick. I've tried to find somewhere else in the code where it resets it but can't find it. I think it might be related to SendAppearancePacket() updating the whole zone when you zone it but it's using the old data from the zone you just came from rather than the new m_pp.pvp flag.
|