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

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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
 

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 01:51 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