Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 12-19-2009, 06:29 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,497
Default COMMITTED: Waypoints

Some work on adjusting the waypoint code. Obviously we still need to check current scripts/waypoints to adjust for a change like this.

Changed current waypoint event to EVENT_WAYPOINT_DEPART.
Added new waypoint event of EVENT_WAYPOINT_ARRIVE.

/EQEmuServer/zone/embparser.cpp
Code:
Index: /EQEmuServer/zone/embparser.cpp
===================================================================
--- /EQEmuServer/zone/embparser.cpp	(revision 1053)
+++ /EQEmuServer/zone/embparser.cpp	(working copy)
@@ -47,7 +47,8 @@
 	"EVENT_AGGRO",
 	"EVENT_SLAY",
 	"EVENT_NPC_SLAY",
-	"EVENT_WAYPOINT",
+	"EVENT_WAYPOINT_ARRIVE",
+	"EVENT_WAYPOINT_DEPART",
 	"EVENT_TIMER",
 	"EVENT_SIGNAL",
 	"EVENT_HP",
@@ -535,10 +536,14 @@
 			perl->eval(std::string("++$").append(hashname).append("{$").append(packagename).append("::item4};").c_str());
 			break;
 		}
-		case EVENT_WAYPOINT: {
+		case EVENT_WAYPOINT_ARRIVE: {
 			ExportVar(packagename.c_str(), "wp", data);
 			break;
 		}
+		case EVENT_WAYPOINT_DEPART: {
+			ExportVar(packagename.c_str(), "wp", data);
+			break;
+		}
 		case EVENT_HP: {
 			break;
 		}
/EQEmuServer/zone/event_codes.h
Code:
Index: /EQEmuServer/zone/event_codes.h
===================================================================
--- /EQEmuServer/zone/event_codes.h	(revision 1053)
+++ /EQEmuServer/zone/event_codes.h	(working copy)
@@ -11,7 +11,8 @@
 	EVENT_AGGRO,		//entering combat mode due to a PC attack
 	EVENT_SLAY,			//killing a PC
 	EVENT_NPC_SLAY,		//killing an NPC
-	EVENT_WAYPOINT,		//reaching a waypoint on a grid
+	EVENT_WAYPOINT_ARRIVE,		//reaching a waypoint on a grid
+	EVENT_WAYPOINT_DEPART, //departing a waypoint on a grid
 	EVENT_TIMER,
 	EVENT_SIGNAL,
 	EVENT_HP,
/EQEmuServer/zone/parser.cpp
Code:
Index: /EQEmuServer/zone/parser.cpp
===================================================================
--- /EQEmuServer/zone/parser.cpp	(revision 1053)
+++ /EQEmuServer/zone/parser.cpp	(working copy)
@@ -455,12 +455,18 @@
 			SendCommands("event_npc_slay", qstID, npcmob, mob);
 			break;
 		}
-		case EVENT_WAYPOINT: {
+		case EVENT_WAYPOINT_ARRIVE: {
 			temp = "wp." + (string)itoa(npcid);
 			AddVar(temp,data);
-			SendCommands("event_waypoint", qstID, npcmob, mob);
+			SendCommands("event_waypoint_arrive", qstID, npcmob, mob);
 			break;
 		}
+		case EVENT_WAYPOINT_DEPART: {
+			temp = "wp." + (string)itoa(npcid);
+			AddVar(temp,data);
+			SendCommands("event_waypoint_depart", qstID, npcmob, mob);
+			break;
+		}
 		case EVENT_SIGNAL: {
 			SendCommands("event_signal", qstID, npcmob, mob);
 			break;
/EQEmuServer/zone/MobAI.cpp
Code:
Index: /EQEmu/EQEmuServer/zone/MobAI.cpp
===================================================================
--- /EQEmuServer/zone/MobAI.cpp	(revision 1053)
+++ /EQEmuServer/zone/MobAI.cpp	(working copy)
@@ -1591,7 +1591,7 @@
 				} else {
 					movetimercompleted=false; 
 					
-					mlog(QUESTS__PATHING, "We have reached waypoint %d.", cur_wp);
+					mlog(QUESTS__PATHING, "We are departing waypoint %d.", cur_wp);
 
 					if(AggroedAwayFromGrid > 0)
 						--AggroedAwayFromGrid;
@@ -1606,10 +1606,10 @@
 					//not sure why we do this...
 					SetAppearance(eaStanding, false);
 					
-					//kick off event_waypoint
+					//kick off event_waypoint_depart
 					char temp[16]; 
 					sprintf(temp, "%d", cur_wp);
-					parse->Event(EVENT_WAYPOINT,this->GetNPCTypeID(), temp, CastToNPC(), NULL); 
+					parse->Event(EVENT_WAYPOINT_DEPART,this->GetNPCTypeID(), temp, CastToNPC(), NULL); 
 					
 					entity_list.OpenDoorsNear(CastToNPC());
 					//setup our next waypoint, if we are still on our normal grid
@@ -1627,6 +1627,11 @@
 					SetAppearance(eaStanding, false);
 					SetMoving(false);
 					SendPosition();
+
+					//kick off event_waypoint_arrive
+					char temp[16]; 
+					sprintf(temp, "%d", cur_wp);
+					parse->Event(EVENT_WAYPOINT_ARRIVE,this->GetNPCTypeID(), temp, CastToNPC(), NULL); 
 					
 					// EverHood - wipe feign memory since we reached our first waypoint
 					if(cur_wp == 1)
/EQEmuServer/zone/waypoints.cpp
Code:
Index: /EQEmu/EQEmuServer/zone/waypoints.cpp
===================================================================
--- /EQEmuServer/zone/waypoints.cpp	(revision 1053)
+++ /EQEmuServer/zone/waypoints.cpp	(working copy)
@@ -124,7 +124,7 @@
 			itoa(cur_wp,temp,10);	//do this before updating to next waypoint
 			CalculateNewWaypoint(); 
 	        SetAppearance(eaStanding, false); 
-			parse->Event(EVENT_WAYPOINT,this->GetNPCTypeID(), temp, this, NULL); 
+			parse->Event(EVENT_WAYPOINT_DEPART,this->GetNPCTypeID(), temp, this, NULL); 
 		}	// if not currently at a waypoint, we continue on to the one we were headed to before the stop
 	}
 	else

Last edited by Derision; 01-17-2010 at 05:43 PM.. Reason: Stickied for review by me
Reply With Quote
  #2  
Old 01-09-2010, 10:20 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

This is probably a good change, but I would recommend to leave EVENT_WAYPOINT in place as it is and just add it to the cast for EVENT_WAYPOINT_DEPART. This will prevent currently scripts from needing to be adjusted so it will work with the old and new systems for this.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 01-11-2010, 08:46 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,497
Default

Just tested this on my personal server. Works good. You could always do a grep replace to change the EVENT_WAYPOINT to EVENT_WAYPOINT_DEPART. Up to you guys, though.
Reply With Quote
  #4  
Old 01-11-2010, 11:40 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

I disagree with Trev, in the end that will just be annoying and confusing down the line. It's best to just force people to replace their EVENT_WAYPOINTs now and call it a day.
Reply With Quote
  #5  
Old 01-18-2010, 02:55 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

I've committed this in Rev1118.

As a compromise, I left in the old EVENT_WAYPOINT as well as adding ARRIVE/DEPART to allow server ops some time to change their scripts.

All current occurrences of EVENT_WAYPOINT should be changed to EVENT_WAYPOINT_DEPART to maintain the old functionality.

I expect EVENT_WAYPOINT will be removed in a couple of weeks, so update those scripts now
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 03:50 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3