View Single Post
  #3  
Old 02-12-2013, 04:56 PM
Zamthos
Discordant
 
Join Date: Jan 2013
Posts: 284
Default

No syntax error with this, haven't tested it in the game, but here you go:

Code:
sub EVENT_SPAWN {
my $Ench = ($npc->GetClass() == 'Enchanter');
my $Necro = ($npc->GetClass() == 'Necromancer');

if ($npc->GetClass() == 'Enchanter') {
@SpellList = ("Bind Affinity","Breeze","Clarity","Clarity II","Alacrity","Augment","Aanya's Quickening","Rune I");
@SpellCost = ("10","25","50","200","10","30","100","5");
@SpellID =   ("35","697","174","1693","170","1729","1708","481");

}

else {
@SpellList = ("Dead Men Floating");
@SpellCost = ("10");
@SpellID =   ("1391");
}

}


sub EVENT_SAY {
my $buffs = quest::saylink("buffs", 1);
my $NPCName = $npc->GetCleanName();
if ($text =~/Hail/i) {
$client->Message(315, "Chip Chip $name, Do you need some $buffs?'");
}

my $count = 1;
my $n = 0;

if (($text=~/Hail/i)&& ($Ench)) {
	while ($SpellList[$n]) {
		if ((lc($SpellList[$n]) =~ lc($text) && lc($SpellList[$n]) ne lc($text)) || ($text =~ /^buffs$/i)) {
		my $SpellList = quest::saylink($SpellList[$n]);
		$client->Message(315, "These are your choices, $SpellList");
		}
			if (lc($SpellList[$n]) eq lc($text) && $text !~ /^buffs$/i) {
			quest::setglobal("buffs", $text, 0, "M5");
			$client->Message(315, "That's going to cost $SpellCost[$n]pp for the $qglobals{buffs} buff.");
			}
			$n++;
			$count++;
		}
	}


elsif (($text=~/Hail/i) && ($Necro)) {
	while ($SpellList[$n]) {
		if ((lc($SpellList[$n]) =~ lc($text) && lc($SpellList[$n]) ne lc($text)) || ($text =~ /^buffs$/i)) {
		my $SpellList = quest::saylink($SpellList[$n]);
		$client->Message(315, "These are your choices, $SpellList");
		}
			if (lc($SpellList[$n]) eq lc($text) && $text !~ /^buffs$/i) {
			quest::setglobal("buffs", $text, 0, "M5");
			$client->Message(315, "That's going to cost $SpellCost[$n]pp for the $qglobals{buffs} buff.");
			}
			$n++;
			$count++;
		}
	}
}
Reply With Quote