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

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

Reply
 
Thread Tools Display Modes
  #16  
Old 09-15-2010, 11:21 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

Quote:
Originally Posted by Reynin89 View Post
I tried changing the integer like u said so now its but its still just casting on me when I go near him.
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);
    quest::stoptimer("test");
  }
}
Reply With Quote
  #17  
Old 09-15-2010, 11:25 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

Quote:
Originally Posted by joligario View Post
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.
Yep, I'm aware that it cycles, it's just habitual as it I use the same formatting in many other scripts that require a stop, sometimes templates are copy/pasted too and find/replaced. I appreciate you pointing it out. 8 D
Reply With Quote
  #18  
Old 09-15-2010, 11:39 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

What do you want him to do? According to the code you have given, he is acting as intended. If you aggro the NPC, his combat state changes to 1. If you are standing near him when he repops, he will isntantly aggro you. If you want to test it, you should try turning on your GM flag (#gm on) so that he won't aggro you until you attack him.
Reply With Quote
  #19  
Old 09-15-2010, 04:30 PM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

Well hes non kos, and he shouldnt be casting the spell on a random player that just runs by. Hes an indifferent mob.
Reply With Quote
  #20  
Old 09-15-2010, 04:45 PM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

Yea when I add in that extra stoptimer, the mob will only cast the spell once, instead of on the timer.
Quote:
sub EVENT_COMBAT {
if ($combat_state == 1) {
quest::settimer("test",3); }

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


sub EVENT_TIMER
{
if($timer eq "test")
{
quest::castspell(92,$targetid);
quest::stoptimer("test");

}
}
Reply With Quote
  #21  
Old 09-15-2010, 08:09 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default

I find it hilarious that you have been given a ton of examples of proper formatting and you still don't use a tab or space for anything. You will go far...
Reply With Quote
  #22  
Old 09-15-2010, 08:58 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

Quote:
Originally Posted by Caryatis View Post
I find it hilarious that you have been given a ton of examples of proper formatting and you still don't use a tab or space for anything. You will go far...
I find it hilarious that you are a critic, yet the subject that you are mentioning was not brought up in this thread, therefore he is supposed to assume that he needs to do that (which he doesn't, but it certainly helps.)
Reply With Quote
  #23  
Old 09-15-2010, 09:28 PM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

Im sorry... Im very new to this, I cant find any of my old timer scripts to look off of. Ive read the examples I just still cant figure it out. Im still studying it. I just dont understand. Ive read tutorials on the site and the GeorgeS Tools lexicon page. Im trying. But I just cant get the darn thing to loop, but stop when the mob isnt in combat.

And as far as your
Quote:
You will go far...
Caryatis, I enjoy scripting and learning new things, and ill keep studying and practicing it and I will go far. Not everyone can start off a pro.
Reply With Quote
  #24  
Old 09-15-2010, 10:00 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default

Not to derail your thread anymore but its all part of the package. Nobody had to tell me to format things a certain way, I looked at examples and thought "damn that does make it alot easier to read and see errors." So when somebody is coming here asking about problems(and if you read the whole thread, he initially had syntax errors as well) and doesnt decide to make his code both more readable for him and for his audience, I do find it hilarious.

Either way our style is totally different Secrets but I can guarantee this guy will use more legible formatting from now on, so I count it as a victory
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 01:24 PM.


 

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