PDA

View Full Version : NPC Armor Color Plugin.


Kingly_Krab
12-29-2014, 03:15 AM
Just something cool I wrote that some people might like, it allows you to set an NPC's armor color based on RGB, currently it sets all pieces at once, but it could be changed to set eat piece individually, example script after plugin. The following code should be placed in a .pl file in your plugins folder. Example: mob_color.pl
sub SetMobColor {
plugin::val('npc')->WearChange($_, plugin::val('npc')->GetTexture(), plugin::MobColor($_[0], $_[1], $_[2])) for (0..6);
}

sub MobColor {
my $color = 0;
$color += (((256 ** 2) * $_[0]) + (256 * $_[1]) + $_[2]);
return $color;
}

return 1;

Here is the example code.
sub EVENT_SPAWN {
plugin::SetMobColor(quest::ChooseRandom(0..255), quest::ChooseRandom(0..255), quest::ChooseRandom(0..255));
}

Here's a picture of what this looks like. http://i.imgur.com/pbR1KCX.jpg

Bandor
12-29-2014, 08:58 AM
awesome code bro