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

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

Reply
 
Thread Tools Display Modes
  #1  
Old 12-24-2021, 11:04 AM
Jorin
Sarnak
 
Join Date: Aug 2018
Posts: 48
Default Custom globalplayer issues, please help

So I have these in my globalplayer.pl And made sure to remove the lua version.

The level up event does the autotrain up to lvl 51 no issues. My problem is its only scribing a few spells not lvl 1 to 51, which is probably pretty simple fix its just frustrated me. But the big issue im having with it is the 2nd part, I made a npc to set my global to Hardmode 1 but when I level up to 70 im not getting the message saying I completed.

Code:
sub EVENT_LEVEL_UP {
    if ($ulevel <= 51) {
		$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, 70 .. 74 ) {
			next unless $client->CanHaveSkill($skill);
			my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
			next unless $maxSkill > $client->GetRawSkill($skill);
			$client->SetSkill( $skill, $maxSkill );
		}
		# scribe all spells for current level
		quest::scribespells( $ulevel, $ulevel - 1 );
		# train all discs for current level
		quest::traindiscs( $ulevel, $ulevel - 1 );
	}
	elsif((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 1) && ($ulevel == 70)) {
        $client->Message( 15, "You have completed Hardmode! Congratulations here is your reward!" );
        quest::summonitem();
        quest::setglobal("Hardmode", 2, 5, "F");
     } 
	}


The 2nd one im trying to make it reset your level when you die and delete your corpses if Hardmode = 1. It doesnt appear to work at all for some reason.

Code:
sub EVENT_DEATH {
    if((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 1) && ($ulevel <= 69)) {
        quest::setlevel(51);
        $client->Message( 15, "Hardmode Enabled. Your level and skills have reset as punishment for your death!" );
                my $CorpseCount = 0;
                my $charid = $client->CharacterID();
			my $corpse = $entity_list->GetCorpseByOwner($client);
            $client->Message(15,"Your corpse has been removed.");
            $corpse->Delete();
        }
    elsif((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 1) && ($ulevel >= 70)) {
        quest::setlevel(70);
          $client->Message( 15, "Hardmode Enabled. Your level and skills have reset as punishment for your death!" );
                my $CorpseCount = 0;
                my $charid = $client->CharacterID();
			my $corpse = $entity_list->GetCorpseByOwner($client);
            $client->Message(15,"Your corpse has been removed.");
            $corpse->Delete();
        }
    elsif((defined $qglobals{"Hardmode"} && $qglobals{"Hardmode"} == 2) && ($ulevel == 75)) {
        $client->Message( 15, "Hardmode Enabled. As a reward for completing Hardmode, your punishment is waved!" );
    }
}

Any insight would be awesome as Ive been messing with these for days and am getting nowhere.
Reply With Quote
  #2  
Old 12-25-2021, 12:22 PM
Jorin
Sarnak
 
Join Date: Aug 2018
Posts: 48
Default

Fixed the spell scribe issue. Was just a dumb mistake on my end. However the Hardmode check and system message upon reaching 70 is still not working, cant seem to figure it out. And the death event is not working either. Does not reset level or delete your corpse.
Reply With Quote
  #3  
Old 12-29-2021, 06:59 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

Code:
sub EVENT_DEATH {
  # leave early if hard mode not set
  return unless (defined $qglobals{'hardmode'});
  if ($qglobals{'hardmode'} == 1) {
    # $my CorpseCount = 0 does nothing
    # $charid isn't being used at all
    $client->Message(15, "LoL!");
    # one set level statement for both conditions
    quest::setlevel($ulevel < 70 ? 51 : 70);
  } elsif ($qglobals{'hardmode'} == 2) {
    # ...
  }
}
Cutting down on repetition and using things like strict mode will help you troubleshoot your scripts.
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #4  
Old 02-07-2022, 05:51 PM
Jorin
Sarnak
 
Join Date: Aug 2018
Posts: 48
Default

Still doesnt appear to be working correctly will have to do more testing I suppose. Kind of left it on the back burner
Reply With Quote
Reply


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:26 PM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3