I was talking to a few people that play on my server and they liked the idea of having custom effects for wearing sets of gear. So I made it. This is just for the first tier of custom armor on my server. I will add to it for other tiers as well. I am sure there are better ways to do it, but this works.
Code:
sub EVENT_SAY {
my $headid = $client->GetItemIDAt(2);
my $chestid = $client->GetItemIDAt(17);
my $legid = $client->GetItemIDAt(18);
my $feetid = $client->GetItemIDAt(19);
my $gloveid = $client->GetItemIDAt(12);
my $armid = $client->GetItemIDAt(7);
my @headpieces = (147587,147580,147573,147566);
my @chestpieces = (147588,147581,147574,147567);
my @legpieces = (147591,147584,147577,147570);
my @feetpieces = (147592,147585,147573,147566);
my @glovepieces = (147593,147586,147579,147572);
my @armpieces = (147590,147583,147576,147569);
if ($text=~/Armor Effects/i) {
$client->Message(12,"This will apply the effects you have obtained from your currently equipped tier armor pieces.");
$client->Message(12,"Helmet, Arms, and Legs make up the 3 piece set.");
$client->Message(12,"Helmet, Arms, Legs, Gloves, Boots, and BP make up the 6 piece set.");
$client->Message(12,"------------------------------------------------------");
$client->Message(12,"" . quest::saylink("armor sets",1) . "");
$client->Message(12,"------------------------------------------------------");
$client->Message(12,"" . quest::saylink("stop effects",1) . "");
$client->Message(12,"------------------------------------------------------");
}
if ($text=~/armor sets/i) {
if ($headid ~~ @headpieces && $armid ~~ @armpieces && $legid ~~ @legpieces) {
$client->Message(12,"------------------------------------------------------");
$client->Message(12,"" . quest::saylink("3 piece set",1) .".");
$client->Message(12,"------------------------------------------------------");
}
if ($headid ~~ @headpieces && $armid ~~ @armpieces && $legid ~~ @legpieces
&& $gloveid ~~ @glovepieces && $feetid ~~@feetpieces && $chestid ~~ @chestpieces) {
$client->Message(12,"" . quest::saylink("6 piece set",1) .".");
$client->Message(12,"------------------------------------------------------");
}
}
if ($text=~/3 piece set/i && $headid ~~ @headpieces && $armid ~~ @armpieces && $legid ~~ @legpieces) {
$client->Message(14,"Starting 3 piece set Effect.");
$client->SpellEffect(369, 30, 0, 1, 3000, 0);
}
if ($text=~/6 piece set/i && $headid ~~ @headpieces && $armid ~~ @armpieces && $legid ~~ @legpieces
&& $gloveid ~~ @glovepieces && $feetid ~~@feetpieces && $chestid ~~ @chestpieces) {
$client->Message(14,"Starting 6 piece set Effect.");
$client->SpellEffect(447, 30, 0, 1, 3000, 0);
}
if ($text=~/stop effects/i) {
$client->Message(13,"Stopping Effect.");
$client->RemoveNimbusEffect(447);
$client->RemoveNimbusEffect(369);
}
}
Here is an image.
https://imgur.com/aMFx8CD