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

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

Reply
 
Thread Tools Display Modes
  #1  
Old 09-15-2010, 09:56 AM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default Custom Boss (test)

Ive been messing with timers and I was just wondering if anyone knew why in the world this boss will NOT cast this spell, has equal brackets, ID is correct, syntax looks fine.. so wth?
Code:
sub EVENT_COMBAT {
 if ($combat_state == 1) {
quest::settimer(test,3); }

 if ($combat_state == 0) {
quest::stoptimer(test); }


sub EVENT_TIMER
{
if($timername == test)
{
quest::castspell($userid,92);

}
}}

Thanks in advance. Lol im sure its a nub mistake >_<
Reply With Quote
  #2  
Old 09-15-2010, 10:07 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by Reynin89 View Post
Ive been messing with timers and I was just wondering if anyone knew why in the world this boss will NOT cast this spell, has equal brackets, ID is correct, syntax looks fine.. so wth?
Code:
sub EVENT_COMBAT {
 if ($combat_state == 1) {
quest::settimer(test,3); }

 if ($combat_state == 0) {
quest::stoptimer(test); }
}

sub EVENT_TIMER
{
if($timername == test)
{
quest::castspell($userid,92);
quest::stoptimer("test");
}
}}

Thanks in advance. Lol im sure its a nub mistake >_<
Red is an extra bracket, Dark Orange is a missing bracket, and Blue needs to be 'eq' for an equal operator for strings, not integers. Test will work but you also want to quote your strings so it would be "test" in your script. You will also want to stop timer in your script or else it will loop.
Reply With Quote
  #3  
Old 09-15-2010, 10:09 AM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

Ahhh great thank you Akkadian!
Reply With Quote
  #4  
Old 09-15-2010, 10:15 AM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

Hm.. Well right now I have

Code:
sub EVENT_COMBAT {
 if ($combat_state == 1) {
quest::settimer(test,3); }

 if ($combat_state == 0) {
quest::stoptimer("test"); }
}


sub EVENT_TIMER
{
if($timername "eq" test)
{
quest::castspell($userid,92);

}
}
and it still wont work. I tried adding quest::stoptimer("test"); into the sub EVENT_TIMER like u said, and it still didnt work. I figured because I already had 1 in the combat event? the
Code:
 if ($combat_state == 0) {
quest::stoptimer("test"); }
I need to stay there so that way it will stop casting if aggro drops right?
Reply With Quote
  #5  
Old 09-15-2010, 10:16 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by Reynin89 View Post
Ahhh great thank you Akkadian!
Also forgot about your $timer object, it needs to be $timer. See an example script below.

Code:
sub EVENT_SPAWN{
	my $npc_name = $npc->GetCleanName(); 
	quest::gmsay("$npc_name has spawned in [$zoneln]");
	quest::shout("I have slain many Iksar and any tribe that defies our goals, you mortals know nothing about what is the truth!");
	$npc->CameraEffect(2000, 5);
	quest::settimer("repeatsay",600);
	quest::doanim(44);
}

sub EVENT_TIMER{
	if ($timer eq "repeatsay"){
	quest::shout("I have slain many Iksar and any tribe that defies our goals, you mortals know nothing about what is the truth!");
	$npc->CameraEffect(2000, 5);
	quest::stoptimer("repeatsay");
	quest::settimer("repeatsay",600);
	quest::doanim(44);
	}
}

sub EVENT_COMBAT
{
	my $npc_name = $npc->GetCleanName(); 
	if($combat_state == 1)
		{
		$NextActivate = 90;
		$StartNPCID = 2328802;
		quest::gmsay("$npc_name has been engaged");
		$x = $npc->GetX();
		$y = $npc->GetY();
		$z = $npc->GetZ();
		$h = $npc->GetHeading();
		quest::setnexthpevent(90);
		quest::shout("You dare challenge our existence? The Sethos will never have patience for you...");
		$npc->CameraEffect(2000, 7);
		quest::stoptimer("repeatsay");
		}
	if($combat_state == 0)
		{
		quest::say("You mortals are so pathetic.");
		$npc->CameraEffect(2000, 7);
		quest::settimer("repeatsay", 600);
		plugin::MobHealPercentage(100);
		}
}

