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

03-22-2014, 01:23 AM
|
 |
Developer
|
|
Join Date: Dec 2012
Posts: 515
|
|
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..
|
 |
|
 |
 |
|
 |

03-22-2014, 01:54 AM
|
Hill Giant
|
|
Join Date: Feb 2010
Posts: 207
|
|
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?
|
 |
|
 |
Thread Tools |
|
Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 05:05 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |