Thanks to the help I got yesterday, I progressed this well!.
I just need some help with this problem,
I want Cobra to NOT taunt if the players faction is below 6 with him..I've tried putting the if ($faction <= 6) { line in various places within the script,
but STILL he begins the taunts???
Any help would be greatly appreciated!!..
sub EVENT_SPAWN
{
my $x;
my $y;
my $z;
my $h;
my $timerinterval=int(rand(10)+1);
$x = $npc->GetX();
$y = $npc->GetY();
$z = $npc->GetZ();
$h = $npc->GetHeading();
quest::settimer("tmr",$timerinterval);
quest::shout("timer set to: $timerinterval");
quest::set_proximity( $x-280,$x+280,$y-280,$y+280,$z-280,$z+280);
}
sub EVENT_ENTER
{
$npc->SetFollowID($client->GetID());
if ($faction <= 6) {
quest::shout2("Be Ready, $name. I'm going to hunt you down... make you pay. There is a bounty on your head.");
}
else {
quest::shout2("$name, I ain't looking fer you today... move along.");
quest::sfollow;
}
}
# When Cobra Is offered 200pp he shows mercy
sub EVENT_ITEM
{
}
# When the timer Is up Cobra says random things about the target
sub EVENT_TIMER
{
if ($faction <= 6) {
my $say1 = "My clients are paying good money to have you dead, $name";
my $say2 = "Is that the best you can do, $class???";
my $say3 = "Go ahead, RUN... make my Day.";
my $say4 = "DIE FOR ME";
my $say5 = "When you die, I am going to take your head back to my clients.";
my $say6 = "A poor excuse for a $class.. ";
my $say7 = "I have slain greater than you, $class.. you are just one more to me";
my $say8 = "For 100pp, I might just let you go";
my $say9 = "This will teach others not to fool with MY clients";
my $say10 = "RUN, $class, like the scum you are!";
my $say11 = "Drop your weapon, and I'll make it quick for you";
my $say12 = "For 200pp I could perhaps just maim you";
if ($timer eq "tmr")
{
quest::stoptimer("tmr");
$talk=int(rand(12)+1);
if ($talk eq 1) { quest::say("$say1"); }
if ($talk eq 2) { quest::say("$say2"); }
if ($talk eq 3) { quest::say("$say3"); }
if ($talk eq 4) { quest::say("$say4"); }
if ($talk eq 5) { quest::say("$say5"); }
if ($talk eq 6) { quest::say("$say6"); }
if ($talk eq 7) { quest::say("$say7"); }
if ($talk eq
{ quest::say("$say8"); }
if ($talk eq 9) { quest::say("$say9"); }
if ($talk eq 10) { quest::say("$say10"); }
if ($talk eq 11) { quest::say("$say11"); }
if ($talk eq 12) { quest::say("$say11"); }
else {
my $timerinterval=int(rand(40)+10); #10-50 sec
quest::settimer("tmr",$timerinterval);
quest::say("timer set to: $timerinterval");
quest::say("$name Faction is: $faction");
}
}
}
sub EVENT_SAY
{
if ($text=~/Hail/i)
{ quest::say("My Name is Cobra, remember that, $name, and think twice before upsetting My [patrons]!");}
if ($text=~/patrons/i)
{ quest::say("Lord Elgnub of Blackburrow is a personal friend. I would take any attacks on their people as a personal offence");}
if ($text=~/hammer/i)
{ quest::say("I just want a chat you know like the old time - listen to your stories of danger and adventure");}
}
}