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

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


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 09:13 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