Log in

View Full Version : perminent dancing npc


pepsiphreak79
12-12-2011, 01:02 PM
I havnet found a way to make my npc permanently dance yet
Does anyone have a way to make a doanim stay on?
or do i need to make it just loop over and over somehow?

Im trying to craft up a stripper club ;) where the npcs are dancing non stop till you hail them and get the adult epic im gonna work on then they go back to dancing

dr00dguy
12-12-2011, 01:45 PM
I'm not a coder by any means but I would think using a timer would do the trick.



sub EVENT_SPAWN {

quest::settimer("dance",1);
}

sub EVENT_TIMER {

if ($timer eq "dance")
{
quest::doanim(58);
}
}

LordAdakos
12-14-2011, 05:15 PM
that would work, but you'd need to make it reset the timer in the timer event, so it will loop

dr00dguy
12-14-2011, 05:30 PM
yah noticed that after i posted but was to late to edit lol. and I am sure there is a better way to do it, but its a start.


sub EVENT_SPAWN {

quest::settimer("dance",1);
}

sub EVENT_TIMER {

if ($timer eq "dance")
{
quest::doanim(58);
quest::settimer("dance",1);
}
}

joligario
12-14-2011, 05:40 PM
Timers are already set to repeat.

Aeryn
12-14-2011, 05:56 PM
this is one that i use, for some npcs
sub EVENT_SPAWN {
quest::settimer("dance6", 2);
}

sub EVENT_TIMER {
if($timer eq "dance6") {
my $anivar1 = quest::ChooseRandom(58, 59, 60, 63, 62);
quest::doanim($anivar1);
}
}

change numbers if you want different animations

pepsiphreak79
12-18-2011, 04:38 AM
wow thx guys Im working on writing a few custom quests involving many zones and lvls and that includeds an adult themed quest ;) naughty language and actions lol i just got stuck with that pemra dance lol i so far havnt got the just of most the advanced or eq specific codings only the simple stuff ...
Task system for instance but i never did like it anyway lol so im making this all old school text quest with saylinks for slow typers kinda writing a custom epic later on once i get each quest built in the future ill post when i can a full .pl source of each npc and ill post all sql additions or possibly zip each full quest up and post that way im workin on all at once as somthing strikes me to add i add it its slow cause of the coding and life has me so occupied that writing a few long arse stories is not on the top of the list lol

pepsiphreak79
12-18-2011, 05:41 AM
ty for the help here is the base code that triggers her on approach to dance

ill be adding more things at some date like starting in a robe and taking it off with the modelchange when she is given plat

sub EVENT_SPAWN
{
plugin::SetProx(20, 10);
}

sub EVENT_ENTER {
quest::shout("I'm ready to get dirty Are you?");
quest::settimer("dance",1);
}

sub EVENT_EXIT {
quest::say("Come back any time!");
quest::stoptimer("dance");;
}

sub EVENT_TIMER {

if ($timer eq "dance")
{
quest::doanim(58);
quest::settimer("dance",1);
}
}




sub EVENT_SAY {
if($text =~ /Hail/i) {
quest::say("Hello $name");
quest::setanim(58);
}
}




added this to my anim.pl plugin

#Akkadius
#Usage plugin::SetProx(X/Y Axis Range, Z Axis Range);
sub SetProx{
my $Range = $_[0];
my $Z = $_[1];
my $x = plugin::val('$x');
my $y = plugin::val('$y');
my $npc = plugin::val('$npc');
my $z = $npc->GetZ();
quest::set_proximity($x - $Range, $x + $Range, $y - $Range, $y + $Range, $z - $Z, $z + $Z);
}