View Single Post
  #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