changeset 210:fcdb80fc1f74

Слияние
author Ritor1
date Sat, 16 Feb 2013 16:23:29 +0600
parents 29545d87e11d (current diff) 1c8add70bcf9 (diff)
children cd2077e24f95
files Spells.cpp
diffstat 2 files changed, 153 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/Spells.cpp	Sat Feb 16 16:23:07 2013 +0600
+++ b/Spells.cpp	Sat Feb 16 16:23:29 2013 +0600
@@ -17,8 +17,109 @@
 
 
 stru324_spell stru_4E3ACC[102];
-SpellData pSpellDatas[95];
 
+SpellData pSpellDatas[100]={
+					 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},	
+					 {1, 1, 1, 1, 60, 60, 60, 40, 0, 0},
+	                 {2, 2, 2, 2, 110, 110, 100, 90, 768, 0},
+	                 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0},
+	                 {4, 4, 4, 4, 120, 120, 120, 120, 0, 0},
+	                 {5, 5, 5, 5, 120, 120, 120, 120, 0, 0},
+	                 {8, 8, 8, 8, 100, 100, 90, 80, 1536, 0},
+	                 {10, 10, 10, 10, 150, 150, 150, 150, 1536, 0},
+	                 {15, 15, 15, 15, 120, 120, 120, 120, 1536, 0},
+	                 {20, 20, 20, 20, 100, 100, 100, 90, 264, 0},
+	                 {25, 25, 25, 25, 100, 100, 100, 90, 268, 0},
+	                 {30, 30, 30, 30, 90, 90, 90, 90, 3855, 0},
+	                 {1, 1, 1, 0, 60, 60, 60, 60, 0, 0},
+	                 {2, 2, 2, 2, 120, 120, 120, 100, 0, 0},
+	                 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0},
+	                 {4, 4, 4, 4, 110, 100, 90, 80, 258, 0},
+	                 {5, 5, 5, 5,  90, 90,  70, 50, 0, 0},
+	                 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0},
+	                 {10, 10, 10, 10, 100, 100, 90, 70, 2048, 0},
+	                 {15, 15, 15, 15, 200, 200, 200, 200, 0, 0},
+	                 {20, 20, 20, 20, 100, 100, 100, 90, 2570, 0},
+	                 {25, 25, 25, 25, 250, 250, 250, 250, 0, 0},
+	                 {30, 30, 30, 30, 90, 90, 90, 90, 276, 0},
+	                 {1, 1, 1, 1, 60, 60, 60, 20, 0, 0},
+	                 {2, 2, 2, 2, 110, 100, 90, 70, 514, 0},
+	                 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0},
+	                 {4, 4, 4, 4, 110, 100, 90, 80, 1024, 0},
+	                 {5, 5, 5, 5, 150, 150, 150, 150, 0, 0},
+	                 {8, 8, 8, 8, 200, 200, 200, 200, 0, 0},
+	                 {10, 10, 10, 10, 100, 100, 90, 80, 2313, 0},
+	                 {15, 15, 15, 15, 140, 140, 140, 140, 0, 0},
+	                 {20, 20, 20, 20, 200, 200, 200, 200, 0, 0},
+	                 {25, 25, 25, 25, 80, 80, 80, 80, 780, 0},
+	                 {30, 30, 30, 30, 250, 250, 250, 250, 0, 0},
+	                 {1, 1, 1, 1, 80, 80, 80, 80, 0, 0},
+	                 {2, 2, 2, 2, 100, 100, 100, 100, 0, 0},
+	                 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0},
+	                 {4, 4, 4, 4, 110, 100, 90, 80, 773, 0},
+	                 {5, 5, 5, 5, 120, 120, 120, 120, 0, 0},
+	                 {8, 8, 8, 8, 100, 100, 90, 80, 2304, 0},
+	                 {10, 10, 10, 10, 140, 140, 140, 140, 0, 0},
+	                 {15, 15, 15, 15, 90, 90, 90, 80, 2048, 0},
+	                 {20, 20, 20, 20, 150, 150, 150, 150, 0, 0},
+	                 {25, 25, 25, 25, 100, 100, 100, 90, 276, 0},
+	                 {30, 30, 30, 30, 90, 90, 90, 90, 25, 0},
+	                 {1, 1, 1, 1, 100, 100, 100, 100, 0, 0},
+	                 {2, 2, 2, 2, 100, 100, 100, 100, 0, 0},
+	                 {3, 3, 3, 3, 90, 90, 90, 90, 0, 0},
+	                 {4, 4, 4, 4, 120, 120, 120, 120, 0, 0},
+	                 {5, 5, 5, 5, 120, 120, 120, 120, 0, 0},
+	                 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0},
+	                 {10, 10, 10, 10, 120, 120, 120, 120, 0, 0},
+	                 {15, 15, 15, 15, 100, 100, 100, 100, 2058, 0},
+	                 {20, 20, 20, 20, 240, 240, 240, 240, 0, 0},
+	                 {25, 25, 25, 25, 150, 150, 150, 150, 0, 0},
+	                 {30, 30, 30, 30, 1000, 1000, 1000, 1000, 0, 0},
+	                 {1, 1, 1, 1, 120, 120, 120, 120, 0, 0},
+	                 {2, 2, 2, 2, 110, 110, 110, 110, 771, 0},
+	                 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0},
+	                 {4, 4, 4, 4, 110, 100, 90, 80, 0, 0},
+	                 {5, 5, 5, 5, 100, 100, 100, 100, 0, 0},
+	                 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0},
+	                 {10, 10, 10, 10, 120, 120, 120, 120, 0, 0},
+	                 {15, 15, 15, 15, 80, 80, 80, 80, 0, 0},
+	                 {20, 20, 20, 20, 120, 120, 120, 120, 0, 0},
+	                 {25, 25, 25, 25, 110, 110, 110, 100, 268, 0},
+	                 {30, 30, 30, 30, 120, 120, 120, 120, 0, 0},
+	                 {1, 1, 1, 1, 120, 120, 120, 120, 0, 0},
+	                 {2, 2, 2, 2, 100, 100, 100, 100, 0, 0},
+	                 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0},
+	                 {4, 4, 4, 4, 110, 100, 90, 80, 520, 0},
+	                 {5, 5, 5, 5, 110, 110, 110, 110, 0, 0},
+	                 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0},
+	                 {10, 10, 10, 10, 120, 120, 120, 120, 0, 0},
+	                 {15, 15, 15, 15, 120, 120, 120, 120, 0, 0},
+	                 {20, 20, 20, 20, 120, 120, 120, 120, 0, 0},
+	                 {25, 25, 25, 25, 110, 110, 110, 100, 1310, 0},
+	                 {30, 30, 30, 30, 100, 100, 100, 100, 0, 0},
+	                 {5, 5, 5, 5, 110, 100, 90, 80, 1024, 0},
+	                 {10, 10, 10, 10, 120, 110, 100, 90, 4112, 0},
+	                 {15, 15, 15, 15, 120, 110, 100, 90, 0, 0},
+	                 {20, 20, 20, 20, 160, 140, 120, 100, 0, 0},
+	                 {25, 25, 25, 25, 140, 140, 140, 140, 0, 0},
+	                 {30, 30, 30, 30, 500, 500, 500, 500, 0, 0},
+	                 {35, 35, 35, 35, 135, 135, 120, 100, 281, 0},
+	                 {40, 40, 40, 40, 500, 500, 500, 500, 0, 0},
+	                 {45, 45, 45, 45, 250, 250, 250, 250, 0, 0},
+	                 {50, 50, 50, 50, 150, 150, 150, 135, 5140, 0},
+	                 {55, 55, 55, 55, 300, 300, 300, 300, 0, 0},
+	                 {10, 10, 10, 10, 140, 140, 140, 140, 0, 0},
+	                 {15, 15, 15, 15, 120, 110, 100, 90, 2585, 0},
+	                 {20, 20, 20, 20, 120, 100, 90, 120, 0, 0},
+	                 {25, 25, 25, 25, 120, 120, 120, 120, 0, 0},
+	                 {30, 30, 30, 30, 90, 90, 80, 70, 1542, 0},
+	                 {35, 35, 35, 35, 120, 120, 100, 80, 0, 0},
+	                 {40, 40, 40, 40, 110, 110, 110, 110, 0, 0},
+	                 {45, 45, 45, 45, 200, 200, 200, 150, 0, 0},
+	                 {50, 50, 50, 50, 120, 120, 120, 100, 6400, 0},
+	                 {55, 55, 55, 55, 250, 250, 250, 250, 306, 0},
+	                 {60, 60, 60, 60, 300, 300, 300, 300, 2073, 0}
+	};
 
 
 
