|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Quests::Q&A This is the quest support section |
 |
|
 |

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

03-08-2022, 04:17 PM
|
Fire Beetle
|
|
Join Date: Mar 2022
Posts: 1
|
|
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.
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");
}
}
|
 |
|
 |
Thread Tools |
|
Display Modes |
Hybrid Mode
|
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 03:33 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |