PDA

View Full Version : Remove mounts when zoning


N0ctrnl
01-15-2018, 05:10 AM
This is to kick players off their mounts when zoning to indoor zones. As is, they can stay on them but not re-summon when in an zone that forbids them.

In quests/global/global_player.pl


sub EVENT_ENTERZONE {
foreach my $zone_in (18, 31, 32, 36, 39, 40 .. 42, 44, 64 .. 66){
if($zoneid == $zone_in){
$client->BuffFadeByEffect(113);
}
}
}


There are probably more elegant ways to do it, but this keeps from having to call it out in each player.pl for the affected zones.

N0ctrnl
01-15-2018, 05:40 AM
And thanks to Akkadius for a much smarter way! This method pulls the 'cancastoutdoor' field from the zone table and removes the mount buff when you enter a zone that disallows outdoor spells.

This will use the MySQL plugins (be sure to get the new one and read about the new JSON loader http://www.eqemulator.org/forums/showthread.php?t=41690)


sub EVENT_ENTERZONE {
#::: Dismount on indoor zone
$ex = plugin::LoadMysql()->prepare("SELECT `castoutdoor` from `zone` WHERE `zoneidnumber` = ? AND `castoutdoor` = 0");
$ex->execute($zoneid);
while (@row = $ex->fetchrow_array()) {
quest::debug("[horse_mount] We have zoned into a indoor zone, dismounting...");
$client->BuffFadeByEffect(113);
}
}

demonstar55
01-15-2018, 02:56 PM
Not all zones on live strip mounts, even if you can't cast a mount in that zone.

N0ctrnl
01-15-2018, 03:06 PM
Then the first option - excluding those zones - would be the way to go. :)

jimrocken
02-22-2018, 04:23 PM
sub EVENT_ENTERZONE {
%ZoneDB = (
# ZoneID
253 => {"AllowMount" => "FALSE"}, #Nexus
287 => {"AllowMount" => "TRUE"}, #Plane of Knowledge
999 => {"AllowMount" => "FALSE"} #don't put any zones past this one.
);
if($ZoneDB{$id}{"AllowMount"} eq "FALSE") $client->BuffFadeByEffect(113);
}


bit more of a elegent way to do the first version