sub EVENT_HP
{
if ($hpevent == $NextActivate)
	{
	$NextActivate -= 10;
	$StartNPCID += 1;
	quest::setnexthpevent($NextActivate);
	quest::signalwith($StartNPCID, 10, 10);
	quest::shout("How about fighting some old friends of yours maybe?");
	$npc->CameraEffect(2000, 3);
	}
}

sub EVENT_SLAY{
	quest::say("Hmm another $race at my feet, weak mortal...");
}

sub EVENT_DEATH{
	my $npc_name = $npc->GetCleanName(); 
	quest::gmsay("$npc_name has been slain in [$zoneid] : [$zoneln]");
}
Reply With Quote
  #6  
Old 09-15-2010, 10:22 AM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

Ohhh.. Great thanks so much! Working perfect now
Reply With Quote
  #7  
Old 09-15-2010, 10:26 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

You probably need to learn about strings:

Code:
sub EVENT_COMBAT {
  if ($combat_state == 1) {
    quest::settimer("test",3);
  }
  if ($combat_state == 0) {
    quest::stoptimer("test");
  }
}

sub EVENT_TIMER {
  if($timer eq "test") {
    quest::castspell($userid,92);
  }
}
FYI: From http://www.eqemulator.net/wiki/wikka...=QuestTutorial

quest::castspell(id,spellid) - Casts "spell" on entity with "id". This is buggy, if it does not work try $npc->CastSpell(id,spellid);
Reply With Quote
  #8  
Old 09-15-2010, 10:27 AM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

Bah! I didnt know, its casting it when not even aggro'd if ur near the mob. It will just cast the spell, why is that the case when i have
Quote:
if ($combat_state == 0) {
quest::stoptimer("test"); }
that should make it so if the mob isnt in combat it wont cast it i thought?
Reply With Quote
  #9  
Old 09-15-2010, 10:28 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by Reynin89 View Post
Bah! I didnt know, its casting it when not even aggro'd if ur near the mob. It will just cast the spell, why is that the case when i have
that should make it so if the mob isnt in combat it wont cast it i thought?
Yes, that is correct.
Reply With Quote
  #10  
Old 09-15-2010, 10:29 AM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

oh great guide Joligario ty.
Reply With Quote
  #11  
Old 09-15-2010, 10:30 AM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

But thats why im confused Akkadian, I have that in. But ill attack the mob, itll cast. Ill #repop and as soon as it gets back it starts casting on me again..
Reply With Quote
  #12  
Old 09-15-2010, 10:34 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by Akkadius View Post
Red is an extra bracket, Dark Orange is a missing bracket, and Blue needs to be 'eq' for an equal operator for strings, not integers. Test will work but you also want to quote your strings so it would be "test" in your script. You will also want to stop timer in your script or else it will loop.
Refer to this post.
Reply With Quote
  #13  
Old 09-15-2010, 10:37 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Akkadius: FYI - In your code sample, you don't need to stop and start your repeatsay timer in your timer block above. Just redundant as the timer cycles.
Reply With Quote
  #14  
Old 09-15-2010, 10:45 AM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

Im reading it Akkadius, but im unsure. I am somewhat new and starting to learn scripting.. I mean, im reading that, but im still unsure as to why the mob is casting out of combat when i have that code in there?
Reply With Quote
  #15  
Old 09-15-2010, 10:47 AM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

I tried changing the integer like u said so now its
Quote:
if ($combat_state eq 0) {
quest::stoptimer("test"); }
}
but its still just casting on me when I go near him.
Reply With Quote
Reply


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 08:40 AM.


 

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