Thread: plugin::vtell
View Single Post
  #2  
Old 12-19-2010, 04:01 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default plugin::Autovtell();

Made an addition to this plugin in general, made another case for it though.

##plugin::Autovtell("greet/battle/disagree/follow/greet/heal/help/laugh/part/retreat/stop/thanks");

Usage:
plugin::Autovtell("greet");

What it does is return a greeting for the npc that this plugin is on based on their gender and race, very simple concept.

Update from the revision to cleanly put it in your group of plugins.

Inserted into the existing voice_tell.pl



Code:
##plugin::Autovtell("greet/battle/disagree/follow/greet/heal/help/laugh/part/retreat/stop/thanks");
##Automatically converts the race ID and Gender into a format the voicetell object understands
sub Autovtell
{
	my $GreetName = $_[0];
	my $npc = plugin::val('$npc');
	my $GetGender = $npc->GetGender();
	my $GetRace = $npc->GetRace();
		%GreetId2 = (
		"agree" => 1,
		"battle" => 2,
		"disagree" => 3,
		"follow" => 4,
		"greet" => 5,
		"heal" => 6,
		"help" => 7,
		"laugh" => 8,
		"part" => 9,
		"retreat" => 10,
		"stop" => 11,
		"thanks" => 12,
		);
		
		%RaceID2 = (
		1 => 0,
		2 => 1,
		3 => 2,
		4 => 3,
		5 => 4,
		6 => 5,
		7 => 6,
		8 => 7,
		9 => 8,
		10 => 9,
		11 => 10,
		12 => 11,
		128 => 12,
		130 => 15,
		330 => 13,
		);
		
		%Gender = (
		0 => 2,
		1 => 3,
		);
		
		
	my $name = plugin::val('$name');
	quest::voicetell($name, $GreetId2{$GreetName}, $RaceID2{$GetRace}, $Gender{$GetGender});
}
Reply With Quote