@@ -123,7 +224,6 @@
 	pSpellsTXT_Raw = (char *)pEvents_LOD->LoadRaw("spells.txt", 0);
 	strtok(pSpellsTXT_Raw, "\r");
 	strtok(NULL, "\r");
-	//v14 = 1;
 	for(int i=1; i<100; ++i) 
 		{
 		test_string=strtok(NULL, "\r")+1;
@@ -150,59 +250,58 @@
 					pInfos[i].pName=RemoveQuotes(test_string);
 					break;
 				case 3:
-					pInfos[i].uSchool = 4;
+					pInfos[i].uSchool = SPELL_SCHOOL_NONE;
 					if (!_strcmpi("fire", test_string) )
 						{
-						pInfos[i].uSchool =0;
+						pInfos[i].uSchool =SPELL_SCHOOL_FIRE;
 						break;
 						}
 					if ( !_strcmpi("air", test_string) )	
 						{
-						pInfos[i].uSchool = 1;
+						pInfos[i].uSchool = SPELL_SCHOOL_AIR;
 						break;
 						}
 					if ( !_strcmpi("water", test_string))	
 						{
-						pInfos[i].uSchool = 2;
+						pInfos[i].uSchool = SPELL_SCHOOL_WATER;
 						break;
 						}	
 					if ( !_strcmpi("earth", test_string))	
 						{
-						pInfos[i].uSchool = 3;
+						pInfos[i].uSchool = SPELL_SCHOOL_EARTH;
 						break;
 						}	
 					if ( !_strcmpi("spirit", test_string))	
 						{
-						pInfos[i].uSchool = 6;
+						pInfos[i].uSchool = SPELL_SCHOOL_SPIRIT;
 						break;
 						}
 					if ( !_strcmpi("mind", test_string))	
 						{
-						pInfos[i].uSchool = 7;
+						pInfos[i].uSchool = SPELL_SCHOOL_MIND;
 						break;
 						}
 					if ( !_strcmpi("body", test_string) )	
 						{
-						pInfos[i].uSchool = 8;
+						pInfos[i].uSchool = SPELL_SCHOOL_BODY;
 						break;
 						}			
 					if ( !_strcmpi("light", test_string) )	
 						{
-						pInfos[i].uSchool = 9;
+						pInfos[i].uSchool =  SPELL_SCHOOL_LIGHT;
 						break;
 						}					
 					if ( !_strcmpi("dark", test_string))	
 						{
-						pInfos[i].uSchool = 10;
+						pInfos[i].uSchool = SPELL_SCHOOL_DARK;
 						break;
 						}					
 
 					if ( !_strcmpi("magic", test_string))	
 						{
-						pInfos[i].uSchool = 5;
+						pInfos[i].uSchool = SPELL_SCHOOL_MAGIC;
 						break;
 						}								
-
 					break;
 				case 4:
 					pInfos[i].pShortName=RemoveQuotes(test_string);
@@ -224,42 +323,27 @@
 					break;
 				case 10:
 					int in_string_pos=0;
+					unsigned char test;
 					int in_str_len=strlen(test_string);
-					/*v4 = 0; fix_me
-					v8 = strlen(v5);
-					if ( (signed int)v8 > 0 )
-					{
-					do
-					{
-					v9 = tolower((unsigned __int8)v5[v4]) - 99;
-					if ( v9 )
-					{
-					v10 = v9 - 2;
-					if ( v10 )
-					{
-					v11 = v10 - 8;
-					if ( v11 )
-					{
-					if ( v11 == 11 )
-					*v12 |= 8u;
-					}
-					else
-					{
-					*v12 |= 1u;
-					}
-					}
-					else
-					{
-					*v12 |= 2u;
-					}
-					}
-					else
-					{
-					*v12 |= 4u;
-					}
-					++v4;
-					}
-					while ( v4 < (signed int)v8 );*/
+					for (int j=0; j<in_str_len; ++j)
+						{
+							test= tolower(test_string[j]);
+							switch (test)
+							{
+							case 109:
+								pSpellDatas[i].field_12|=1;
+								break;
+							case 101:
+								pSpellDatas[i].field_12|=2;
+								break;
+							case 99:
+								pSpellDatas[i].field_12|=4;
+								break;
+							case 120:
+								pSpellDatas[i].field_12|=8;
+								break;
+							}					
+						}
 					break;
 					}
 				}
