PDA

View Full Version : Broke a few quests


Liontooth
12-05-2020, 10:07 PM
So this is my first attempt at coding anything in a couple years and it appears I have lost my touch a bit lol. Have broke 3 quests apparently, not working at all.
First one is a quest thats not getting any responses to anything said at all. 2nd and 3rd are in my global_player and dont appear to be working. Not quite sure what ive done wrong in these, ive tested and modified multiple times and just cant quite figure it out, any help would be great!

sub EVENT_SAY {
if($text=~/hail/i) {
if (defined $qglobals{"Odese"} && $qglobals{"Odese"} >= 3) {
plugin::Whisper("How did you get here?! Begone!");
quest::zone("freeporttemple");
} elsif (defined $qglobals{"Odese"} && $qglobals{"Odese"} == 2) {
plugin::Whisper("Are you " . quest::saylink("ready", 1) . " to start your adventure?");
} else {
plugin::Whisper("Thank the Gods you have awoke $name! We must be quick, we haven't much " . quest::saylink("time", 1) . " !");
quest::setglobal("Odese", 1, 5, "F");
}
elsif(($text=~/time/i) {
plugin::Whisper("Discord is rising! Norrath is being " . quest::saylink("exterminated", 1) . " . as we speak!");
quest::setglobal("Hardmode", 1, 5, "F");
}
elsif(($text=~/exterminated/i) {
plugin::Whisper("Many braves souls have been lost. Fortunately I was able to create a barrier to surround our great temple, giving Norrath one final chance! But alas, my " . quest::saylink("power", 1) . " is draining.");
}
elsif($text=~/power/i) {
plugin::Whisper("I created this void to bring me the most powerful Norrath had to offer. You $name , are here by tasked with saving Norrath! Will you " . quest::saylink("accept", 1) . " ?");
}
elsif($text=~/accept/i) {
plugin::Whisper("Fantastic! Hold still as I empower you!");
quest::Setlevel(51);
quest::setaa(50);
quest::setglobal("Odese", 2, 5, "F");
}
elsif($text=~/ready/i) && (defined $qglobals{"Odese"} && $qglobals{"Odese"} == 2) {
plugin::Whisper("Good Luck!");
quest::setglobal("Odese", 3, 5, "F");
quest::zone("freeporttemple");
}
}
}


2nd
sub EVENT_LEVEL_UP {
if (defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 1) && ($ulevel <= 60) { {
$client->Message( 15, "Your experiences across the realm have infused you with increased power and knowledge..." );
# set all available skills to maximum for race/class at current level
foreach my $skill ( 0 .. 42, 48 .. 54, 62, 70 .. 74, 76, 77 ) {
next unless $client->CanHaveSkill($skill);
my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
next unless $maxSkill > $client->GetRawSkill($skill);
$client->SetSkill( $skill, $maxSkill );
}
elsif (defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 4) && ($ulevel == 75) { {
$client->Message( 15, "You have completed Hardmode! Congratulations here is your reward!" );
quest::summonitem();
quest::setglobal("Hardmode", 5, 5, "F");
}
}
}

3rd
sub EVENT_DEATH {
my $CorpseCount = 0;
my $charid = $client->CharacterID();
if (defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 4) && ($ulevel <= 69) { {
quest::setlevel(51);
$client->Message( 15, "Hardmode Enabled. Your level and skills have reset as punishment for your death!" );
# set all available skills to maximum for race/class at current level
foreach my $skill ( 0 .. 42, 48 .. 54, 62, 70 .. 74, 76, 77 ) {
next unless $client->CanHaveSkill($skill);
my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
next unless $maxSkill > $client->GetRawSkill($skill);
$client->SetSkill( $skill, $maxSkill );
my $corpse = $entity_list->GetCorpseByOwner($client);
$client->Message(15,"Your corpse has been removed.");
$corpse->Delete();
}
elsif (defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 4) && ($ulevel >= 70) { {
quest::setlevel(70);
$client->Message( 15, "Hardmode Enabled. Your level and skills have reset as punishment for your death!" );
# set all available skills to maximum for race/class at current level
foreach my $skill ( 0 .. 42, 48 .. 54, 62, 70 .. 74, 76, 77 ) {
next unless $client->CanHaveSkill($skill);
my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
next unless $maxSkill > $client->GetRawSkill($skill);
$client->SetSkill( $skill, $maxSkill );
my $corpse = $entity_list->GetCorpseByOwner($client);
$client->Message(15,"Your corpse has been removed.");
$corpse->Delete();
}
elsif (defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 5) && ($ulevel == 75) { {
$client->Message( 15, "Hardmode Enabled. As a reward for completing Hardmode, your punishment is waved!" );
}
}
}
sub COUNT_CORPSES {
my @corpse_list = $entity_list->GetCorpseList();
my $count = 0;
foreach $corpse_found (@corpse_list) {
if ($corpse_found->GetOwnerName() eq $client->GetName()) {
$count++;
}
}
$count;
}
}
}

Congdar
12-06-2020, 12:19 PM
1st:
You have an else in the middle of a bunch of elsif's

else {
plugin::Whisper("Thank the Gods you have awoke $name! We must be quick, we haven't much " . quest::saylink("time", 1) . " !");
quest::setglobal("Odese", 1, 5, "F");
}


2nd: and 3rd:
Possibly too many braces

if (defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 1) && ($ulevel <= 60) { {


if (defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 4) && ($ulevel <= 69) { {

Liontooth
12-06-2020, 05:54 PM
Used your suggestions, 2nd and 3rd still not functioning. 1st is working to line 21. After responding accept he replies with his response, but nothing else happens.

rewrote code:

sub EVENT_SAY {
if($text=~/hail/i) {
plugin::Whisper("Thank the Gods you have awoke $name! We must be quick, we haven't much " . quest::saylink("time", 1) . " !");
quest::setglobal("Odese", 1, 5, "F");
} elsif (defined $qglobals{"Odese"} && $qglobals{"Odese"} == 2) {
plugin::Whisper("Are you " . quest::saylink("ready", 1) . " to start your adventure?");
} elsif (defined $qglobals{"Odese"} && $qglobals{"Odese"} >= 3) {
plugin::Whisper("How did you get here?! Begone!");
quest::zone("freeporttemple");
}
elsif($text=~/time/i) {
plugin::Whisper("Discord is rising! Norrath is being " . quest::saylink("exterminated", 1) . " as we speak!");
quest::setglobal("Hardmode", 1, 5, "F");
}
elsif($text=~/exterminated/i) {
plugin::Whisper("Many braves souls have been lost. Fortunately I was able to create a barrier to surrond our great temple, giving Norrath one final chance! But alas, my " . quest::saylink("power", 1) . " is draining.");
}
elsif($text=~/power/i) {
plugin::Whisper("I created this void to bring me the most powerful Norrath had to offer. You $name , are here by tasked with saving Norrath! Will you " . quest::saylink("accept", 1) . " ?");
}
elsif($text=~/accept/i) {
plugin::Whisper("Fantastic! Hold still as I empower you!");
quest::setglobal("Odese", 2, 5, "F");
quest::setlvl(51);
quest::setaa(50);
}
elsif($text=~/ready/i) {
plugin::Whisper("Good Luck!");
quest::setglobal("Odese", 3, 5, "F");
quest::zone("freeporttemple");
}
}
}

Liontooth
12-06-2020, 05:56 PM
Also doesnt appear to be setting globals when following text. When hailed I only get the response from the first line

Sturm
12-07-2020, 12:10 AM
Make sure your NPC has qglobals turned on.

~didn't read the code, so I'm no help there~

Liontooth
12-07-2020, 06:21 AM
Make sure your NPC has qglobals turned on.

~didn't read the code, so I'm no help there~

First thing I checked lol. The set level and set AA arent working either. No syntax errors, gonna keep testing for now I'm obviously missing something right in my face lol

Liontooth
12-07-2020, 08:18 AM
Have tried using
quest::setlevel
quest::setlvl
$client->setlevel
$client->setlvl

And tried same for the AA part. Neither one nor the globals sets seem to be functioning. The zone part works fine, text works fine, aside from the global checks upon hailing. Getting 0 syntax errors and have read the code multiple times, I'm currently at a loss as to why it's not working properly

Congdar
12-07-2020, 01:11 PM
2nd: and 3rd:
Possibly too many braces

if (defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 1) && ($ulevel <= 60) { {


if (defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 4) && ($ulevel <= 69) { {


These also were missing some parenthesis.

Your new post has an extra bracket at the bottom. I haven't run these, only checking syntax... so maybe it's the functions you are calling. Do they exist in the proper folder (plugins) etc?
Is Whisper working? Do the saylinks work?

Liontooth
12-07-2020, 04:27 PM
Where was the missing parenthesis? Whisper and say links work fine and zone working fine. Just the globals,lvl and AA parts dont work, will check the extra bracket and see if that changes anything

Congdar
12-07-2020, 07:44 PM
Where was the missing parenthesis? Whisper and say links work fine and zone working fine. Just the globals,lvl and AA parts dont work, will check the extra bracket and see if that changes anything


if ((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 1) && ($ulevel <= 60)) {



The red parens... around the entire condition statement. You can't have one set of parens (the qglobals) a comparator (&&) and another set of parens (the level check) without having them both inside parens.

Nukerella
12-07-2020, 08:13 PM
Rather than
quest::setlvl(51);
quest::setaa(50);

Try
quest::level(51);
$client->AddAAPoints(50);

Liontooth
12-08-2020, 06:55 AM
So the quest and client thing suggested by Nukerella fixed that part of the quest, thank you! Globals im unsure if are actually working as I only get the first Hail line everytime i hail the npc. Added the Missing Parenthesis in 2nd and 3rd script, still not seeming to do anything upon leveling or dieing. Will continue testing.

Liontooth
12-08-2020, 07:04 AM
Works all the way up to where he sets level and AA, after that you get the "Awakened" message as if globals didnt set. And if by some chance you do get him to say "ready" text he will just repeat it everytime you click ready, not sure why it stopped porting. As far as the "ready" text it seems you can only get him to fire that text if you click a saylink you previously clicked, no clue whats going on here lol. Thank you all for being patient, i didnt realize ive lost my touch to such a degree, used to crank out easy quests like this all the time lol.

sub EVENT_SAY {
if($text=~/hail/i) {
plugin::Whisper("Thank the Gods you have awoke $name! We must be quick, we haven't much " . quest::saylink("time", 1) . " !");
quest::setglobal("Odese", 1, 5, "F");
} elsif (defined $qglobals{"Odese"} && $qglobals{"Odese"} == 2) {
plugin::Whisper("Are you " . quest::saylink("ready", 1) . " to start your adventure?");
} elsif (defined $qglobals{"Odese"} && $qglobals{"Odese"} >= 3) {
plugin::Whisper("How did you get here?! Begone!");
quest::zone("freeporttemple");
}
elsif($text=~/time/i) {
plugin::Whisper("Discord is rising! Norrath is being " . quest::saylink("exterminated", 1) . " as we speak!");
quest::setglobal("Hardmode", 1, 5, "F");
}
elsif($text=~/exterminated/i) {
plugin::Whisper("Many braves souls have been lost. Fortunately I was able to create a barrier to surrond our great temple, giving Norrath one final chance! But alas, my " . quest::saylink("power", 1) . " is draining.");
}
elsif($text=~/power/i) {
plugin::Whisper("I created this void to bring me the most powerful Norrath had to offer. You $name , are here by tasked with saving Norrath! Will you " . quest::saylink("accept", 1) . " ?");
}
elsif($text=~/accept/i) {
plugin::Whisper("Fantastic! Hold still as I empower you!");
quest::setglobal("Odese", 2, 5, "F");
quest::level(51);
$client->AddAAPoints(50);
}
elsif($text=~/ready/i) {
plugin::Whisper("Good Luck!");
quest::setglobal("Odese", 3, 5, "F");
quest::zone("freeporttemple");
}
}

Liontooth
12-08-2020, 12:55 PM
Rewrote first code completely and now works fine

sub EVENT_SAY {
if ($text=~/hail/i) {
if (defined $qglobals{"Odese"} && $qglobals{"Odese"} >= 3 && $qglobals{"Odese"} >= 3) {
plugin::Whisper("How did you get here?! Begone!");
quest::zone("freeporttemple");
} elsif (defined $qglobals{"Odese"} && $qglobals{"Odese"} == 2) {
plugin::Whisper("Are you " . quest::saylink("ready", 1) . " to start your adventure?");
} else {
plugin::Whisper("Thank the Gods you have awoke $name! We must be quick, we haven't much " . quest::saylink("time", 1) . " !");
quest::setglobal("Odese", 1, 5, "F");
}
} elsif ($text=~/accept/i) {
if (defined $qglobals{"Odese"} && $qglobals{"Odese"} == 1 && $qglobals{"Odese"} == 1) {
plugin::Whisper("Fantastic! Hold still as I empower you!");
quest::setglobal("Odese", 2, 5, "F");
quest::level(51);
$client->AddAAPoints(50);
$client->Message( 15, "Your level has been set to 51 and you have been granted 50 AA!" );
} else {
plugin::Whisper("I can do nothing for you.");
}
} elsif($text=~/time/i) {
plugin::Whisper("Discord is rising! Norrath is being " . quest::saylink("exterminated", 1) . " as we speak!");
quest::setglobal("Hardmode", 1, 5, "F");
}
elsif($text=~/exterminated/i) {
plugin::Whisper("Many braves souls have been lost. Fortunately I was able to create a barrier to surrond our great temple, giving Norrath one final chance! But alas, my " . quest::saylink("power", 1) . " is draining.");
}
elsif($text=~/power/i) {
plugin::Whisper("I created this void to bring me the most powerful Norrath had to offer. You $name , are here by tasked with saving Norrath! Will you " . quest::saylink("accept", 1) . " ?");
}
elsif($text=~/ready/i) {
plugin::Whisper("Good Luck!");
quest::setglobal("Odese", 3, 5, "F");
quest::zone("freeporttemple");
}
}

sub EVENT_ITEM {
if (plugin::check_handin(\%itemcount, 4089 => 1)) {
quest::summonitem($_) for (4142, 4150);
} elsif (plugin::check_handin(\%itemcount, 4090 => 1)) {
quest::summonitem($_) for (4143, 4151);
} elsif (plugin::check_handin(\%itemcount, 4092 => 1)) {
quest::summonitem($_) for (4144, 4160);
} elsif (plugin::check_handin(\%itemcount, 4117 => 1)) {
quest::summonitem($_) for (4145, 4197);
} elsif (plugin::check_handin(\%itemcount, 4140 => 1)) {
quest::summonitem($_) for (4149, 4198);
}
plugin::return_items(\%itemcount);
}


2nd and 3rd are still not working for some reason. here is current code for them. These 2 are in my Global_Player.pl for refrence.

2nd
sub EVENT_LEVEL_UP {
if ((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 1) && ($ulevel <= 60)) {
$client->Message( 15, "Your experiences across the realm have infused you with increased power and knowledge..." );
# set all available skills to maximum for race/class at current level
foreach my $skill ( 0 .. 42, 48 .. 54, 62, 70 .. 74, 76, 77 ) {
next unless $client->CanHaveSkill($skill);
my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
next unless $maxSkill > $client->GetRawSkill($skill);
$client->SetSkill( $skill, $maxSkill );
}
elsif ((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 4) && ($ulevel == 75)) {
$client->Message( 15, "You have completed Hardmode! Congratulations here is your reward!" );
quest::summonitem();
quest::setglobal("Hardmode", 5, 5, "F");
}
}

3rd
sub EVENT_DEATH {
my $CorpseCount = 0;
my $charid = $client->CharacterID();
if ((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 4) && ($ulevel <= 69)) {
quest::setlevel(51);
$client->Message( 15, "Hardmode Enabled. Your level and skills have reset as punishment for your death!" );
# set all available skills to maximum for race/class at current level
foreach my $skill ( 0 .. 42, 48 .. 54, 62, 70 .. 74, 76, 77 ) {
next unless $client->CanHaveSkill($skill);
my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
next unless $maxSkill > $client->GetRawSkill($skill);
$client->SetSkill( $skill, $maxSkill );
my $corpse = $entity_list->GetCorpseByOwner($client);
$client->Message(15,"Your corpse has been removed.");
$corpse->Delete();
}
elsif ((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 4) && ($ulevel >= 70)) {
quest::setlevel(70);
$client->Message( 15, "Hardmode Enabled. Your level and skills have reset as punishment for your death!" );
# set all available skills to maximum for race/class at current level
foreach my $skill ( 0 .. 42, 48 .. 54, 62, 70 .. 74, 76, 77 ) {
next unless $client->CanHaveSkill($skill);
my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
next unless $maxSkill > $client->GetRawSkill($skill);
$client->SetSkill( $skill, $maxSkill );
my $corpse = $entity_list->GetCorpseByOwner($client);
$client->Message(15,"Your corpse has been removed.");
$corpse->Delete();
}
elsif ((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 5) && ($ulevel == 75)) {
$client->Message( 15, "Hardmode Enabled. As a reward for completing Hardmode, your punishment is waved!" );
}
}

Congdar
12-08-2020, 01:34 PM
Those last two were just missing brackets. A good "Code Beautifier" plugin will help there.
Also, just wanted to mention that quest::setglobal is (String, String, Int, String) even though the parser seems to be ok with having it (String, Int, Int, String).
Emu is moving towards LUA, so might want to consider moving as well.


sub EVENT_LEVEL_UP {
if((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 1) && ($ulevel <= 60)) {
$client->Message( 15, "Your experiences across the realm have infused you with increased power and knowledge..." );
# set all available skills to maximum for race/class at current level
foreach my $skill ( 0 .. 42, 48 .. 54, 62, 70 .. 74, 76, 77 ) {
next unless $client->CanHaveSkill($skill);
my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
next unless $maxSkill > $client->GetRawSkill($skill);
$client->SetSkill( $skill, $maxSkill );
}
}
elsif((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 4) && ($ulevel == 75)) {
$client->Message( 15, "You have completed Hardmode! Congratulations here is your reward!" );
quest::summonitem();
quest::setglobal("Hardmode", 5, 5, "F");
}
}


sub EVENT_DEATH {
my $CorpseCount = 0;
my $charid = $client->CharacterID();
if((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 4) && ($ulevel <= 69)) {
quest::setlevel(51);
$client->Message( 15, "Hardmode Enabled. Your level and skills have reset as punishment for your death!" );
# set all available skills to maximum for race/class at current level
foreach my $skill ( 0 .. 42, 48 .. 54, 62, 70 .. 74, 76, 77 ) {
next unless $client->CanHaveSkill($skill);
my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
next unless $maxSkill > $client->GetRawSkill($skill);
$client->SetSkill( $skill, $maxSkill );
my $corpse = $entity_list->GetCorpseByOwner($client);
$client->Message(15,"Your corpse has been removed.");
$corpse->Delete();
}
}
elsif((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 4) && ($ulevel >= 70)) {
quest::setlevel(70);
$client->Message( 15, "Hardmode Enabled. Your level and skills have reset as punishment for your death!" );
# set all available skills to maximum for race/class at current level
foreach my $skill ( 0 .. 42, 48 .. 54, 62, 70 .. 74, 76, 77 ) {
next unless $client->CanHaveSkill($skill);
my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
next unless $maxSkill > $client->GetRawSkill($skill);
$client->SetSkill( $skill, $maxSkill );
my $corpse = $entity_list->GetCorpseByOwner($client);
$client->Message(15,"Your corpse has been removed.");
$corpse->Delete();
}
}
elsif((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 5) && ($ulevel == 75)) {
$client->Message( 15, "Hardmode Enabled. As a reward for completing Hardmode, your punishment is waved!" );
}
}

Liontooth
12-08-2020, 02:22 PM
Ah ok I see that now looking at yours. Yeah I've been putting lua off trying to get perl down first, but honestly probably should just start learning lua lol. Thanks for the help and the patience still self teaching myself thru this stuff lol

Liontooth
12-08-2020, 02:24 PM
Also is it 2 brackets due to 2 parenthesis?

Sturm
12-08-2020, 07:30 PM
LUA sucks. Perl for LYFE!

~drops mic~

Liontooth
12-09-2020, 12:03 AM
Unfortunately neither one of these will work. Going to just drop my whole global_player here, hopefully someone will see the issue as im having no luck. Not getting any skills up when leveling and not getting reset upon death when hardmode global is active.

The Level Up and Death Events are what im trying to get working, just for reference.


sub EVENT_LEVEL_UP {
if((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} <= 1) && ($ulevel <= 60)) {
$client->Message( 15, "Your experiences across the realm have infused you with increased power and knowledge..." );
# set all available skills to maximum for race/class at current level
foreach my $skill ( 0 .. 42, 48 .. 54, 62, 70 .. 74, 76, 77 ) {
next unless $client->CanHaveSkill($skill);
my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
next unless $maxSkill > $client->GetRawSkill($skill);
$client->SetSkill( $skill, $maxSkill );
}
}
elsif((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 4) && ($ulevel == 75)) {
$client->Message( 15, "You have completed Hardmode! Congratulations here is your reward!" );
quest::summonitem();
quest::setglobal("Hardmode", 5, 5, "F");
}
}


sub EVENT_DEATH {
my $CorpseCount = 0;
my $charid = $client->CharacterID();
if((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 4) && ($ulevel <= 69)) {
quest::setlevel(51);
$client->Message( 15, "Hardmode Enabled. Your level and skills have reset as punishment for your death!" );
# set all available skills to maximum for race/class at current level
foreach my $skill ( 0 .. 42, 48 .. 54, 62, 70 .. 74, 76, 77 ) {
next unless $client->CanHaveSkill($skill);
my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
next unless $maxSkill > $client->GetRawSkill($skill);
$client->SetSkill( $skill, $maxSkill );
my $corpse = $entity_list->GetCorpseByOwner($client);
$client->Message(15,"Your corpse has been removed.");
$corpse->Delete();
}
}
elsif((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 4) && ($ulevel >= 70)) {
quest::setlevel(70);
$client->Message( 15, "Hardmode Enabled. Your level and skills have reset as punishment for your death!" );
# set all available skills to maximum for race/class at current level
foreach my $skill ( 0 .. 42, 48 .. 54, 62, 70 .. 74, 76, 77 ) {
next unless $client->CanHaveSkill($skill);
my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
next unless $maxSkill > $client->GetRawSkill($skill);
$client->SetSkill( $skill, $maxSkill );
my $corpse = $entity_list->GetCorpseByOwner($client);
$client->Message(15,"Your corpse has been removed.");
$corpse->Delete();
}
}
elsif((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 5) && ($ulevel == 75)) {
$client->Message( 15, "Hardmode Enabled. As a reward for completing Hardmode, your punishment is waived!" );
}
}

sub COUNT_CORPSES {
my @corpse_list = $entity_list->GetCorpseList();
my $count = 0;
foreach $corpse_found (@corpse_list) {
if ($corpse_found->GetOwnerName() eq $client->GetName()) {
$count++;
}
}
$count;
}
}


sub EVENT_ENTERZONE { #message only appears in Cities / Pok and wherever the Wayfarer Camps (LDON) is in. This message won't appear in the player's home city.
if($ulevel >= 76 && !defined($qglobals{Wayfarer})) {
if($client->GetStartZone()!=$zoneid && ($zoneid == 1 || $zoneid == 2 || $zoneid == 3 || $zoneid == 8 || $zoneid == 9 || $zoneid == 10 || $zoneid == 19 || $zoneid == 22 || $zoneid == 23 || $zoneid == 24 || $zoneid == 29 || $zoneid == 30 || $zoneid == 34 || $zoneid == 35 || $zoneid == 40 || $zoneid == 41 || $zoneid == 42 || $zoneid == 45 || $zoneid == 49 || $zoneid == 52 || $zoneid == 54 || $zoneid == 55 || $zoneid == 60 || $zoneid == 61 || $zoneid == 62 || $zoneid == 67 || $zoneid == 68 || $zoneid == 75 || $zoneid == 82 || $zoneid == 106 || $zoneid == 155 || $zoneid == 202 || $zoneid == 382 || $zoneid == 383 || $zoneid == 392 || $zoneid == 393 || $zoneid == 408)) {
$client->Message(15,"A mysterious voice whispers to you, 'If you can feel me in your thoughts, know this -- something is changing in the world and I reckon you should be a part of it. I do not know much, but I do know that in every home city and the wilds there are agents of an organization called the Wayfarers Brotherhood. They are looking for recruits . . . If you can hear this message, you are one of the chosen. Rush to your home city, or search the West Karanas and Rathe Mountains for a contact if you have been exiled from your home for your deeds, and find out more. Adventure awaits you, my friend.'");
}
}
}

sub EVENT_COMBINE_VALIDATE {
# $validate_type values = { "check_zone", "check_tradeskill" }
# criteria exports:
# "check_zone" => zone_id
# "check_tradeskill" => tradeskill_id (not active)
if ($recipe_id == 10344) {
if ($validate_type =~/check_zone/i) {
if ($zone_id != 289 && $zone_id != 290) {
return 1;
}
}
}

return 0;
}

sub EVENT_COMBINE_SUCCESS {
if ($recipe_id =~ /^1090[4-7]$/) {
$client->Message(1,
"The gem resonates with power as the shards placed within glow unlocking some of the stone's power. ".
"You were successful in assembling most of the stone but there are four slots left to fill, ".
"where could those four pieces be?"
);
}
elsif ($recipe_id =~ /^10(903|346|334)$/) {
my %reward = (
melee => {
10903 => 67665,
10346 => 67660,
10334 => 67653
},
hybrid => {
10903 => 67666,
10346 => 67661,
10334 => 67654
},
priest => {
10903 => 67667,
10346 => 67662,
10334 => 67655
},
caster => {
10903 => 67668,
10346 => 67663,
10334 => 67656
}
);
my $type = plugin::ClassType($class);
quest::summonitem($reward{$type}{$recipe_id});
quest::summonitem(67704); # Item: Vaifan's Clockwork Gemcutter Tools
$client->Message(1,"Success");
}
}

sub EVENT_CONNECT {
# the main key is the ID of the AA
# the first set is the age required in seconds
# the second is if to ignore the age and grant anyways live test server style
# the third is enabled
my %vet_aa = (
481 => [31536000, 1, 1], ## Lesson of the Devote 1 yr
482 => [63072000, 1, 1], ## Infusion of the Faithful 2 yr
483 => [94608000, 1, 1], ## Chaotic Jester 3 yr
484 => [126144000, 1, 1], ## Expedient Recovery 4 yr
485 => [157680000, 1, 1], ## Steadfast Servant 5 yr
486 => [189216000, 1, 1], ## Staunch Recovery 6 yr
487 => [220752000, 1, 1], ## Intensity of the Resolute 7 yr
511 => [252288000, 1, 1], ## Throne of Heroes 8 yr
2000 => [283824000, 1, 1], ## Armor of Experience 9 yr
8081 => [315360000, 1, 1], ## Summon Resupply Agent 10 yr
8130 => [346896000, 1, 1], ## Summon Clockwork Banker 11 yr
453 => [378432000, 1, 1], ## Summon Permutation Peddler 12 yr
182 => [409968000, 1, 1], ## Summon Personal Tribute Master 13 yr
600 => [441504000, 1, 1] ## Blessing of the Devoted 14 yr
);
my $age = $client->GetAccountAge();
for (my ($aa, $v) = each %vet_aa) {
if ($v[2] && ($v[1] || $age >= $v[0])) {
$client->GrantAlternateAdvancementAbility($aa, 1);
}
}
}

jamemaldonado83
10-01-2021, 05:01 PM
Where was the missing parenthesis? Whisper and say links work fine and zone working fine. Just the globals,lvl and AA parts dont work, will check the extra bracket and see if that changes anything

Rather than quest::setlvl(51); quest::setaa(50);

Try quest::level(51); $client->AddAAPoints(50);

ervinjason12
03-08-2022, 04:17 PM
Works all the way up to where he sets level and AA, after that you get the "Awakened" message as if globals didnt set.

And if by some chance you do get him to say "ready" text he will just repeat it everytime you click ready, not sure why it stopped porting.

As far as the "ready" text it seems you can only get him to fire that text if you click a saylink you previously clicked, no clue whats going on here lol.

sub EVENT_SAY {
if($text=~/hail/i) {
plugin::Whisper("Thank the Gods you have awoke $name! We must be quick, we haven't much " . quest::saylink("time", 1) . " !");
quest::setglobal("Odese", 1, 5, "F");
} elsif (defined $qglobals{"Odese"} && $qglobals{"Odese"} == 2) {
plugin::Whisper("Are you " . quest::saylink("ready", 1) . " to start your adventure?");
} elsif (defined $qglobals{"Odese"} && $qglobals{"Odese"} >= 3) {
plugin::Whisper("How did you get here?! Begone!");
quest::zone("freeporttemple");
}
elsif($text=~/time/i) {
plugin::Whisper("Discord is rising! Norrath is being " . quest::saylink("exterminated", 1) . " as we speak!");
quest::setglobal("Hardmode", 1, 5, "F");
}
elsif($text=~/exterminated/i) {
plugin::Whisper("Many braves souls have been lost. Fortunately I was able to create a barrier to surrond our great temple, giving Norrath one final chance! But alas, my " . quest::saylink("power", 1) . " is draining.");
}
elsif($text=~/power/i) {
plugin::Whisper("I created this void to bring me the most powerful Norrath had to offer. You $name , are here by tasked with saving Norrath! Will you " . quest::saylink("accept", 1) . " ?");
}
elsif($text=~/accept/i) {
plugin::Whisper("Fantastic! Hold still as I empower you!");
quest::setglobal("Odese", 2, 5, "F");
quest::level(51);
$client->AddAAPoints(50);
}
elsif($text=~/ready/i) {
plugin::Whisper("Good Luck!");
quest::setglobal("Odese", 3, 5, "F");
quest::zone("freeporttemple");
}
}