|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
|
|
|
12-05-2020, 10:07 PM
|
Fire Beetle
|
|
Join Date: Dec 2020
Posts: 22
|
|
Broke a few quests
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!
Code:
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
Code:
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
Code:
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;
}
}
}
|
|
|
|
12-06-2020, 12:19 PM
|
Developer
|
|
Join Date: Jul 2007
Location: my own little world
Posts: 751
|
|
1st:
You have an else in the middle of a bunch of elsif's
Code:
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
Code:
if (defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 1) && ($ulevel <= 60) { {
Code:
if (defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 4) && ($ulevel <= 69) { {
|
|
|
|
12-06-2020, 05:54 PM
|
Fire Beetle
|
|
Join Date: Dec 2020
Posts: 22
|
|
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:
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");
}
}
}
|
|
|
|
12-06-2020, 05:56 PM
|
Fire Beetle
|
|
Join Date: Dec 2020
Posts: 22
|
|
Also doesnt appear to be setting globals when following text. When hailed I only get the response from the first line
|
12-07-2020, 12:10 AM
|
Hill Giant
|
|
Join Date: Dec 2015
Posts: 116
|
|
Make sure your NPC has qglobals turned on.
~didn't read the code, so I'm no help there~
|
12-07-2020, 06:21 AM
|
Fire Beetle
|
|
Join Date: Dec 2020
Posts: 22
|
|
Quote:
Originally Posted by Sturm
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
|
12-07-2020, 08:18 AM
|
Fire Beetle
|
|
Join Date: Dec 2020
Posts: 22
|
|
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
|
12-07-2020, 01:11 PM
|
Developer
|
|
Join Date: Jul 2007
Location: my own little world
Posts: 751
|
|
Quote:
Originally Posted by Congdar
2nd: and 3rd:
Possibly too many braces
Code:
if (defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 1) && ($ulevel <= 60) { {
Code:
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?
Last edited by Congdar; 12-07-2020 at 03:03 PM..
|
12-07-2020, 04:27 PM
|
Fire Beetle
|
|
Join Date: Dec 2020
Posts: 22
|
|
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
|
12-07-2020, 07:44 PM
|
Developer
|
|
Join Date: Jul 2007
Location: my own little world
Posts: 751
|
|
Quote:
Originally Posted by Liontooth
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
|
Code:
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.
|
12-07-2020, 08:13 PM
|
|
Fire Beetle
|
|
Join Date: Jun 2015
Location: Canada
Posts: 28
|
|
Rather than
quest::setlvl(51);
quest::setaa(50);
Try
quest::level(51);
$client->AddAAPoints(50);
|
12-08-2020, 06:55 AM
|
Fire Beetle
|
|
Join Date: Dec 2020
Posts: 22
|
|
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.
|
|
|
|
12-08-2020, 07:04 AM
|
Fire Beetle
|
|
Join Date: Dec 2020
Posts: 22
|
|
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.
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::level(51);
$client->AddAAPoints(50);
}
elsif($text=~/ready/i) {
plugin::Whisper("Good Luck!");
quest::setglobal("Odese", 3, 5, "F");
quest::zone("freeporttemple");
}
}
|
|
|
|
|
|
|
12-08-2020, 12:55 PM
|
Fire Beetle
|
|
Join Date: Dec 2020
Posts: 22
|
|
Rewrote first code completely and now works fine
Code:
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
Code:
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
Code:
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!" );
}
}
|
|
|
|
|
|
|
12-08-2020, 01:34 PM
|
Developer
|
|
Join Date: Jul 2007
Location: my own little world
Posts: 751
|
|
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.
Code:
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!" );
}
}
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 01:39 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|