View Single Post
  #2  
Old 11-30-2011, 11:38 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

You would have to use the SendIllusion() quest object to do that. Here is a plugin I made a while back that makes use of that command and other things:

Code:
#Usage: plugin::CloneAppearance(MobA, MobB, CloneName=false);
# Clones the looks of a mob
# MobA is the target mob to clone from
# MonB is the mob that is changing to clone MobA
# CloneName is an optional field that if set to 1 will clone the name of the target as well

sub CloneAppearance {
	my $MobA = $_[0];
	my $MobB = $_[1];
	my $CloneName = $_[2];
	
	my $Race = $MobA->GetRace();
	my $Gender = $MobA->GetGender();
	my $Texture = $MobA->GetTexture();
	my $HelmTexture = $MobA->GetHelmTexture();
	my $Face = $MobA->GetLuclinFace();
	my $HairStyle = $MobA->GetHairStyle();
	my $HairColor = $MobA->GetHairColor();
	my $Beard = $MobA->GetBeard();
	my $BeardColor = $MobA->GetBeardColor();
	my $DrakkinHeritage = $MobA->GetDrakkinHeritage();
	my $DrakkinTattoo = $MobA->GetDrakkinTattoo();
	my $DrakkinDetails = $MobA->GetDrakkinDetails();
	my $Size = $MobA->GetSize();
	
	if (!$Size)
	{
		%RaceSizes = (
			1 => 6, # Human
			2 => 8, # Barbarian
			3 => 6, # Erudite
			4 => 5, # Wood Elf
			5 => 5, # High Elf
			6 => 5, # Dark Elf
			7 => 5, # Half Elf
			8 => 4, # Dwarf
			9 => 9, # Troll
			10 => 9, # Ogre
			11 => 3, # Halfling
			12 => 3, # Gnome
			128 => 6, # Iksar
			130 => 6, # Vah Shir
			330 => 5, # Froglok
			522 => 6, # Drakkin
		);
		
		$Size = $RaceSizes{$Race};
	}
	
	if (!$Size)
	{
		$Size = 6;
	}

	if (($MobB->IsClient() == 1) && ($Size > 15))
	{
		$Size = 15;
	}
	
	$MobB->SendIllusion($Race, $Gender, $Texture, $HelmTexture, $Face, $HairStyle, $HairColor, $Beard, $BeardColor, $DrakkinHeritage, $DrakkinTattoo, $DrakkinDetails, $Size);
	
	for ($slot = 0; $slot < 7; $slot++)
	{
		my $Color = 0;
		my $Material = 0;
		if ($MobA->IsClient() || $slot > 6)
		{
			$Color = $MobA->GetEquipmentColor($slot);
			$Material = $MobA->GetEquipmentMaterial($slot);
		}
		else
		{
			$Color = $MobA->GetArmorTint($slot);
			if ($slot == 0)
			{
				$Material = $MobA->GetHelmTexture();
			}
			else
			{
				$Material = $MobA->GetTexture();
			}
		}
		$MobB->WearChange($slot, $Material, $Color);
	}
	
	$PrimaryModel = $MobA->GetEquipmentMaterial(7);
	$SecondaryModel = $MobA->GetEquipmentMaterial(8);
	
	# NPCs can set animations and attack messages, but clients only set the model change
	if ($MobB->IsNPC())
	{
		plugin::SetWeapons($PrimaryModel, $SecondaryModel, 1);
	}
	else
	{
		$MobB->WearChange(7, $PrimaryModel, 0);
		$MobB->WearChange(8, $SecondaryModel, 0);
	}
	
	if ($CloneName)
	{
		my $CloneName = $MobA->GetCleanName();
		$MobB->TempName($CloneName);
	}
	
	
}
Though, this will only send an illusion, which means it will go back to the previous face settings when they zone. There isn't anything to make the changes permanent yet. Though, the problem is a pretty small one considering all clients can just use the Face button in their inventory window to set a new face at any time themselves.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote