I am working on a quest for the Drakkin breath weapons but I am having trouble with the heritage part.
Here is a part of what I am working with. I have taken the heritage part out since it didn't work. I would appreciate any insight into what I need to do to get it right.
Code:
sub EVENT_SAY
{
my $NPCName = $npc->GetCleanName();
my $learn = quest::saylink("learn");
my $second = quest::saylink("second");
my $third = quest::saylink("third");
my $fourth = quest::saylink("fourth");
my $fifth = quest::saylink("fifth");
my $sixth = quest::saylink("sixth");
my $seventh = quest::saylink("seventh");
my $eighth = quest::saylink("eighth");
my $nineth = quest::saylink("nineth");
my $tenth = quest::saylink("tenth");
my $eleventh = quest::saylink("eleventh");
my $twelveth = quest::saylink("twelveth");
my $thirteenth = quest::saylink("thirteenth");
my $fourteenth = quest::saylink("fourteenth");
my $fifteenth = quest::saylink("fifteenth");
if($text=~/Hail/i)
{
if($client->GetBaseRace == 522)
{
if (($qglobals{Atathus} == 0) && $ulevel >= 5)
{
$client->Message(315, "$NPCName whispers to you, 'Hello, my child. I know the transition has been difficult and you may not remember but you are of my blood. What this means is that you have within you the power of all dragonkin, our deadly breath. As you grow so too shall it grow. Do you wish to $learn how to call upon your dragon blood?'");
}
if (($qglobals{Atathus} == 0) && $ulevel < 5)
{
$client->Message(315, "$NPCName whispers to you, 'Come back, my child, when you have become stronger.'");
}
if (($qglobals{Atathus} == 1) && $ulevel >= 10)
{
$client->Message(315, "$NPCName whispers to you, 'I am pleased that you have returned, $name. Are you prepared for your $second lessons?'");
}
if (($qglobals{Atathus} == 1) && $ulevel < 10)
{
$client->Message(315, "$NPCName whispers to you, 'Come back, my child, when you have become stronger.'");
}
if (($qglobals{Atathus} == 2) && $ulevel >= 15)
{
$client->Message(315, "$NPCName whispers to you, 'I am pleased that you have returned, $name. Are you prepared for your $third lessons?'");
}
if (($qglobals{Atathus} == 2) && $ulevel < 15)
{
$client->Message(315, "$NPCName whispers to you, 'Come back, my child, when you have become stronger.'");
}
if (($qglobals{Atathus} == 3) && $ulevel >= 20)
{
$client->Message(315, "$NPCName whispers to you, 'I am pleased that you have returned, $name. Are you prepared for your $fourth lessons?'");
}
if (($qglobals{Atathus} == 3) && $ulevel < 20)
{
$client->Message(315, "$NPCName whispers to you, 'Come back, my child, when you have become stronger.'");
}
if (($qglobals{Atathus} == 4) && $ulevel >= 25)
{
$client->Message(315, "$NPCName whispers to you, 'I am pleased that you have returned, $name. Are you prepared for your $fifth lessons?'");
}
if (($qglobals{Atathus} == 4) && $ulevel < 25)
{
$client->Message(315, "$NPCName whispers to you, 'Come back, my child, when you have become stronger.'");
}
if (($qglobals{Atathus} == 5) && $ulevel >= 30)
{
$client->Message(315, "$NPCName whispers to you, 'I am pleased that you have returned, $name. Are you prepared for your $sixth lessons?'");
}
if (($qglobals{Atathus} == 5) && $ulevel < 30)
{
$client->Message(315, "$NPCName whispers to you, 'Come back, my child, when you have become stronger.'");
}
if (($qglobals{Atathus} == 6) && $ulevel >= 35)
{
$client->Message(315, "$NPCName whispers to you, 'I am pleased that you have returned, $name. Are you prepared for your $seventh lessons?'");
}
if (($qglobals{Atathus} == 6) && $ulevel < 35)
{
$client->Message(315, "$NPCName whispers to you, 'Come back, my child, when you have become stronger.'");
}
if (($qglobals{Atathus} == 7) && $ulevel >= 40)
{
$client->Message(315, "$NPCName whispers to you, 'I am pleased that you have returned, $name. Are you prepared for your $eighth lessons?'");
}
if (($qglobals{Atathus} == 7) && $ulevel < 40)
{
$client->Message(315, "$NPCName whispers to you, 'Come back, my child, when you have become stronger.'");
}
if (($qglobals{Atathus} == 8) && $ulevel >= 45)
{
$client->Message(315, "$NPCName whispers to you, 'I am pleased that you have returned, $name. Are you prepared for your $nineth lessons?'");
}
if (($qglobals{Atathus} == 8) && $ulevel < 45)
{
$client->Message(315, "$NPCName whispers to you, 'Come back, my child, when you have become stronger.'");
}
if (($qglobals{Atathus} == 9) && $ulevel >= 50)
{
$client->Message(315, "$NPCName whispers to you, 'I am pleased that you have returned, $name. Are you prepared for your $tenth lessons?'");
}
if (($qglobals{Atathus} == 9) && $ulevel < 50)
{
$client->Message(315, "$NPCName whispers to you, 'Come back, my child, when you have become stronger.'");
}
if (($qglobals{Atathus} == 10) && $ulevel >= 55)
{
$client->Message(315, "$NPCName whispers to you, 'I am pleased that you have returned, $name. Are you prepared for your $eleventh lessons?'");
}
if (($qglobals{Atathus} == 10) && $ulevel < 55)
{
$client->Message(315, "$NPCName whispers to you, 'Come back, my child, when you have become stronger.'");
}
if (($qglobals{Atathus} == 11) && $ulevel >= 60)
{
$client->Message(315, "$NPCName whispers to you, 'I am pleased that you have returned, $name. Are you prepared for your $twelveth lessons?'");
}
if (($qglobals{Atathus} == 11) && $ulevel < 60)
{
$client->Message(315, "$NPCName whispers to you, 'Come back, my child, when you have become stronger.'");
}
if (($qglobals{Atathus} == 12) && $ulevel >= 65)
{
$client->Message(315, "$NPCName whispers to you, 'I am pleased that you have returned, $name. Are you prepared for your $thirteenth lessons?'");
}
if (($qglobals{Atathus} == 12) && $ulevel < 65)
{
$client->Message(315, "$NPCName whispers to you, 'Come back, my child, when you have become stronger.'");
}
if (($qglobals{Atathus} == 13) && $ulevel >= 70)
{
$client->Message(315, "$NPCName whispers to you, 'I am pleased that you have returned, $name. Are you prepared for your $fourteenth lessons?'");
}
if (($qglobals{Atathus} == 13) && $ulevel < 70)
{
$client->Message(315, "$NPCName whispers to you, 'Come back, my child, when you have become stronger.'");
}
if (($qglobals{Atathus} == 14) && $ulevel >= 75)
{
$client->Message(315, "$NPCName whispers to you, 'I am pleased that you have returned, $name. Are you prepared for your $fifteenth lessons?'");
}
if (($qglobals{Atathus} == 14) && $ulevel < 75)
{
$client->Message(315, "$NPCName whispers to you, 'Come back, my child, when you have become stronger.'");
}
if ($qglobals{Atathus} == 15)
{
$client->Message(315, "$NPCName whispers to you, 'I have nothing further to teach you at this time. You have done well $name. Bring pride upon our brood.'");
}
}
if($client->GetBaseRace < 522)
{
$client->Message(315, "$NPCName whispers to you, 'You are not one of my children. Begone!'");
}
}
if($text=~/Learn/i)
{
$client->Message(315, "$NPCName whispers to you, 'It pleases me that you are eager to learn the ways of your blood and brood. The learning process will not be easy but the rewards for success will be great. Bring unto me one Hollows Widow Poison Sac and I will teach you the first lesson.'");
}
if($text=~/Second/i)
{
$client->Message(315, "$NPCName whispers to you, 'Very well, bring me the Skull of Charbones and I will teach you how to further focus your breath weapon.'");
}
if($text=~/third/i)
{
$client->Message(315, "$NPCName whispers to you, 'Very well, bring me the Head of Bloodmaw and I will teach you how to further focus your breath weapon.'");
}
if($text=~/fourth/i)
{
$client->Message(315, "$NPCName whispers to you, 'Very well, bring me the Head of Plaguebringer and I will teach you how to further focus your breath weapon.'");
}
if($text=~/Fifth/i)
{
$client->Message(315, "$NPCName whispers to you, 'Very well, bring me the Eye of Dragoneater and I will teach you how to further focus your breath weapon.'");
}
if($text=~/Sixth/i)
{
$client->Message(315, "$NPCName whispers to you, 'Very well, bring me the Head of Duskfall and I will teach you how to further focus your breath weapon.'");
}
if($text=~/Seventh/i)
{
$client->Message(315, "$NPCName whispers to you, 'Very well, bring me some enchanted vines and I will teach you how to further focus your breath weapon.'");
}
if($text=~/Eighth/i)
{
$client->Message(315, "$NPCName whispers to you, 'Very well, bring me Poisonmaker Maliza's Stinger and I will teach you how to further focus your breath weapon.'");
}
if($text=~/Nineth/i)
{
$client->Message(315, "$NPCName whispers to you, 'Very well, bring me s Branch from Refugiu and I will teach you how to further focus your breath weapon.'");
}
if($text=~/Tenth/i)
{
$client->Message(315, "$NPCName whispers to you, 'Very well, bring me the Head of Nestor and I will teach you how to further focus your breath weapon.'");
}
if($text=~/Eleventh/i)
{
$client->Message(315, "$NPCName whispers to you, 'Very well, bring me Ionela's Wings and I will teach you how to further focus your breath weapon.'");
}
if($text=~/Twelveth/i)
{
$client->Message(315, "$NPCName whispers to you, 'Very well, bring me the Head of Razorfang and I will teach you how to further focus your breath weapon.'");
}
if($text=~/Thirteenth/i)
{
$client->Message(315, "$NPCName whispers to you, 'Very well, bring me the Head of Serravok and I will teach you how to further focus your breath weapon.'");
}
if($text=~/Fourteenth/i)
{
$client->Message(315, "$NPCName whispers to you, 'Very well, bring me the Skull of Velosk and I will teach you how to further focus your breath weapon.'");
}
if($text=~/Fifteenth/i)
{
$client->Message(315, "$NPCName whispers to you, 'Very well, bring me the Head of Kellet and I will teach you how to further focus your breath weapon.'");
}
}
sub EVENT_ITEM
{
if (plugin::check_handin(\%itemcount, 64090 => 1))
{
if ($qglobals{Atathus} == 0)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your first lesson.'");
$client->IncrementAA(5150);
quest::exp(10000);
quest::ding;
quest::setglobal("Atathus", 1, 0, "F");
}
}
if (plugin::check_handin(\%itemcount, 64091 => 1))
{
if ($qglobals{Atathus} == 1)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your second lesson.'");
$client->IncrementAA(5150);
quest::exp(20000);
quest::ding;
quest::setglobal("Atathus", 2, 0, "F");
}
}
if (plugin::check_handin(\%itemcount, 64092 => 1))
{
if ($qglobals{Atathus} == 2)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your third lesson.'");
$client->IncrementAA(5150);
quest::exp(30000);
quest::ding;
quest::setglobal("Atathus", 3, 0, "F");
}
}
if (plugin::check_handin(\%itemcount, 64093 => 1))
{
if ($qglobals{Atathus} == 3)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your fourth lesson.'");
$client->IncrementAA(5150);
quest::exp(40000);
quest::ding;
quest::setglobal("Atathus", 4, 0, "F");
}
}
if (plugin::check_handin(\%itemcount, 64094 => 1))
{
if ($qglobals{Atathus} == 4)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your fifth lesson.'");
$client->IncrementAA(5150);
quest::exp(50000);
quest::ding;
quest::setglobal("Atathus", 5, 0, "F");
}
}
if (plugin::check_handin(\%itemcount, 64095 => 1))
{
if ($qglobals{Atathus} == 5)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your sixth lesson.'");
$client->IncrementAA(5150);
quest::exp(60000);
quest::ding;
quest::setglobal("Atathus", 6, 0, "F");
}
}
if (plugin::check_handin(\%itemcount, 64096 => 1))
{
if ($qglobals{Atathus} == 6)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your seventh lesson.'");
$client->IncrementAA(5150);
quest::exp(70000);
quest::ding;
quest::setglobal("Atathus", 7, 0, "F");
}
}
if (plugin::check_handin(\%itemcount, 64097 => 1))
{
if ($qglobals{Atathus} == 7)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your eighth lesson.'");
$client->IncrementAA(5150);
quest::exp(80000);
quest::ding;
quest::setglobal("Atathus", 8, 0, "F");
}
}
if (plugin::check_handin(\%itemcount, 64098 => 1))
{
if ($qglobals{Atathus} == 8)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your nineth lesson.'");
$client->IncrementAA(5150);
quest::exp(90000);
quest::ding;
quest::setglobal("Atathus", 9, 0, "F");
}
}
if (plugin::check_handin(\%itemcount, 64099 => 1))
{
if ($qglobals{Atathus} == 9)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your tenth lesson.'");
$client->IncrementAA(5150);
quest::exp(100000);
quest::ding;
quest::setglobal("Atathus", 10, 0, "F");
}
}
if (plugin::check_handin(\%itemcount, 64100 => 1))
{
if ($qglobals{Atathus} == 10)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your eleventh lesson.'");
$client->IncrementAA(5150);
quest::exp(110000);
quest::ding;
quest::setglobal("Atathus", 11, 0, "F");
}
}
if (plugin::check_handin(\%itemcount, 64101 => 1))
{
if ($qglobals{Atathus} == 11)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your twelveth lesson.'");
$client->IncrementAA(5150);
quest::exp(120000);
quest::ding;
quest::setglobal("Atathus", 12, 0, "F");
}
}
if (plugin::check_handin(\%itemcount, 64102 => 1))
{
if ($qglobals{Atathus} == 12)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your thirteenth lesson.'");
$client->IncrementAA(5150);
quest::exp(130000);
quest::ding;
quest::setglobal("Atathus", 13, 0, "F");
}
}
if (plugin::check_handin(\%itemcount, 64103 => 1))
{
if ($qglobals{Atathus} == 13)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your fourteenth lesson.'");
$client->IncrementAA(5150);
quest::exp(140000);
quest::ding;
quest::setglobal("Atathus", 14, 0, "F");
}
}
if (plugin::check_handin(\%itemcount, 64104 => 1))
{
if ($qglobals{Atathus} == 14)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your fifteenth lesson.'");
$client->IncrementAA(5150);
quest::exp(150000);
quest::ding;
quest::setglobal("Atathus", 15, 0, "F");
}
}
if (plugin::check_handin(\%itemcount, 64104 => 1))
{
if ($qglobals{Atathus} == 15)
{
$client->Message(315, "$NPCName whispers to you, 'Excellent, $name. You have proven you are ready for your sixteenth lesson.'");
$client->IncrementAA(5150);
quest::exp(160000);
quest::ding;
quest::setglobal("Atathus", 16, 0, "F");
}
}
{
plugin::return_items(\%itemcount);
}
}
I know there have to be betters ways of writing this but this is my first attempt at something like this and it works, except for the heritage part.
Thanks.