EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Custom (https://www.eqemulator.org/forums/forumdisplay.php?f=671)
-   -   NPC Armor Color Plugin. (https://www.eqemulator.org/forums/showthread.php?t=39154)

Kingly_Krab 12-29-2014 03:15 AM

NPC Armor Color Plugin.
 
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
Code:

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.
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


All times are GMT -4. The time now is 12:32 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.