Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 01-02-2010, 11:16 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

Code:
#!/usr/bin/perl
 
# Level => (Cost, Buff set)
# Hash is iterated over, and as soon as player level is >= to hash level,
# cost is applied
# offers same buffs regardless of level
my %pbuffs =
(
	65 => { cost => 1000, set => 'high' },
	55 => { cost => 500,  set => 'general' },
	45 => { cost => 450,  set => 'general' },
	30 => { cost => 300,  set => 'general' },
	15 => { cost => 150,  set => 'general' },
	0  => { cost => 0,    set => 'general' }
);

# Buff sets. Referenced by pbuffs, changed for donator zone
my %buffset =
(
	general => [1598, 1776, 1693, 1939, 3692, 356, 3299, 13],
	high    => [2112, 2517, 2570, 1939, 3467, 5317, 3299, 13]
);

# Returns pbuff value for level
# Args: level
sub getpb
{
	my $level = shift;

	foreach $key (reverse sort keys %pbuffs)
	{
		if ($level >= $key)
		{
			return $pbuffs{$key};
		}
	}
}

# Casts buffs given a name
# Args: array of spells
sub castspells
{
	foreach $spell (@_)
	{
		quest::selfcast($spell);
	}
}

# Returns buff set for level
sub getbuffset
{
	return @{$buffset{getpb(shift)->{'set'}}};
}

sub EVENT_SAY 
{
	my $saylink1 = quest::saylink("buffs");

	my @buffs = getbuffset($ulevel);

	if ($text =~ /hail/i)
	{
		quest::say("If you want some [$saylink1] just let me know.");
	}
	elsif ($text =~ /buffs/i)
		{
			castspells(@buffs);
			

				quest::say("Here you go $name!");
		}
	
}
I didn't bother changing half the things here from my old buffbot on x5, but... yeah.
Reply With Quote
 


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 09:46 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3