Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #############################################
- # This plugin is licensed under the GNU GPL #
- # Copyright 2005 original plugin by iseo #
- # Adapted by Alison and KeplerBR #
- #############################################
- package playerRecord;
- use strict;
- use warnings;
- use Plugins;
- use Globals;
- use Utils qw(binAdd existsInList getFormattedDate swrite getHex);
- # Register Plugin and Hooks
- Plugins::register("PlayerRecord", "playerRecord", \&on_unload);
- my $hooks = Plugins::addHooks(
- ['charNameUpdate', \&write_player], # Escrever os dados gerais
- );
- #On Unload code
- sub on_unload {
- Plugins::delHooks($hooks);
- }
- ################################
- # Write general data of player #
- sub write_player {
- my $hookname = shift;
- my $args = shift;
- # Account and Char Information
- my $targetAccountId = $args->{player}{nameID};
- #my $targetId = $args->{player}{nameID};
- # Name and Sex Information
- my $targetName = $args->{player}{name};
- my $targetSex = $args->{player}{sex};
- # Hair and Cloth Information
- my $targetHairColor = $args->{player}{hair_color};
- my $targetHairStyle = $args->{player}{hair_style};
- my $targetclothColor = $args->{player}{clothes_color};
- # Job Information
- my $targetJob = $jobs_lut{$args->{player}{jobID}};
- # Lvl Information
- my $targetLvl = $args->{player}{lv};
- # Party Information
- my $targetPartyName = $args->{player}{party}{name};
- # Guild Information
- my ($targetGuildId, $targetGuildEmblemId, $targetGuildName, $targetGuildPosition);
- $targetGuildId = unpack("v1", $args->{player}{guildID}) if ($args->{player}{guildID});
- $targetGuildEmblemId = unpack("v1", $args->{player}{emblemID}) if ($args->{player}{emblemID});
- $targetGuildName = $args->{player}{guild}{name} if ($args->{player}{guild}{name});
- $targetGuildPosition = $args->{player}{guild}{title} if ($args->{player}{guild}{title});
- # Equips Head Information
- my ($targetEquipHeadTop, $targetEquipHeadMid, $targetEquipHeadLow);
- $targetEquipHeadTop = $items_lut{$args->{player}{headgear}{top}} if ($args->{player}{headgear}{top});
- $targetEquipHeadMid = $items_lut{$args->{player}{headgear}{mid}} if ($args->{player}{headgear}{top});
- $targetEquipHeadLow = $items_lut{$args->{player}{headgear}{low}} if ($args->{player}{headgear}{low});
- # Equips Body Information
- my ($targetEquipBodyWeapon, $targetEquipBodyShield, $targetEquipBodyShoes);
- $targetEquipBodyWeapon = $items_lut{$args->{player}{weapon}} if ($args->{player}{weapon});
- $targetEquipBodyShield = $items_lut{$args->{player}{shield}} if ($args->{player}{shield});
- $targetEquipBodyShoes = $items_lut{$args->{player}{shoes}} if ($args->{player}{shoes});
- # Time Information
- my $targetTime = localtime time;
- # Validators
- if(not defined $targetclothColor) { $targetclothColor = 0; }
- if(not defined $targetEquipBodyShoes) { $targetEquipBodyShoes = 0; }
- if(not defined $targetPartyName or $targetPartyName eq "") { $targetPartyName = "NULL"; }
- if(not defined $targetGuildName or $targetGuildName eq "") { $targetGuildName = "NULL"; }
- if(not defined $targetGuildPosition or $targetGuildPosition eq "" ) { $targetGuildPosition = "NULL"; }
- # Preparar mensagem
- my ($mensagemTemEquips, $equipsHead, $equipsHand);
- my $mensagemGuild = '';
- if (($targetEquipHeadTop || $targetEquipHeadMid || $targetEquipHeadLow) && ($targetEquipBodyWeapon || $targetEquipBodyShield)) {
- $mensagemTemEquips = 'Os nomes dos equipamentos na cabeça e nas mãos são:';
- } elsif ($targetEquipBodyWeapon || $targetEquipBodyShield) {
- $mensagemTemEquips = 'Tem nada na cabeça, mas nas mãos tem:';
- } elsif ($targetEquipHeadTop || $targetEquipHeadMid || $targetEquipHeadLow) {
- $mensagemTemEquips = 'Tem nada nas mãos, mas na cabeça tem:';
- } else {
- $mensagemTemEquips = 'Esta usando nada na cabeça e mãos.';
- }
- $equipsHead .= "Topo da cabeça: $targetEquipHeadTop |" if ($targetEquipHeadTop);
- $equipsHead .= " Meio da cabeça: $targetEquipHeadMid |" if ($targetEquipHeadMid);
- $equipsHead .= " Parte de baixo da cabeça: $targetEquipHeadLow" if ($targetEquipHeadLow);
- $equipsHand .= "Arma: $targetEquipBodyWeapon |" if ($targetEquipBodyWeapon);
- $equipsHand .= " Escudo: $targetEquipBodyShield" if ($targetEquipBodyShield);
- $mensagemGuild = " Seu clã, $targetGuildName, tem o ID $targetGuildId." if ($targetGuildId);
- # Enviar
- Commands::run("c ------------------/--- $targetName ----\\\------------------");
- Commands::run("c Seu job é $targetJob, e esta no level $targetLvl!");
- Commands::run("c $mensagemGuild") if ($mensagemGuild);
- Commands::run("c ID é $targetAccountId. $mensagemTemEquips");
- Commands::run("c $equipsHead") if ($equipsHead);
- Commands::run("c $equipsHand") if ($equipsHand);
- }
- 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement