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 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
  #2  
Old 03-13-2015, 03:48 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

It's much easier to do it without GetCarriedMoney due to Perl not being able to use int64, as well as the fact this will only work if you have enough money to take directly, in one conditional.
Code:
sub EVENT_SAY { 
    my $Buff = quest::saylink("Buff");
    if ($text =~ /hail/i) {
        quest::say ("For 1 platinum piece per level I can cast a strong health [$Buff] on you.");    
    } elsif ($text =~ /buff/i) {
        if ($client->TakeMoneyFromPP(($ulevel * 1000), 1)) {
            if ($ulevel <= 10) {                
                quest::selfcast(244);
            } elsif ($ulevel > 10 && $ulevel <= 20) {    
                quest::selfcast(312);
            } elsif ($ulevel > 20 && $ulevel <= 30) {
                quest::selfcast(314);
            } elsif ($ulevel > 30 && $ulevel <= 40) {
                quest::selfcast(3692);
            } elsif ($ulevel > 40 && $ulevel <= 50) {
                quest::selfcast(3692);
            } elsif ($ulevel > 50) {
                quest::selfcast(1447);
            }
            $client->Message(2, "Here you go.  Thanks for the donation!");
            $client->Message(5, "$ulevel platinum has been removed from your inventory.");
        }
    }
}
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 05:40 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