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 03-21-2014, 01:48 PM
Esildor
Hill Giant
 
Join Date: Feb 2010
Posts: 207
Default modifynpcstat?

Greetings,

Was trying to add a

Code:
quest::modifynpcstat("runspeed","1");
to one of my scripts, has some adds and I don't like him being permarooted (aggro is a pain for the tank, trying to tank adds and remain close enough to boss so they're top on aggro).

Is there a reason this modifynpcstat doesn't work? Does it matter what sub EVENT it's under? I'm trying to add it under the sub EVENT_TIMER portion of my quest.

Thanks!
Reply With Quote
  #2  
Old 03-21-2014, 09:59 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Doesn't capitalization matter on the quest functions?

If so.. inside the source its written like this...

Code:
quest::ModifyNPCStat("runspeed", 1);
Reply With Quote
  #3  
Old 03-22-2014, 01:09 AM
Esildor
Hill Giant
 
Join Date: Feb 2010
Posts: 207
Default

Quote:
Originally Posted by NatedogEZ View Post
Doesn't capitalization matter on the quest functions?

If so.. inside the source its written like this...

Code:
quest::ModifyNPCStat("runspeed", 1);
Not it, I have other parts in the same script that are:

Code:
quest::modifynpcstat("special_attacks","ABHGZ");
I tried it with capitalization and it still doesn't work.
Reply With Quote
  #4  
Old 03-22-2014, 01:23 AM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

figured it out... if an NPC starts with 0 runspeed in database... no matter how many times you try to edit it with ... ModifyNPCStat it will never change!

So set the NPCs runspeed to 1 or somtehing... and on spawn modifynpcstat it to 0 ... then use whatever timer you need to edit it.

Not sure why it works like this.. but meh


Code:
sub EVENT_SPAWN {
	$npc->ModifyNPCStat("runspeed", 0);
	quest::settimer("ass", 5);
}

sub EVENT_TIMER {
	if($timer eq "ass")
	{
		quest::shout("I am awesome!");
		$npc->ModifyNPCStat("runspeed", 10);
	}
 }

Decided to look it up... and inside mob there is this....

