View Single Post
  #4  
Old 06-27-2017, 09:54 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Sounds like you didn't replace $userid with $client?

As noted in the remarks within the code, I would probably have used a hash, but I didn't want the revision to deviate too much from your original.
Code:
## I would have made a hash for the spells and their corresponding minimum levels but keeping it relatively like the old
## so too much isn't change all at once

sub EVENT_SAY {
	if($text=~/Hail/i) {
		$client->Message(315, "Hello, $name. Do you need some [".quest::saylink("Buffs", 1)."? Or maybe you're in need of some [".quest::saylink("Healing", 1)."?'");
	}
	elsif($text=~/Healing/i) {
		$npc->SpellFinished(13, $client);
		$client->Message(315, "You have been healed, $name");
	}
	elsif($text=~/Buffs/i) {			
		$npc->SpellFinished(60, $client);
		$npc->SpellFinished(61, $client);
		$npc->SpellFinished(62, $client);
		$npc->SpellFinished(63, $client);
		$npc->SpellFinished(64, $client);
		if ($ulevel >= "61") {
			$npc->SpellFinished(5257, $client);
			$npc->SpellFinished(5258, $client);
			$npc->SpellFinished(5261, $client);
		}
		elsif (($ulevel >= "47") && ($ulevel < "61")) {
			$npc->SpellFinished(3467, $client);
			$npc->SpellFinished(3472, $client);
			$npc->SpellFinished(4091, $client);
			$npc->SpellFinished(3469, $client);
		}
		elsif ($ulevel == "46") {
			$npc->SpellFinished(3467, $client);
			$npc->SpellFinished(3472, $client);
			$npc->SpellFinished(4091, $client);
			$npc->SpellFinished(1548, $client);
		}
		elsif ($ulevel == "45") {
			$npc->SpellFinished(1447, $client);
			$npc->SpellFinished(3576, $client);
			$npc->SpellFinished(4090, $client);
			$npc->SpellFinished(1548, $client);
		}
		elsif ($ulevel >= "43") {
			$npc->SpellFinished(3692, $client);
			$npc->SpellFinished(3576, $client);
			$npc->SpellFinished(4090, $client);
			$npc->SpellFinished(1548, $client);
		}
		elsif ($ulevel <= "42") {
			$npc->SpellFinished(3692, $client);
			$npc->SpellFinished(3576, $client);
			$npc->SpellFinished(4089, $client);
		}
		$client->Message(315, "It's Dangerous to adventure alone, Take this and stay safe");
	}
}
Reply With Quote