Thread: Say Links
View Single Post
  #16  
Old 04-22-2009, 07:31 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Just figured out a pretty cool bonus to this new varlink quest command. Since it only requires the item ID, it makes it very easy to create arrays of items to use for a script that can be called on for creating itemlinks in say messages, or for item turn ins. So, you could have a single array that handles both, which would make things more simple and less likely to have mistakes.

Here is an example:

Code:
%epic = ("Warrior" => 60321, "Rogue" => 52347, "Monk" => 61025, "Berserker" => 18398, "Shadowknight" => 50003, "Paladin" => 64031, "Ranger" => 62627, "Bard" => 77631, "Beastlord" => 52911, "Cleric" => 9955, "Druid" => 62863, "Shaman" => 57400, "Wizard" => 12665, "Magician" => 19092, "Enchanter" => 52952, "Necromancer" => 62581);

sub EVENT_SAY {

  my $class_itemlink = quest::varlink($epic{$class});

  if($text=~/hail/i) {
      quest::say("The $class epic 1.5 is $class_itemlink.  Turn in a Cloth Cap to get yours!"); }

}

sub EVENT_ITEM {

  my $class_epic = $epic{$class};

  #Extremely simple Epic 1.5 quest (turn in a cloth cap!)
  if (plugin::check_handin(\%itemcount, 1001 => 1)) {
    quest::summonitem($class_epic);
    quest::exp(45000);
    quest::say ("It doesn't get much easier than that!");
  }
}
That is just a basic example and I am sure it could be written much better. But the main point is that it works and could really make handling a large number of items for turn ins and item links in say messages fairly quick to do.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote