follow only target map.
config.txt
partylockmap.plfollowParty <0|1>
followPartyTarget <name>
Code: Select all
#########################################################################
# This software is open source, licensed under the GNU General Public
# License, version 2.
# Basically, this means that you're allowed to modify and distribute
# this software. However, if you distribute modified versions, you MUST
# also distribute the source code.
# See http://www.gnu.org/licenses/gpl.html for the full license.
#########################################################################
# Party LockMap (fixed)
# d3fc0n 10/03/2008
#########################################################################
package partylockmap;
use strict;
use Plugins;
use Globals qw($accountID %config $char @partyUsersID);
use Log qw(message);
my $lockMap;
Plugins::register('partylockmap', 'Follow Party LockMap', \&on_unload);
my $hooks = Plugins::addHooks(
['AI_pre', \&ai_pre, undef]
);
sub on_unload {
Plugins::delHooks($hooks);
undef $lockMap;
}
sub ai_pre {
if ($char->{'party'} && $config{followParty}) {
for (my $i = 0; $i < @partyUsersID; $i++) {
next if ($partyUsersID[$i] eq "");
next if ($partyUsersID[$i] eq $accountID);
next if (!$char->{'party'}{'users'}{$partyUsersID[$i]}{'online'});
next if ($char->{'party'}{'users'}{$partyUsersID[$i]}{'name'} ne $config{followPartyTarget});
my ($lockMap) = $char->{'party'}{'users'}{$partyUsersID[$i]}{'map'} =~ /([\s\S]*)\.gat/;
if ($lockMap ne $config{lockMap}) {
message "[partylockmap] Changing lockMap to ". $lockMap. " (was ". $config{lockMap}. ").\n","system";
$config{lockMap} = $lockMap;
}
return;
}
}
}
return 1;