Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 01-15-2012, 09:44 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

So, there are two issues.

First, that code is never called because the nonspell_action is 0 on that AA. It also has a spell_id set, which as you found is 4521-4523, the barbarian spells.

In order to make that code execute the database needs to be fixed like this:

Code:
UPDATE `aa_actions` SET `spell_id` = 0, `nonspell_action` = 13 WHERE `aaid` = 718;
The second issue is that the code is not correct in several ways:
1) The case value is wrong, instead of aaBeastialAlignment it should be aaActionBeastialAlignment.

2) The AA_Choose3 macro is expecting 1,2,3 but what's passed in is 0,1,2 because 1 is subtracted from the value higher up in the code to use it as an array index.

3) There's no break at the end, so it falls through and you harm touch yourself. It looks like this was copy/pasted from some commented out code in aa.cpp that was used before they were handled in the database, and the break was left out along with the "not working yet" message.

This fixes those issues. The macro was defined in two places, so I commented out the one in ptimer.h since it seems like aa.h was the better place to have it. This is the only non commented out code in the project to use the macro, so it really should be in aa.cpp.

Code:
Index: trunk/EQEmuServer/common/ptimer.h
===================================================================
--- trunk/EQEmuServer/common/ptimer.h	(revision 2097)
+++ trunk/EQEmuServer/common/ptimer.h	(working copy)
@@ -138,7 +138,7 @@
 };
 
 //code prettying macros
-#define AA_Choose3(val, v1, v2, v3) (val==1?v1:(val==2?v2:v3))
-#define AA_Choose5(val, v1, v2, v3, v4, v5) (val==1?v1:(val==2?v2:(val==3?v3:(val==4?v4:v5))))
+//#define AA_Choose3(val, v1, v2, v3) (val==1?v1:(val==2?v2:v3))
+//#define AA_Choose5(val, v1, v2, v3, v4, v5) (val==1?v1:(val==2?v2:(val==3?v3:(val==4?v4:v5))))
 
 #endif
Index: trunk/EQEmuServer/zone/AA.cpp
===================================================================
--- trunk/EQEmuServer/zone/AA.cpp	(revision 2097)
+++ trunk/EQEmuServer/zone/AA.cpp	(working copy)
@@ -454,7 +454,7 @@
 			Escape();
 			break;
 			
-		case aaBeastialAlignment:
+		case aaActionBeastialAlignment:
 			switch(GetBaseRace()) {
 				case BARBARIAN:
 					spell_id = AA_Choose3(activate_val, 4521, 4522, 4523);
@@ -463,7 +463,7 @@
 					spell_id = AA_Choose3(activate_val, 4524, 4525, 4526);
 					break;
 				case OGRE:
-					spell_id = AA_Choose3(activate_val, 4527, 4527, 4529);
+					spell_id = AA_Choose3(activate_val, 4527, 4528, 4529);
 					break;
 				case IKSAR:
 					spell_id = AA_Choose3(activate_val, 4530, 4531, 4532);
@@ -472,6 +472,7 @@
 					spell_id = AA_Choose3(activate_val, 4533, 4534, 4535);
 					break;
 			}
+			break;
 			
 		case aaActionLeechTouch:
 			target = aaTargetCurrent;
Index: trunk/EQEmuServer/zone/AA.h
===================================================================
--- trunk/EQEmuServer/zone/AA.h	(revision 2097)
+++ trunk/EQEmuServer/zone/AA.h	(working copy)
@@ -728,7 +728,7 @@
 extern AA_DBAction AA_Actions[aaHighestID][MAX_AA_ACTION_RANKS];	//[aaid][rank]
 extern map<int16, AA_SwarmPet> AA_SwarmPets;	//key=spell_id
 
-#define AA_Choose3(val, v1, v2, v3) (val==1?v1:(val==2?v2:v3))
+#define AA_Choose3(val, v1, v2, v3) (val==0?v1:(val==1?v2:v3))
 
 extern map<int32,SendAA_Struct*>aas_send;
 extern std::map<uint32, std::map<uint32, AA_Ability> > aa_effects;
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 10:44 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3