|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Plugins & Mods Completed plugins for public use as well as modifications. |
|
|
|
05-05-2010, 01:09 PM
|
|
Administrator
|
|
Join Date: Feb 2009
Location: MN
Posts: 2,071
|
|
plugin::DoAnim && plugin::SetAnim
So as I work on BotA, and I use as many things to liven NPC's up as possible. I thought hrm, there should be an easily little plugin where you could simply type in the name of the animation in the plugin instead of memorizing integers.
This plugin can go in the same file, and has two uses:
Code:
plugin::DoAnim(wave); ### NPC will wave
plugin::SetAnim(dead); ### NPC will permanently lay dead
You can refer to the list of animations in the plugin, the strings should be a lot easier to memorize than integers...
I may make some revisions to this plugin but this should help you all out quite a bit...
Just call it npcanimations.pl in your plugin folder and you should be set!
Gotta jet!
Code:
sub DoAnim {
###Usage: plugin::DoAnim(salute);
my $client = plugin::val('$client');
my $text = $_[0];
%Animlist = (
"kick" => 1,
"pierce" => 2,
"2hslash" => 3,
"2hblunt" => 4,
"2hpierce" => 4,
"throw" => 5,
"offhand" => 6,
"bash" => 7,
"mainhand" => 8,
"bow" => 9,
"swim" => 10,
"roundkick" => 11,
"gethit" => 12,
"gethit2" => 13,
"falling" => 14,
"drowning" => 15,
"death" => 16,
"standby" => 17,
"standby2" => 18,
"lunge" => 19,
"jump" => 20,
"falling2" => 21,
"duckwalk" => 22,
"ladderclimb" => 23,
"crouch" => 24,
"swim2" => 25,
"idle" => 26,
"cheer" => 27,
"disgusted" => 28,
"wave" => 29,
"rude" => 30,
"yawn" => 31,
"movetoside" => 33,
"iceslide" => 35,
"kneel" => 36,
"swim3" => 37,
"sit" => 38,
"cast" => 42,
"cast2" => 43,
"cast3" => 44,
"flykick" => 45,
"tigerclaw" => 46,
"eaglestrike" => 47,
"nodyes" => 48,
"shakeno" => 49,
"plead" => 50,
"clap" => 51,
"blush" => 52,
"chuckle" => 54,
"headtilt" => 57,
"dance" => 58,
"disagree" => 59,
"glare" => 60,
"peer" => 61,
"kneel" => 62,
"laugh" => 63,
"point" => 64,
"shrug" => 65,
"handraise" => 66,
"salute" => 67,
"shiver" => 68,
"tapfoot" => 69,
"bowto" => 70,
);
quest::doanim($Animlist{$text});
}
sub SetAnim {
##Usage: plugin::SetAnim(sit);
my $npc = plugin::val('$npc');
my $SetAnimVal = $_[0];
%SetAnimList = (
"stand" => 0,
"sit" => 1,
"duck" => 2,
"dead" => 3,
"kneel" => 4,
);
$npc->SetAppearance($SetAnimList{$SetAnimVal});
}
return 1;
|
|
|
|
05-05-2010, 03:25 PM
|
Sarnak
|
|
Join Date: May 2008
Posts: 70
|
|
Well thats going to make for some interesting npc to player interaction.
- Nice job boss.
|
|
|
|
05-05-2010, 03:33 PM
|
|
Administrator
|
|
Join Date: Feb 2009
Location: MN
Posts: 2,071
|
|
Script examples: (Pardon some of the slop organization as it warped on copy and paste)
Code:
sub EVENT_SAY
{
if($text=~/Hail/i){
quest::say("Well hello there ol' lad! How are yeh today!");
plugin::DoAnim(wave);
}
if($text=~/repond to text above/i){
quest::say("Hah! If you weren't such a kidder $name I'd call yeh a fool!");
plugin::DoAnim(laugh);
}
}
This would be a diseased Iksar in the overthere theme people will see. Lays on the ground dead after spawn to avoid clients from seeing them standing up right using the timer instead of straight up using it in a sub EVENT_SPAWN:
Code:
sub EVENT_SPAWN
{
quest::settimer("Die",1);
$x = $npc->GetX();
$y = $npc->GetY();
$z = $npc->GetZ();
quest::set_proximity($x - 5, $x + 5, $y - 5, $y + 5, $z - 4, $z + 4);
}
sub EVENT_TIMER {
if($timer eq "Die") {
quest::stoptimer("Die");
plugin::SetAnim(dead);
}
}
sub EVENT_ENTER {
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
$client->Message(15, "The Iksar appears to be a test subject instead of using their own race, the Shissar.");
}
}
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 08:10 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|