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, 05:02 AM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default Anyone see an issue..?

Just curious, its been a loooong while since ive scripted anything, and i was never like the BEST but i considered myself pretty decent. Anyway computer got fried lost all scripts trying to rebuild, anyone see why this wouldnt work? Please and thank u for responses.

Code:
	sub EVENT_SPAWN {
quest::setnexthpevent(99);	
quest::settimer(DT,1); 	
quest::settimer(Slow,2);	
quest::settimer(Nuke,3);	
}


	sub EVENT_HP {
if ($hpevent == 99) {
quest::shout2("You dare face the might of Vishimtar, mortals?!?!!");
quest::setnexthpevent(75);}

if ($hpevent == 75) {
quest::shout2("The power of the dragon ancients grows inside of me!");
quest::setnexthpevent(50);}

if ($hpevent == 50) {
quest::shout2("I...am...the Destroyer!!!");
quest::setnexthpevent(25);}

if ($hpevent == 25) {
quest::shout2("Arrghh! You will not defeat me!");
quest::setnexthpevent(1);}

if ($hpevent == 1) {
quest::shout2("Ahh.. My power was not.... Strong enough...");
}

Sub EVENT_DEATH {
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::selfcast(6646);
}
if ($timer == "Slow") {
quest::selfcast(15236);
}
if ($timer =="Nuke") {
quest::selfcast(9051);
}
}
Again, thanks in advance!
Reply With Quote
  #2  
Old 08-13-2012, 05:14 AM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Start with putting a closing bracket on your 'sub EVENT_HP' procedure.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #3  
Old 08-13-2012, 05:18 AM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

Ok great now hes shouting properly, but not casting the spells now it looks like
Quote:
sub EVENT_SPAWN {
quest::setnexthpevent(99);
quest::settimer(DT,1);
quest::settimer(Slow,2);
quest::settimer(Nuke,3);
}


sub EVENT_HP {
if ($hpevent == 99) {
quest::shout2("You dare face the might of Vishimtar, mortals?!?!!");
quest::setnexthpevent(75);}

if ($hpevent == 75) {
quest::shout2("The power of the dragon ancients grows inside of me!");
quest::setnexthpevent(50);}

if ($hpevent == 50) {
quest::shout2("I...am...the Destroyer!!!");
quest::setnexthpevent(25);}

if ($hpevent == 25) {
quest::shout2("Arrghh! You will not defeat me!");
quest::setnexthpevent(1);}

if ($hpevent == 1) {
quest::shout2("Ahh.. My power was not.... Strong enough...");
}
}

Sub EVENT_DEATH {
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::selfcast(6646);
}
if ($timer == "Slow") {
quest::selfcast(15236);
}
if ($timer == "Nuke") {
quest::selfcast(9051);
}
}
I didnt know u could do a double close bracket i thought that was for the end ^_^

Oh and its set for 1 2 and 3 sec just for testing, not sure if that will make a difference?
Reply With Quote
  #4  
Old 08-13-2012, 05:42 AM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

It's just a matter of closing what you open (refrigerator doors, toilet seats, etc...)


I'm not 'real' familiar with timers in script..but are the settimer names suppose to be in quotes as well in EVENT_SPAWN?

You can always put a test message in your timer checks to verify script operation as well..even if the server isn't
processing every casting call.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #5  
Old 08-13-2012, 05:49 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

if i had to guess, i would say that you can't use quest::selfcast() in EVENT_TIMER because it should be looking for the client that initiated the event.

i'd suggest starting those timers only when the npc was engaged (as well as stopping them when it is disengaged instead of just dead) and then pulling the target for the spell from the npc's hate list, since there is no need for the timers to be running constantly.
Reply With Quote
  #6  
Old 08-13-2012, 05:51 AM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

How would i make the cast do it on a target rather then selfcast then if u dont mind? And ill just keep messing with it more and hopefully figure it out thx guys
Reply With Quote
  #7  
Old 08-13-2012, 05:52 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

oh, yeah... it could be the syntax issue uleat just pointed out as well.
Reply With Quote
  #8  
Old 08-13-2012, 05:57 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

$npc->CastSpell(spellid,targetid) should work to target an individual.

examples:
$npc->CastSpell(6646, $npc->GetHateRandom()); // DT random hated client
$npc->CastSpell(15236, $npc->GetHateDamageTop()); // slow client that has done the most damage
$npc->CastSpell(9051, $npc->GetHateTop()); // nuke most hated client
Reply With Quote
  #9  
Old 08-13-2012, 06:12 AM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

I assume that you know about this:

http://www.eqemulator.net/wiki/wikka...=QuestTutorial


You can always check the source definitions for any changes since this was made.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #10  
Old 08-13-2012, 06:13 AM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

great thanks i appreciate it u guys!
Reply With Quote
  #11  
Old 08-13-2012, 06:16 AM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

Ah 1 last thing, if the spell is a PB aoe it shouldnt matter which GetHate blah blah i type in correct?
Reply With Quote
  #12  
Old 08-13-2012, 06:21 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

i'm not sure if it checks for valid range to target and whatnot, but it should hit everyone in range of the AoE, if that's what you mean.
Reply With Quote
  #13  
Old 08-13-2012, 06:21 AM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

Ok thanks again!
Reply With Quote
  #14  
Old 08-13-2012, 07:28 PM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

been working on this all day again trying stuff i assume now its sumthing wrong with how the timers r set up cuz im trying to have him shout on a timer and thats not working either >_<

Quote:
sub EVENT_AGGRO {
quest::setnexthpevent(99);
quest::settimer(DT,1);
quest::settimer(Slow,2);
quest::settimer(Nuke,3);
}


sub EVENT_HP {
if($hpevent == 99) {
quest::shout2("You dare face the might of Vishimtar, mortals?!?!!");
quest::setnexthpevent(75);}

if($hpevent == 75) {
quest::shout2("The power of the dragon ancients grows inside of me!");
quest::setnexthpevent(50);}

if($hpevent == 50) {
quest::shout2("I...am...the Destroyer!!!");
quest::setnexthpevent(25);}

if($hpevent == 25) {
quest::shout2("Arrghh! You will not defeat me!");
quest::setnexthpevent(1);}

if($hpevent == 1) {
quest::shout2("Ahh.. My power was not.... Strong enough...");
}
}

Sub EVENT_DEATH {
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");
}
}
Any noticeable issues?
Reply With Quote
  #15  
Old 08-13-2012, 07:33 PM
Reynin89
Sarnak
 
Join Date: Apr 2010
Posts: 71
Default

Also I used a perl script checker and got this

Quote:
syntax error at Script line 33, near "quest::stoptimer" syntax error at Script line 35, near "}" Script had compilation errors.
I cant seem to find whats goin on tho -.-

..I put it in GeorgeS Tools and it says im missng a right bracket } I just CANNOT figure out where
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 07:12 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3