Basically, I have some guards I'm messing with.
When they spawn I have them randomly set to choose between different textures (different guards from different zones.. Qeynos, Freeport, Kelethin, etc..)
The issue I'm having right now is that Qeynos guards are race 71, but texture 1.. so I'm trying to make it so that when they spawn my script checks to see if it is race 71, and if it is race 71 it will change the texture to 1.
What I have right now isn't working, and when I added a say event to see what the race was returning as I get nothing, can someone please tell me what I'm doing wrong?
Code:
sub EVENT_SPAWN {
my $random_race = quest::ChooseRandom(71,44);
my $random_weapon = quest::ChooseRandom(1,2,3,7,8,14);
quest::npcrace($random_race);
quest::wearchange(7, $random_weapon);
quest::wearchange(2, 1);
quest::settimer("qeynosguardchange", 1);
}
sub EVENT_TIMER {
my $race = $mob->GetRace();
if($timer eq "qeynosguardchange" && $race == 71) {
quest::shout2("qeynos change yo");
quest::npctexture(1);
quest::stoptimer("qeynosguardchange");
}
}
sub EVENT_SAY {
if ($text =~/hail/i)
{
my $race = $mob->GetRace();
quest::say("$race");
}
}