View Single Post
  #2  
Old 07-29-2003, 01:13 PM
velns
Fire Beetle
 
Join Date: Apr 2003
Posts: 10
Default

Modifications to latest 0.5 code, various zone files (including better formatting of the above code change)

makefile change to use "common" mysql library / include paths rather than /usr/local path =>
Code:
--- makefile    25 Jul 2003 12:01:08 -0000      1.1.1.2
+++ makefile    30 Jul 2003 00:25:02 -0000
@@ -1,6 +1,6 @@
 APP=zone
 SF=../common/EQNetwork.o \
-   ../common/timer.o ../common/database.o ../common/packet_dump.o ../common/packet_functions.o \
+   ../common/timer.o ../common/EQEMuError.o ../common/database.o ../common/packet_dump.o ../common/packet_functions.o \
    ../common/unix.o ../common/packet_dump_file.o ../common/Mutex.o ../common/MiscFunctions.o \
    zone.o entity.o mob.o client.o client_process.o npc.o net.o spawn2.o attack.o hate_list.o \
    ../common/serverinfo.o ../common/moremath.o worldserver.o spells.o spawngroup.o loottables.o \
@@ -14,8 +14,8 @@

 CC=gcc
 LINKER=gcc
-MYSQL_FLAGS=-I/usr/local/mysql/include
-MYSQL_LIB=-L'/usr/local/mysql/lib' -lmysqlclient -lz -lcrypt -lnsl -lm -lc -lnss_files -lnss_dns -lresolv -lc -lnss_files -lnss_dns -lresolv
+MYSQL_FLAGS=-I/usr/include/mysql/
+MYSQL_LIB=-L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm -lc -lnss_files -lnss_dns -lresolv -lc -lnss_files -lnss_dns -lresolv
 DFLAGS=-DDEBUG=5 -DCATCH_CRASH -DNO_PIDLOG -DSHAREMEM -DSPELL_EFFECT_SPAM
 WFLAGS=-Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wbad-function-cast -Wstrict-prototypes -Wno-deprecated -Wnested-externs -Wcomment -Wcast-align
 COPTS=$(WFLAGS) -O -ggdb -march=i686 -pthread -pipe -D_GNU_SOURCE -DINVERSEXY -DFX -DZONE $(DFLAGS) $(MYSQL_FLAGS)
parser.cpp change to make the itoa definition WIN32 only, as it is an invalid-redefinition when compiling on linux =>
Code:
--- parser.cpp  29 Jul 2003 00:30:19 -0000      1.2
+++ parser.cpp  30 Jul 2003 00:25:05 -0000
@@ -152,7 +152,10 @@
        return returnvalue;
 }

+#ifdef WIN32
 char* itoa(int integer) {char tmp[10];return itoa(integer,tmp,10);}
+#endif
+
 string strlwr(string tmp) {return strlwr((char*)tmp.c_str());}
 int strcmp(string com, string com2) {return strcmp(com.c_str(),com2.c_str());}
spells.cpp change, to fix improper wording in spell casing logger messages=>
Code:
--- spells.cpp  29 Jul 2003 00:30:20 -0000      1.2
+++ spells.cpp  30 Jul 2003 00:25:17 -0000
@@ -1458,43 +1458,43 @@
                        if (partial && (random > chance - 0.10))
                        {
                                LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: 50%% Hit!",
-                           caster?caster->GetName():"unknown", GetName(),
-                           spells[spell_id].name);
+                           caster?caster->GetName():"unknown",
+                           spells[spell_id].name, GetName());
                                return 50;
                        }
                        else if (partial && random > chance - 0.08)
                        {
                                LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: 60%% Hit!",
-                           caster?caster->GetName():"unknown", GetName(),
-                           spells[spell_id].name);
+                           caster?caster->GetName():"unknown",
+                           spells[spell_id].name, GetName());
                                return 60;
                        }
                        else if (partial && random > chance - 0.06)
                        {
                                LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: 70%% Hit!",
-                           caster?caster->GetName():"unknown", GetName(),
-                           spells[spell_id].name);
+                           caster?caster->GetName():"unknown",
+                           spells[spell_id].name, GetName());
                                return 70;
                        }
                        else if (partial && random > chance - 0.04)
                        {
                                LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: 80%% Hit!",
-                           caster?caster->GetName():"unknown", GetName(),
-                           spells[spell_id].name);
+                           caster?caster->GetName():"unknown",
+                           spells[spell_id].name, GetName());
                                return 80;
                        }
                        else if (partial && random > chance - 0.02)
                        {
                                LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: 90%% Hit!",
-                           caster?caster->GetName():"unknown", GetName(),
-                              spells[spell_id].name);
+                           caster?caster->GetName():"unknown",
+                              spells[spell_id].name, GetName());
                                return 90;
                        }
                        else if (random > chance)
                        {
                                LogFile->write(EQEMuLog::Normal, "%s casted %s on %s: Full Hit!",
-                           caster?caster->GetName():"unknown", GetName(),
-                           spells[spell_id].name);
+                           caster?caster->GetName():"unknown",
+                           spells[spell_id].name, GetName());
                                return 100;
                        }
                        return 0;
Reply With Quote