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.