Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #15  
Old 12-08-2020, 12:55 PM
Liontooth
Fire Beetle
 
Join Date: Dec 2020
Posts: 22
Default

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:34 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3