View Single Post
  #1  
Old 03-13-2015, 02:59 PM
Lord of Steel
Fire Beetle
 
Join Date: Feb 2014
Posts: 17
Default Buffbot with Links and Scaling Costs

Here is a script that gives you a clickable link when you hail the cleric buffbot NPC. The cost and the spell casted scale depending on level.
Code:
sub EVENT_SAY { 
my $GetPlayerID = $client->GetID();
my $GetMoney = $client->GetCarriedMoney();
	my $Buff = quest::saylink("Buff",0,"Buff");
	if($text=~/hail/i)
	{
		quest::say ("For 1 platinum piece per level I can cast a strong health [$Buff] on you.");	
	}


	
	if($text=~/buff/i)
	{
		if($GetMoney >= $ulevel *1000)
		{
			$client->TakeMoneyFromPP($ulevel * 1000, true);
			if ($ulevel<11)
			{				
				$npc->CastSpell(244, $GetPlayerID, 10,0,0,0 );
			}
			if ($ulevel >10 && $ulevel<21)
			{				
				$npc->CastSpell(312, $GetPlayerID, 10,0,0,0 );
			}
			if ($ulevel >20 && $ulevel<31)
			{
				$npc->CastSpell(314, $GetPlayerID, 10,0,0,0 );
			}
			if ($ulevel >30 && $ulevel<41)
			{
				$npc->CastSpell(3692, $GetPlayerID, 10,0,0,0 );
			}
			if ($ulevel >40 && $ulevel<51)
			{
				$npc->CastSpell(3692, $GetPlayerID, 10,0,0,0 );
			}
			if ($ulevel >50)
			{
				$npc->CastSpell(1447, $GetPlayerID, 10,0,0,0 );
			}
			$client->Message(2, "Here you go.  Thanks for the donation!");
			$client->Message(5, "$ulevel platinum has been removed from your inventory.");
		}
	}
}
Reply With Quote