--- a/Spells.h	Sat Feb 16 16:23:07 2013 +0600
+++ b/Spells.h	Sat Feb 16 16:23:29 2013 +0600
@@ -33,6 +33,21 @@
 };
 
 
+enum SPELL_SCHOOL : int
+{
+  SPELL_SCHOOL_FIRE =  0,
+  SPELL_SCHOOL_AIR  =  1,
+  SPELL_SCHOOL_WATER = 2,
+  SPELL_SCHOOL_EARTH = 3,
+  SPELL_SCHOOL_NONE =  4,
+  SPELL_SCHOOL_MAGIC =  5,
+  SPELL_SCHOOL_SPIRIT = 6,
+  SPELL_SCHOOL_MIND   = 7,
+  SPELL_SCHOOL_BODY   = 8,
+  SPELL_SCHOOL_LIGHT   = 9,
+  SPELL_SCHOOL_DARK =  10
+};
+
 
 
 /*   68 */
@@ -74,7 +89,7 @@
   char *pExpertSkillDesc;
   char *pMasterSkillDesc;
   char *pGrandmasterSkillDesc;
-  int uSchool;
+  SPELL_SCHOOL uSchool;
   int field_20;
 };
 #pragma pack(pop)
@@ -120,8 +135,9 @@
   __int16 field_C;
   __int16 field_E;
   __int16 field_10;
-  char field_12;
-  char field_13;
+  __int16 field_12;
+ // char field_12;
+ // char field_13;
  // __int16 field_14;
 };
 #pragma pack(pop)
@@ -133,4 +149,4 @@
 
 
 extern stru324_spell stru_4E3ACC[];
-extern SpellData pSpellDatas[95];
\ No newline at end of file
+extern SpellData pSpellDatas[100];
\ No newline at end of file