mob.cpp
Code:
float Mob::_GetMovementSpeed(int mod) const {
	// List of movement speed modifiers, including AAs & spells:
	// http://everquest.allakhazam.com/db/item.html?item=1721;page=1;howmany=50#m10822246245352
	if (IsRooted())
		return 0.0f;

inside mob.cpp it seems to also add a flag called "permarooted" if an NPC has 0 runspeed in database (means it cant be altered unless there is another function that I do not know about to remove this flag?)

mob.cpp
Code:
permarooted = (runspeed > 0) ? false : true;
mob.h
Code:
inline const bool IsRooted() const { return rooted || permarooted; }

So.. the IsRooted() is called and puts runspeed back to 0 since it has that permarooted flag :(

So ghetto way to do it works at least... start npc with 1 runspeed.. then set to 0 upon spawn.. then later in the script you can edit the NPCs runspeed..
Reply With Quote
  #5  
Old 03-22-2014, 01:54 AM
Esildor
Hill Giant
 
Join Date: Feb 2010
Posts: 207
Default

Nate,

Currently my script is this:

Code:
#Ghaud

sub EVENT_SPAWN {
  quest::setnexthpevent(76);

sub EVENT_HP {    
  if($hpevent == 76) { 
    quest::settimer(1,120);
    quest::spawn2(9980002,0,0,580,-784.5,-35.6,190);
    quest::spawn2(9980002,0,0,580,-844.5,-27.3,190);
    quest::spawn2(9980002,0,0,520,-784.5,-35.4,190);
    quest::spawn2(9980002,0,0,520,-844.5,-39.7,190);
    quest::modifynpcstat("special_attacks","ABHGZ");
    quest::emote("ports away and releases his minions!");
    quest::shout("Ha, lets see how you do against my minions!");
    $npc->GMMove(472.4,-684.9,-28.5,130.5); 
    $npc->TempName("Ghaud (Invulnerable)");
  }
  if($hpevent == 51) { 
    quest::settimer(2,120);
    quest::spawn2(9980002,0,0,580,-784.5,-35.6,190);
    quest::spawn2(9980002,0,0,580,-844.5,-27.3,190);
    quest::spawn2(9980002,0,0,520,-784.5,-35.4,190);
    quest::spawn2(9980002,0,0,520,-844.5,-39.7,190);
    quest::modifynpcstat("special_attacks","ABHG");
    quest::emote("ports away and releases his minions!");
    quest::shout("Argh, help me my minions!");
    $npc->GMMove(472.4,-684.9,-28.5,130.5); 
    $npc->TempName("Ghaud (Invulnerable)");
  }
  if($hpevent == 26) { 
    quest::settimer(3,120);
    quest::spawn2(9980002,0,0,580,-784.5,-35.6,190);
    quest::spawn2(9980002,0,0,580,-844.5,-27.3,190);
    quest::spawn2(9980002,0,0,520,-784.5,-35.4,190);
    quest::spawn2(9980002,0,0,520,-844.5,-39.7,190);
    quest::modifynpcstat("special_attacks","ABHG");
    quest::emote("ports away and releases his minions!");
    quest::shout("Minions, this is our last stand!");
    $npc->GMMove(472.4,-684.9,-28.5,130.5); 
    $npc->TempName("Ghaud (Invulnerable)");
  }
}
sub EVENT_TIMER {
  if($timer == 1) {
    quest::stoptimer(1);
    $npc->GMMove(540,-814.4,-39.5,192);
    quest::modifynpcstat("special_attacks","ST");
    quest::setnexthpevent(51);
    quest::emote("returns to battle.");
    $npc->TempName("Ghaud");
  }
  if($timer == 2) {
    quest::stoptimer(2);
    $npc->GMMove(540,-814.4,-39.5,192);
    quest::modifynpcstat("special_attacks","ST");
    quest::setnexthpevent(26);
    quest::emote("returns to battle.");
    $npc->TempName("Ghaud");
  }
  if($timer == 3) {
    quest::stoptimer(3);
    $npc->GMMove(540,-814.4,-39.5,192);
    quest::modifynpcstat("special_attacks","ST");
    quest::emote("returns to battle.");
    $npc->TempName("Ghaud");
  }
}  
sub EVENT_DEATH {
  quest::depopall(9980002);
  quest::emote("minions disappear.");
}
}
Would you just change the NPCs run speed to 1 in the DB, and then in the very beginning make:

Code:
sub EVENT_SPAWN {
     quest::setnexthpevent(76);
     quest::modifynpcstat("runspeed", 0);
Then I will just add a runspeed modify line to every portion of him moving throughout the script to make sure he's either moving or not moving when I want him to be?
Reply With Quote
  #6  
Old 03-22-2014, 01:56 AM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Yes that is correct... set runspeed to 1 in database and change runspeed to 0 when it spawns
Reply With Quote
  #7  
Old 03-22-2014, 02:03 AM
Esildor
Hill Giant
 
Join Date: Feb 2010
Posts: 207
Default

Quote:
Originally Posted by NatedogEZ View Post
Yes that is correct... set runspeed to 1 in database and change runspeed to 0 when it spawns
So I actually don't want his speed to be 0 when he spawns, so, that's fine.

I changed it to 1 in the database, basically what the boss does is ports away at 76, 51, 26 and adds spawn .. he's supposed to remain "invulnerable" and perma rooted where he gets moved to and not be part of the fight until after the timer goes down. I THINK it's modifying his run speed when it moves him away to 0, but then he's like warping back on top of me .. weird

Edit: Yeah. I don't think you can play with runspeed from 0 to 1 or 1 to 0. With having him start at 0(in DB) you can't add runspeed(as you figured out) and it seems when you have it start at runspeed of 1(in DB) and then try to make his runspeed 0 via modifynpcstat it's making it warp onto me.
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:18 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