Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 07-22-2005, 07:09 AM
mystic414's Avatar
mystic414
Hill Giant
 
Join Date: Sep 2004
Posts: 100
Default Solution for $wp bug

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, 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
Code:
		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
Code:
		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:
Code:
	int		max_wp;
	int		cur_wp;
// used by quest wandering commands
with
Code:
	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.
__________________
The PEQ Database Editor is available!
Edit Loot, NPCs, Spawns, Merchants, Factions, NPC Spell Lists, and Tradeskills with ease!
Check it out!
Reply With Quote
  #2  
Old 07-22-2005, 03:12 PM
mystic414's Avatar
mystic414
Hill Giant
 
Join Date: Sep 2004
Posts: 100
Default

Well in hindsight there seems to be a minor bug: the first waypoint gets assigned to $wp as 0 instead of 1, and waypoint 2 is assigned "1", and so on. Someone less likely to break the code than I am may want to fix that :P
__________________
The PEQ Database Editor is available!
Edit Loot, NPCs, Spawns, Merchants, Factions, NPC Spell Lists, and Tradeskills with ease!
Check it out!
Reply With Quote
  #3  
Old 07-26-2005, 01:18 AM
Richardo
Banned
 
Join Date: Oct 2003
Location: Mattmecks Basement
Posts: 546
Default

Quote:
Originally Posted by mystic414
Well in hindsight there seems to be a minor bug: the first waypoint gets assigned to $wp as 0 instead of 1, and waypoint 2 is assigned "1", and so on. Someone less likely to break the code than I am may want to fix that :P

I think when using this its used like this..

($wpGridID whatever WpID)

for example,

if($wp10 == 1)
{
quest::depop();

I dont know, you could try it with the sub EVENT_WP or Waypoint, whichever it is.. It works for me, but I think ruben fixed it for our serv. lol
Reply With Quote
  #4  
Old 07-26-2005, 02:00 PM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

ok
the more accurate fix to this is below.
This is a result of whoever wrote embparser not understanding the old .qst parser well enough as they wrote the perl stuff.

Code:
Index: embparser.cpp
===================================================================
--- embparser.cpp       (revision 404)
+++ embparser.cpp       (working copy)
@@ -364,9 +364,7 @@
                        break;
                }
                case EVENT_WAYPOINT: {
-                       std::string temp = "wp";
-                               temp += itoa(npcid);
-                       ExportVar(packagename.c_str(), temp.c_str(), data);
+                       ExportVar(packagename.c_str(), "wp", data);
                        break;
                }
                case EVENT_HP: {
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:08 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