mystic414
07-22-2005, 07:09 AM
sub EVENT_WAYPOINT is supposed to assign the number of a wandering mob's current waypoint to $wp, but this has been broken for some time.
Cripp posted a fix here (http://www.eqemulator.net/forums/showthread.php?t=15340), which fixed the $wp problem for me in 6.0 DR3, but caused a new problem: sub EVENT_WAYPOINT was triggered twice each time a waypoint was hit. For instance, I wrote a quest that had the mob say "I'm at waypoint $wp", and each time he reached a waypoint he said that twice.
Well I don't know any C++, but I played with Cripp's fix and got it to work, at least as far as I can tell. So here's what I came up with:
In embparser.cpp replace case EVENT_WAYPOINT: {
std::string temp = "wp";
temp += itoa(npcid);
ExportVar(packagename.c_str(), temp.c_str(), data);
SendCommands(packagename.c_str(), "EVENT_WAYPOINT", npcid, npcmob, mob);
break;
}
with case EVENT_WAYPOINT: {
//std::string temp = "wp";
// temp += itoa(npcid);
//ExportVar(packagename.c_str(), temp.c_str(), data);
ExportVar(packagename.c_str(), "wp", itoa( (int)npcmob->cur_wp ));
// SendCommands(packagename.c_str(), "EVENT_WAYPOINT", npcid, npcmob, mob);
break;
}
and in mob.h replace: int max_wp;
int cur_wp;
// used by quest wandering commands
with int max_wp;
public:
int cur_wp;
protected:
// used by quest wandering commands
Once again, I don't code C++, I only played with Cripp's fix. It fixed $wp for me, and the mob only said his line once per waypoint. Hope this helps.
Cripp posted a fix here (http://www.eqemulator.net/forums/showthread.php?t=15340), which fixed the $wp problem for me in 6.0 DR3, but caused a new problem: sub EVENT_WAYPOINT was triggered twice each time a waypoint was hit. For instance, I wrote a quest that had the mob say "I'm at waypoint $wp", and each time he reached a waypoint he said that twice.
Well I don't know any C++, but I played with Cripp's fix and got it to work, at least as far as I can tell. So here's what I came up with:
In embparser.cpp replace case EVENT_WAYPOINT: {
std::string temp = "wp";
temp += itoa(npcid);
ExportVar(packagename.c_str(), temp.c_str(), data);
SendCommands(packagename.c_str(), "EVENT_WAYPOINT", npcid, npcmob, mob);
break;
}
with case EVENT_WAYPOINT: {
//std::string temp = "wp";
// temp += itoa(npcid);
//ExportVar(packagename.c_str(), temp.c_str(), data);
ExportVar(packagename.c_str(), "wp", itoa( (int)npcmob->cur_wp ));
// SendCommands(packagename.c_str(), "EVENT_WAYPOINT", npcid, npcmob, mob);
break;
}
and in mob.h replace: int max_wp;
int cur_wp;
// used by quest wandering commands
with int max_wp;
public:
int cur_wp;
protected:
// used by quest wandering commands
Once again, I don't code C++, I only played with Cripp's fix. It fixed $wp for me, and the mob only said his line once per waypoint. Hope this helps.