PDA

View Full Version : Help building a mob for different hand-ins


Zengez
08-20-2006, 03:58 PM
EDIT:: Including just the summon section I can't get to work, don't think it's a 'multi summon' issue so much as i just can't get this tiered part to work... not even giving the 'if all else fails return this' answer so it doesnt' even seem like it's initializing correctly, but hails work so i know the file is properly configured to apply teh quest to the npc.

Ok, I'm just learning the pearl script as I go now, so bear with me...

I'm trying to create an npc as part of a singular (because i'm lazy) epic quest for the 2.0's and I need him to be able to take an item at one part of the quest, and reply accordingly, then later on take the epic piece and 'forge' the item from it, thus taking one item and returning the correct epic there... So far i could get the scripting for the recieving the one item and talking at the 1st hand-in, but when i add in the epic peice part it breaks the entire event_item event, so he doesn't do the 1st hand in part nor does he do the epic part... oddly however he does still do the event_say parts... here's my entire folder...

sub EVENT_ITEM
{
if ($itemcount{8205} == 1)
{

if ($class == 'Warrior'){quest::summonitem (60332);}
else if ($class == 'Cleric'){quest::summonitem (20076);}
else if ($class == 'Paladin'){quest::summonitem (48147);}
else if ($class == 'Ranger'){quest::summonitem (62649);}
else if ($class == 'Shadowknight'){quest::summonitem (48136);}
else if ($class == 'Druid'){quest::summonitem (62880);}
else if ($class == 'Monk'){quest::summonitem (67742);}
else if ($class == 'Bard'){quest::summonitem (77631);}
else if ($class == 'Rogue'){quest::summonitem (52348);}
else if ($class == 'Shaman'){quest::summonitem (57405);}
else if ($class == 'Necromancer'){quest::summonitem (64067);}
else if ($class == 'Wizard'){quest::summonitem (16576);}
else if ($class == 'Magician'){quest::summonitem (19092);}
else if ($class == 'Enchanter'){quest::summonitem (52962);}
else if ($class == 'Beastlord'){quest::summonitem (57054);}
else if ($class == 'Berserker'){quest::summonitem (18609);}
else {quest::say ("Hey, wtf are you?");}
}
}

It's likely that i messed up big, in which case theres a million different errors, but with no way of knowing what i did wrong, I tried a few ways, and it doesn't work, if someone could point out my general error I'll try to make it work

Thanks, and sorry for the newbishness, pearl isn't something I ever got familiar with heh

Zengez
08-20-2006, 05:39 PM
Ok, reading other threads i've modified it to

sub EVENT_ITEM
{
if ($itemcount{8205} == 1)
{
if ($class eq 'Warrior'){quest::summonitem ("60332");}
else if ($class eq 'Cleric'){quest::summonitem ("20076");}
else if ($class eq 'Paladin'){quest::summonitem ("48147");}
else if ($class eq 'Ranger'){quest::summonitem ("62649");}
else if ($class eq 'Shadowknight'){quest::summonitem ("48136");}
else if ($class eq 'Druid'){quest::summonitem ("62880");}
else if ($class eq 'Monk'){quest::summonitem ("67742");}
else if ($class eq 'Bard'){quest::summonitem ("77631");}
else if ($class eq 'Rogue'){quest::summonitem ("52348");}
else if ($class eq 'Shaman'){quest::summonitem ("57405");}
else if ($class eq 'Necromancer'){quest::summonitem ("64067");}
else if ($class eq 'Wizard'){quest::summonitem ("16576");}
else if ($class eq 'Magician'){quest::summonitem ("19092");}
else if ($class eq 'Enchanter'){quest::summonitem ("52962");}
else if ($class eq 'Beastlord'){quest::summonitem ("57054");}
else if ($class eq 'Berserker'){quest::summonitem ("18609");}
}
}

That works for the first line if i delete everything else, but when I add in the 'else if' 's nothing at all works (including if i'm a warrior) so.. I'm pretty well confused but i'll keep beating my head upon it till someone can let me know what the obvious thing i'm missing is ;)

Zengez
08-20-2006, 05:59 PM
Ok, apparently the above doesn't work but this does...

if ($itemcount{8205} == 1)
{
if ($class eq "Warrior"){quest::summonitem ("60332");}
if ($class eq "Cleric"){quest::summonitem ("20076");}
if ($class eq "Paladin"){quest::summonitem ("48147");}
if ($class eq "Ranger"){quest::summonitem ("62649");}
if ($class eq "Shadowknight"){quest::summonitem ("48136");}
if ($class eq "Druid"){quest::summonitem ("62880");}
if ($class eq "Monk"){quest::summonitem ("67742");}
if ($class eq "Bard"){quest::summonitem ("77631");}
if ($class eq "Rogue"){quest::summonitem ("52348");}
if ($class eq "Shaman"){quest::summonitem ("57405");}
if ($class eq "Necromancer"){quest::summonitem ("64067");}
if ($class eq "Wizard"){quest::summonitem ("16576");}
if ($class eq "Magician"){quest::summonitem ("19092");}
if ($class eq "Enchanter"){quest::summonitem ("52962");}
if ($class eq "Beastlord"){quest::summonitem ("57054");}
if ($class eq "Berserker"){quest::summonitem ("18609");}
}

So, the programmer in me dies a little inside using all those if statements instead of else if but i can't seem to get the else to work without killing it entirely, so i'm not really sure.

ylosh
08-20-2006, 07:31 PM
elsif is the cheese for perl..

Thristam
08-21-2006, 09:04 AM
Ylosh is correct. You must use elsif "else if" does not work.