View Single Post
  #4  
Old 02-12-2013, 05:58 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 255
Default

[QUOTE=Zamthos;218075]Why'd you do this?: Shouldn't it be elsif? Just try using the syntax checker, errors below. I pasted exactly what you posted and got those errors, nothing extra, nothing less.
Code:
else ($npc->GetClass == 'Necromancer') {
@SpellList = ("Dead Men Floating");
@SpellCost = ("10");
@SpellID =   ("1391");
}
I can use elsif, I am still learning. I will be adding more classes than enchanter and necro, but this was just a starting point.

I tested it with elsif and if neither worked, the NPC doesnt talk so I think im missing a link calling the proper list somewhere down in sub EVENT_SAY but im still tryen to find it lol
Here is with 3 class options for more clarification.

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

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");
}

if ($npc->GetClass == 'Necromancer') {
@SpellList = ("Dead Men Floating");
@SpellCost = ("10");
@SpellID =   ("1391");
}

if ($npc->GetClass == 'Cleric') {
@SpellList = ("Daring");
@SpellCost = ("5");
@SpellID =   ("89");
}

}
__________________
Reply With Quote