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 08-13-2012, 10:45 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

This part:

Code:
Sub EVENT_TIMER {
if ($timer == DT) {
quest::shout("TEST");
if ($timer == Slow) {
quest::shout("TEST");
if ($timer == Nuke) {
quest::shout("TEST");
}
}

You're original posting was correct..the second one is wrong.

Quote:
[event handler] { // this bracket opens event handler procedure

[condition 1] { // this bracket opens condition 1 procedure
do_work_1;
} // this bracket closes condition 1 procedure

[condition 2] { // this bracket opens condition 2 procedure
do_work_2;
} // this bracket closes condition 2 procedure

} // this bracket closes event handler procedure

There could still be other issues, but this is how procedures should be wrapped.

I don't know if perl let's you use single-line conditional statements. If it does, and that's what you're attempting to do,
then the con checks shouldn't have the opening bracket after it.

IF perl does let you, it should look like this. Otherwise you need both open and close brackets around any procedure or
sub-procedure.

Code:
Sub EVENT_TIMER {
	if ($timer == DT)
		quest::shout("TEST");
	if ($timer == Slow)
		quest::shout("TEST");
	if ($timer == Nuke)
		quest::shout("TEST");
}
EDIT: omg..did it really take almost 3 hours to post this?? I'm so dense that I must be warping the very fabric of space-time...
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #2  
Old 08-14-2012, 01:20 AM
wolfwalkereci
Discordant
 
Join Date: Dec 2005
Posts: 435
Default

Here try this.
Also look at this:
Quote:
void quest::settimer(const char *timer_name, int seconds) {
So you basically set it to check DT (death touch?) every 1 second, slow every 2 and nuke every 3 or am I just way tired and reading that wrong.
Code:
sub EVENT_COMBAT {
	if ($combat_state == 1) {
		quest::setnexthpevent(99);
		quest::settimer(DT,1);
		quest::settimer(Slow,2);
		quest::settimer(Nuke,3);
	} else {
		quest::stoptimer("DT");
		quest::stoptimer("Slow");
		quest::stoptimer("Nuke");
		quest::depop();
	}
}

sub EVENT_HP {
	if($hpevent <= 99 && $hpevent >= 98) {
		quest::shout2("You dare face the might of Vishimtar, mortals?!?!!");
		quest::setnexthpevent(75);
	}
	if($$hpevent <= 75 && $hpevent >= 74) {
		quest::shout2("The power of the dragon ancients grows inside of me!");
		quest::setnexthpevent(50);
	}
	if($hpevent <= 50 && $hpevent >= 49) {
		quest::shout2("I...am...the Destroyer!!!");
		quest::setnexthpevent(25);
	}
	if($hpevent <= 25 && $hpevent >= 24) {
		quest::shout2("Arrghh! You will not defeat me!");
	}
}

Sub EVENT_DEATH {
	quest::shout2("Ahh.. My power was not.... Strong enough...");
	quest::stoptimer(DT);
	quest::stoptimer(Slow);
	quest::stoptimer(Nuke);
}

Sub EVENT_SLAY {
	quest::shout("You cannot stand yourself against a dragon god $name!");
}

Sub EVENT_TIMER {
	if ($timer == DT) {
		quest::shout("TEST"); }
	if ($timer == Slow) {
		quest::shout("TEST"); }
	if ($timer == Nuke) {
		quest::shout("TEST"); }
}
Reply With Quote
Reply

Thread Tools
Display Modes

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 03:42 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