mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-02 20:56:37 +00:00
NPC Faction lists to new shared memory scheme
This commit is contained in:
@@ -105,7 +105,6 @@ SET(zone_headers
|
||||
entity.h
|
||||
errmsg.h
|
||||
event_codes.h
|
||||
faction.h
|
||||
forage.h
|
||||
groups.h
|
||||
guild_mgr.h
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include "masterentity.h"
|
||||
#include "faction.h"
|
||||
#include "../common/faction.h"
|
||||
#include "map.h"
|
||||
#include "../common/spdat.h"
|
||||
#include "../common/skills.h"
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
#include "forage.h"
|
||||
#include "zone.h"
|
||||
#include "event_codes.h"
|
||||
#include "faction.h"
|
||||
#include "../common/faction.h"
|
||||
#include "../common/crc32.h"
|
||||
#include "StringIDs.h"
|
||||
#include "map.h"
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
#include "forage.h"
|
||||
#include "zone.h"
|
||||
#include "event_codes.h"
|
||||
#include "faction.h"
|
||||
#include "../common/faction.h"
|
||||
#include "../common/crc32.h"
|
||||
#include "../common/rulesys.h"
|
||||
#include "StringIDs.h"
|
||||
|
||||
@@ -157,7 +157,6 @@ int command_init(void) {
|
||||
command_add("incstat","- Increases or Decreases a client's stats permanently.",200,command_incstat) ||
|
||||
command_add("help","[search term] - List available commands and their description, specify partial command as argument to search",0,command_help) ||
|
||||
command_add("version","- Display current version of EQEmu server",0,command_version) ||
|
||||
command_add("eitem","- Changes item stats",200,command_eitem) ||
|
||||
command_add("setfaction","[faction number] - Sets targeted NPC's faction in the database",170,command_setfaction) ||
|
||||
command_add("serversidename","- Prints target's server side name",0,command_serversidename) ||
|
||||
command_add("testspawn","[memloc] [value] - spawns a NPC for you only, with the specified values set in the spawn struct",200,command_testspawn) ||
|
||||
@@ -947,20 +946,6 @@ void command_version(Client *c, const Seperator *sep)
|
||||
c->Message(0, " Last modified on: %s", LAST_MODIFIED);
|
||||
}
|
||||
|
||||
void command_eitem(Client *c, const Seperator *sep)
|
||||
{
|
||||
#ifdef SHAREMEM
|
||||
c->Message(0, "Error: Function doesnt work in ShareMem mode");
|
||||
#else
|
||||
char hehe[255];
|
||||
if(strstr(sep->arg[2],"classes"))
|
||||
snprintf(hehe,255,"%s %s",sep->arg[3],strstr(sep->argplus[0],sep->arg[3]));
|
||||
else
|
||||
strcpy(hehe,sep->arg[3]);
|
||||
database.SetItemAtt(sep->arg[2],hehe,atoi(sep->arg[1]));
|
||||
#endif
|
||||
}
|
||||
|
||||
void command_setfaction(Client *c, const Seperator *sep)
|
||||
{
|
||||
if((sep->arg[1][0] == 0 || strcasecmp(sep->arg[1],"*")==0) || ((c->GetTarget()==0) || (c->GetTarget()->IsClient())))
|
||||
|
||||
@@ -72,7 +72,6 @@ void command_setstat(Client *c, const Seperator *sep);
|
||||
void command_incstat(Client *c, const Seperator *sep);
|
||||
void command_help(Client *c, const Seperator *sep);
|
||||
void command_version(Client *c, const Seperator *sep);
|
||||
void command_eitem(Client *c, const Seperator *sep);
|
||||
void command_setfaction(Client *c, const Seperator *sep);
|
||||
void command_serversidename(Client *c, const Seperator *sep);
|
||||
void command_testspawnkill(Client *c, const Seperator *sep);
|
||||
|
||||
+2
-1
@@ -24,7 +24,7 @@ using namespace std;
|
||||
#ifndef WIN32
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
#include "faction.h"
|
||||
#include "../common/faction.h"
|
||||
#include "zonedb.h"
|
||||
#include "masterentity.h"
|
||||
#include "zone.h"
|
||||
@@ -32,6 +32,7 @@ using namespace std;
|
||||
|
||||
extern Zone* zone;
|
||||
|
||||
//TODO: This file is terrible: half of it needs to be in common and half in zone
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#define snprintf _snprintf
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef FACTION_H
|
||||
#define FACTION_H
|
||||
|
||||
#include "../common/types.h"
|
||||
#include "../common/features.h"
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
enum FACTION_VALUE {
|
||||
FACTION_ALLY = 1,
|
||||
FACTION_WARMLY = 2,
|
||||
FACTION_KINDLY = 3,
|
||||
FACTION_AMIABLE = 4,
|
||||
|
||||
FACTION_INDIFFERENT = 5,
|
||||
|
||||
FACTION_APPREHENSIVE = 6,
|
||||
FACTION_DUBIOUS = 7,
|
||||
FACTION_THREATENLY = 8,
|
||||
FACTION_SCOWLS = 9
|
||||
};
|
||||
|
||||
struct NPCFactionList {
|
||||
uint32 id;
|
||||
uint32 primaryfaction;
|
||||
bool assistprimaryfaction;
|
||||
uint32 factionid[MAX_NPC_FACTIONS];
|
||||
int32 factionvalue[MAX_NPC_FACTIONS];
|
||||
int8 factionnpcvalue[MAX_NPC_FACTIONS];
|
||||
uint8 factiontemp[MAX_NPC_FACTIONS];
|
||||
};
|
||||
|
||||
struct FactionMods
|
||||
{
|
||||
int32 base;
|
||||
int32 class_mod;
|
||||
int32 race_mod;
|
||||
int32 deity_mod;
|
||||
};
|
||||
struct Faction {
|
||||
int32 id;
|
||||
std::map<std::string, int16> mods;
|
||||
int16 base;
|
||||
char name[50];
|
||||
};
|
||||
typedef map<uint32, int16> faction_map;
|
||||
|
||||
struct NPCFaction
|
||||
{
|
||||
uint32 factionID;
|
||||
int32 value_mod;
|
||||
int8 npc_value;
|
||||
uint8 temp;
|
||||
//bool primary;
|
||||
};
|
||||
|
||||
const char *FactionValueToString(FACTION_VALUE fv);
|
||||
char* BuildFactionMessage(int32 tmpvalue, int32 faction_id, int32 totalvalue, uint8 temp);
|
||||
FACTION_VALUE CalculateFaction(FactionMods* fm, int32 tmpCharacter_value);
|
||||
#endif
|
||||
@@ -45,26 +45,6 @@ using namespace std;
|
||||
|
||||
volatile bool RunLoops = true;
|
||||
extern volatile bool ZoneLoaded;
|
||||
#ifdef SHAREMEM
|
||||
#include "../common/EMuShareMem.h"
|
||||
extern LoadEMuShareMemDLL EMuShareMemDLL;
|
||||
#ifndef WIN32
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/sem.h>
|
||||
#include <sys/shm.h>
|
||||
#ifndef FREEBSD
|
||||
union semun {
|
||||
int val;
|
||||
struct semid_ds *buf;
|
||||
ushort *array;
|
||||
struct seminfo *__buf;
|
||||
void *__pad;
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#include "../common/queue.h"
|
||||
#include "../common/timer.h"
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
#include "../common/eq_packet_structs.h"
|
||||
#include "../common/loottable.h"
|
||||
#include "zonedump.h"
|
||||
#include "faction.h"
|
||||
#include "../common/faction.h"
|
||||
//#include "doors.h"
|
||||
|
||||
struct wplist {
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ spawn2 mediumblob, npcs mediumblob, npc_loot mediumblob, gmspawntype mediumblob,
|
||||
|
||||
#ifndef ZONEDUMP_H
|
||||
#define ZONEDUMP_H
|
||||
#include "faction.h"
|
||||
#include "../common/faction.h"
|
||||
#include "../common/eq_packet_structs.h"
|
||||
#include "../common/Item.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user