merged, removed mistake 'orig' files

This commit is contained in:
Arthur Ice 2014-12-05 20:20:54 -08:00
commit f0e22c9ff9
18 changed files with 29 additions and 45286 deletions

View File

@ -74,7 +74,9 @@ N(OP_CharacterCreateRequest),
N(OP_CharInventory),
N(OP_Charm),
N(OP_ChatMessage),
N(OP_ClearAA),
N(OP_ClearBlockedBuffs),
N(OP_ClearLeadershipAbilities),
N(OP_ClearNPCMarks),
N(OP_ClearObject),
N(OP_ClearSurname),

View File

@ -94,7 +94,8 @@ OP_ClearBlockedBuffs=0x5d3c
OP_WorldObjectsSent=0x7fa8
OP_SendExpZonein=0x25ab
OP_SendAATable=0x7791
OP_ShroudClearAA=0x422e
OP_ClearAA=0x422e
OP_ClearLeadershipAbilities=0xb978
OP_RespondAA=0x379d
OP_UpdateAA=0x504f
OP_SendAAStats=0x3d1c

View File

@ -531,7 +531,8 @@ OP_Shroud=0x6d1f
OP_ShroudRemove=0x17f6
OP_ShroudUnknown1=0x169a
OP_ShroudUnknown2=0x4292
OP_ShroudClearAA=0x3bef
OP_ClearAA=0x3bef
OP_ClearLeadershipAbilities=0x6e58
OP_ShroudSelectionWindow=0x4d79
OP_ShroudRequestStats=0x28ce
OP_ShroudRespondStats=0x33f2

View File

@ -85,7 +85,8 @@ OP_TaskActivity=0x2E60 #SEQ 12/04/08
OP_CompletedTasks=0x75AC #Derision 2009
OP_Weather=0x70A5 #SEQ 12/04/08
OP_SendAATable=0x6F05 #Trevius 12/20/08
OP_ShroudClearAA=0x71b9
OP_ClearAA=0x71b9
OP_ClearLeadershipAbilities=0x74e5
OP_UpdateAA=0x45D2 #Trevius 12/20/08
OP_RespondAA=0x4426 #Trevius 12/20/08
OP_ReqClientSpawn=0x014C #SEQ 12/04/08

View File

@ -88,7 +88,8 @@ OP_TaskActivity=0x31f3 # C
OP_CompletedTasks=0x687f # C
OP_Weather=0x4658 # V
OP_SendAATable=0x6ef9 # V
OP_ShroudClearAA=0x2cd4
OP_ClearAA=0x2cd4
OP_ClearLeadershipAbilities=0x7b77
OP_UpdateAA=0x7bf6 # V
OP_RespondAA=0x1fbd # C 0x2bad
OP_ReqClientSpawn=0x69cd # V

View File

@ -1470,10 +1470,11 @@ bool ZoneDatabase::LoadAAEffects2() {
return true;
}
void Client::ResetAA(){
RefundAA();
uint32 i;
for(i=0;i<MAX_PP_AA_ARRAY;i++){
for (i=0; i < MAX_PP_AA_ARRAY; i++) {
aa[i]->AA = 0;
aa[i]->value = 0;
m_pp.aa_array[MAX_PP_AA_ARRAY].AA = 0;
@ -1481,10 +1482,10 @@ void Client::ResetAA(){
}
std::map<uint32,uint8>::iterator itr;
for(itr=aa_points.begin();itr!=aa_points.end();++itr)
for(itr = aa_points.begin(); itr != aa_points.end(); ++itr)
aa_points[itr->first] = 0;
for(int i = 0; i < _maxLeaderAA; ++i)
for(int i = 0; i < _maxLeaderAA; ++i)
m_pp.leader_abilities.ranks[i] = 0;
m_pp.group_leadership_points = 0;
@ -1494,9 +1495,22 @@ void Client::ResetAA(){
database.DeleteCharacterAAs(this->CharacterID());
SaveAA();
SendClearAA();
SendAAList();
SendAATable();
SendAAStats();
database.DeleteCharacterLeadershipAAs(this->CharacterID());
Kick();
// undefined for these clients
if (GetClientVersionBit() & BIT_TitaniumAndEarlier)
Kick();
}
void Client::SendClearAA()
{
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ClearLeadershipAbilities, 0);
FastQueuePacket(&outapp);
outapp = new EQApplicationPacket(OP_ClearAA, 0);
FastQueuePacket(&outapp);
}
int Client::GroupLeadershipAAHealthEnhancement()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -755,6 +755,7 @@ public:
//AA Methods
void SendAAList();
void ResetAA();
void SendClearAA();
void SendAA(uint32 id, int seq=1);
void SendPreviousAA(uint32 id, int seq=1);
void BuyAA(AA_Action* action);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,190 +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 CORPSE_H
#define CORPSE_H
#include "mob.h"
class Client;
class NPC;
#define MAX_LOOTERS 72
class Corpse : public Mob {
public:
static void SendEndLootErrorPacket(Client* client);
static void SendLootReqErrorPacket(Client* client, uint8 response = 2);
Corpse(NPC* in_npc, ItemList* in_itemlist, uint32 in_npctypeid, const NPCType** in_npctypedata, uint32 in_decaytime = 600000);
Corpse(Client* client, int32 in_rezexp);
<<<<<<< HEAD
Corpse(uint32 in_corpseid, uint32 in_charid, const char* in_charname, ItemList* in_itemlist, uint32 in_copper, uint32 in_silver, uint32 in_gold, uint32 in_plat, const xyz_heading& position, float in_size, uint8 in_gender, uint16 in_race, uint8 in_class, uint8 in_deity, uint8 in_level, uint8 in_texture, uint8 in_helmtexture, uint32 in_rezexp, bool wasAtGraveyard = false);
~Corpse();
static Corpse* LoadFromDBData(uint32 in_dbid, uint32 in_charid, std::string in_charname, const xyz_heading& position, std::string time_of_death, bool rezzed, bool was_at_graveyard);
=======
Corpse(uint32 in_corpseid, uint32 in_charid, const char* in_charname, ItemList* in_itemlist, uint32 in_copper, uint32 in_silver, uint32 in_gold, uint32 in_plat, float in_x, float in_y, float in_z, float in_heading, float in_size, uint8 in_gender, uint16 in_race, uint8 in_class, uint8 in_deity, uint8 in_level, uint8 in_texture, uint8 in_helmtexture, uint32 in_rezexp, bool wasAtGraveyard = false);
~Corpse();
static Corpse* LoadCharacterCorpseEntity(uint32 in_dbid, uint32 in_charid, std::string in_charname, float in_x, float in_y, float in_z, float in_heading, std::string time_of_death, bool rezzed, bool was_at_graveyard);
>>>>>>> master
/* Corpse: General */
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) { return true; }
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false) { return; }
virtual bool Attack(Mob* other, int Hand = MainPrimary, bool FromRiposte = false,
<<<<<<< HEAD
bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr) { return false; }
virtual bool HasRaid() { return false; }
virtual bool HasGroup() { return false; }
virtual Raid* GetRaid() { return 0; }
virtual Group* GetGroup() { return 0; }
void LoadPlayerCorpseDecayTime(uint32 dbid);
=======
bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr) {
return false;
}
virtual bool HasRaid() { return false; }
virtual bool HasGroup() { return false; }
virtual Raid* GetRaid() { return 0; }
virtual Group* GetGroup() { return 0; }
inline uint32 GetCorpseDBID() { return corpse_db_id; }
inline char* GetOwnerName() { return corpse_name; }
bool IsEmpty() const;
>>>>>>> master
bool IsCorpse() const { return true; }
bool IsPlayerCorpse() const { return is_player_corpse; }
bool IsNPCCorpse() const { return !is_player_corpse; }
bool IsBecomeNPCCorpse() const { return become_npc; }
virtual void DepopNPCCorpse();
virtual void DepopPlayerCorpse();
bool Process();
bool Save();
uint32 GetCharID() { return char_id; }
uint32 SetCharID(uint32 iCharID) { if (IsPlayerCorpse()) { return (char_id = iCharID); } return 0xFFFFFFFF; };
uint32 GetDecayTime() { if (!corpse_decay_timer.Enabled()) return 0xFFFFFFFF; else return corpse_decay_timer.GetRemainingTime(); }
uint32 GetRezTime() { if (!corpse_rez_timer.Enabled()) return 0; else return corpse_rez_timer.GetRemainingTime(); }
void SetDecayTimer(uint32 decay_time);
void Delete();
void Bury();
void CalcCorpseName();
void LoadPlayerCorpseDecayTime(uint32 dbid);
/* Corpse: Items */
uint32 GetWornItem(int16 equipSlot) const;
ServerLootItem_Struct* GetItem(uint16 lootslot, ServerLootItem_Struct** bag_item_data = 0);
void SetPlayerKillItemID(int32 pk_item_id) { player_kill_item = pk_item_id; }
int32 GetPlayerKillItem() { return player_kill_item; }
void RemoveItem(uint16 lootslot);
void RemoveItem(ServerLootItem_Struct* item_data);
void AddItem(uint32 itemnum, uint16 charges, int16 slot = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0);
/* Corpse: Coin */
void SetCash(uint32 in_copper, uint32 in_silver, uint32 in_gold, uint32 in_platinum);
void RemoveCash();
uint32 GetCopper() { return copper; }
uint32 GetSilver() { return silver; }
uint32 GetGold() { return gold; }
uint32 GetPlatinum() { return platinum; }
/* Corpse: Resurrection */
bool IsRezzed() { return rez; }
void IsRezzed(bool in_rez) { rez = in_rez; }
void CastRezz(uint16 spellid, Mob* Caster);
void CompleteResurrection();
/* Corpse: Loot */
void QueryLoot(Client* to);
void LootItem(Client* client, const EQApplicationPacket* app);
void EndLoot(Client* client, const EQApplicationPacket* app);
void MakeLootRequestPackets(Client* client, const EQApplicationPacket* app);
void AllowPlayerLoot(Mob *them, uint8 slot);
void AddLooter(Mob *who);
uint32 CountItems();
bool CanPlayerLoot(int charid);
inline void Lock() { is_locked = true; }
inline void UnLock() { is_locked = false; }
inline bool IsLocked() { return is_locked; }
inline void ResetLooter() { being_looted_by = 0xFFFFFFFF; }
inline bool IsBeingLooted() { return (being_looted_by != 0xFFFFFFFF); }
/* Mob */
void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho);
bool Summon(Client* client, bool spell, bool CheckDistance);
void Spawn();
char corpse_name[64];
uint32 GetEquipment(uint8 material_slot) const;
uint32 GetEquipmentColor(uint8 material_slot) const;
inline int GetRezExp() { return rez_experience; }
protected:
std::list<uint32> MoveItemToCorpse(Client *client, ItemInst *item, int16 equipslot);
private:
<<<<<<< HEAD
bool is_player_corpse;
bool is_corpse_changed;
bool is_locked;
int32 player_kill_item;
uint32 corpse_db_id;
uint32 char_id;
ItemList itemlist;
uint32 copper;
=======
bool is_player_corpse; /* Determines if Player Corpse or not */
bool is_corpse_changed; /* Determines if corpse has changed or not */
bool is_locked; /* Determines if corpse is locked */
int32 player_kill_item; /* Determines if Player Kill Item */
uint32 corpse_db_id; /* Corpse Database ID (Player Corpse) */
uint32 char_id; /* Character ID */
ItemList itemlist; /* Internal Item list used for corpses */
uint32 copper;
>>>>>>> master
uint32 silver;
uint32 gold;
uint32 platinum;
bool player_corpse_depop; /* Sets up Corpse::Process to depop the player corpse */
uint32 being_looted_by; /* Determines what the corpse is being looted by internally for logic */
uint32 rez_experience; /* Amount of experience that the corpse would rez for */
bool rez;
bool can_corpse_be_rezzed; /* Bool declaring whether or not a corpse can be rezzed */
bool become_npc;
<<<<<<< HEAD
int allowed_looters[MAX_LOOTERS]; // People allowed to loot the corpse, character id
Timer corpse_decay_timer;
Timer corpse_res_timer;
Timer corpse_delay_timer;
=======
int allowed_looters[MAX_LOOTERS]; /* People allowed to loot the corpse, character id */
Timer corpse_decay_timer; /* The amount of time in millseconds in which a corpse will take to decay (Depop/Poof) */
Timer corpse_rez_timer; /* The amount of time in millseconds in which a corpse can be rezzed */
Timer corpse_delay_timer;
>>>>>>> master
Timer corpse_graveyard_timer;
Timer loot_cooldown_timer; /* Delay between loot actions on the corpse entity */
Color_Struct item_tint[9];
};
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,332 +0,0 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
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
*/
#include "../common/debug.h"
#include "../common/types.h"
#include "entity.h"
#include "masterentity.h"
#include "../common/spdat.h"
#include "../common/misc_functions.h"
#include "../common/string_util.h"
/*
Schema:
CREATE TABLE traps (
id int(11) NOT NULL auto_increment,
zone varchar(16) NOT NULL default '',
x int(11) NOT NULL default '0',
y int(11) NOT NULL default '0',
z int(11) NOT NULL default '0',
chance tinyint NOT NULL default '0',
maxzdiff float NOT NULL default '0',
radius float NOT NULL default '0',
effect int(11) NOT NULL default '0',
effectvalue int(11) NOT NULL default '0',
effectvalue2 int(11) NOT NULL default '0',
message varcahr(200) NOT NULL;
skill int(11) NOT NULL default '0',
spawnchance int(11) NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;
*/
Trap::Trap() :
Entity(),
respawn_timer(600000),
chkarea_timer(500),
m_Position(xyz_location::Origin())
{
trap_id = 0;
maxzdiff = 0;
radius = 0;
effect = 0;
effectvalue = 0;
effectvalue2 = 0;
skill = 0;
level = 0;
respawn_timer.Disable();
detected = false;
disarmed = false;
respawn_time = 0;
respawn_var = 0;
hiddenTrigger = nullptr;
ownHiddenTrigger = false;
}
Trap::~Trap()
{
//don't need to clean up mob as traps are always cleaned up same time as NPCs
//cleaning up mob here can actually cause a crash via race condition
}
bool Trap::Process()
{
if (chkarea_timer.Enabled() && chkarea_timer.Check()
/*&& zone->GetClientCount() > 0*/ )
{
Mob* trigger = entity_list.GetTrapTrigger(this);
if (trigger && !(trigger->IsClient() && trigger->CastToClient()->GetGM()))
{
Trigger(trigger);
}
}
if (respawn_timer.Enabled() && respawn_timer.Check())
{
detected = false;
disarmed = false;
chkarea_timer.Enable();
respawn_timer.Disable();
}
return true;
}
void Trap::Trigger(Mob* trigger)
{
int i = 0;
const NPCType* tmp = 0;
switch (effect)
{
case trapTypeDebuff:
if(message.empty())
{
entity_list.MessageClose(trigger,false,100,13,"%s triggers a trap!",trigger->GetName());
}
else
{
entity_list.MessageClose(trigger,false,100,13,"%s",message.c_str());
}
if(hiddenTrigger){
hiddenTrigger->SpellFinished(effectvalue, trigger, 10, 0, -1, spells[effectvalue].ResistDiff);
}
break;
case trapTypeAlarm:
if (message.empty())
{
entity_list.MessageClose(trigger,false,effectvalue,13,"A loud alarm rings out through the air...");
}
else
{
entity_list.MessageClose(trigger,false,effectvalue,13,"%s",message.c_str());
}
entity_list.SendAlarm(this,trigger,effectvalue);
break;
case trapTypeMysticSpawn:
if (message.empty())
{
entity_list.MessageClose(trigger,false,100,13,"The air shimmers...");
}
else
{
entity_list.MessageClose(trigger,false,100,13,"%s",message.c_str());
}
for (i = 0; i < effectvalue2; i++)
{
if ((tmp = database.GetNPCType(effectvalue)))
{
<<<<<<< HEAD
auto randomOffset = xyz_heading(-5 + MakeRandomInt(0, 10),-5 + MakeRandomInt(0, 10),-5 + MakeRandomInt(0, 10), MakeRandomInt(0, 249));
auto spawnPosition = randomOffset + m_Position;
NPC* new_npc = new NPC(tmp, nullptr, spawnPosition, FlyMode3);
=======
NPC* new_npc = new NPC(tmp, 0, x-5+zone->random.Int(0, 10), y-5+zone->random.Int(0, 10), z-5+zone->random.Int(0, 10), zone->random.Int(0, 249), FlyMode3);
>>>>>>> master
new_npc->AddLootTable();
entity_list.AddNPC(new_npc);
new_npc->AddToHateList(trigger,1);
}
}
break;
case trapTypeBanditSpawn:
if (message.empty())
{
entity_list.MessageClose(trigger,false,100,13,"A bandit leaps out from behind a tree!");
}
else
{
entity_list.MessageClose(trigger,false,100,13,"%s",message.c_str());
}
for (i = 0; i < effectvalue2; i++)
{
if ((tmp = database.GetNPCType(effectvalue)))
{
<<<<<<< HEAD
auto randomOffset = xyz_heading(-2 + MakeRandomInt(0, 5), -2 + MakeRandomInt(0, 5), -2 + MakeRandomInt(0, 5), MakeRandomInt(0, 249));
auto spawnPosition = randomOffset + m_Position;
NPC* new_npc = new NPC(tmp, nullptr, spawnPosition, FlyMode3);
=======
NPC* new_npc = new NPC(tmp, 0, x-2+zone->random.Int(0, 5), y-2+zone->random.Int(0, 5), z-2+zone->random.Int(0, 5), zone->random.Int(0, 249), FlyMode3);
>>>>>>> master
new_npc->AddLootTable();
entity_list.AddNPC(new_npc);
new_npc->AddToHateList(trigger,1);
}
}
break;
case trapTypeDamage:
if (message.empty())
{
entity_list.MessageClose(trigger,false,100,13,"%s triggers a trap!",trigger->GetName());
}
else
{
entity_list.MessageClose(trigger,false,100,13,"%s",message.c_str());
}
if(trigger->IsClient())
{
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Damage, sizeof(CombatDamage_Struct));
CombatDamage_Struct* a = (CombatDamage_Struct*)outapp->pBuffer;
int dmg = zone->random.Int(effectvalue, effectvalue2);
trigger->SetHP(trigger->GetHP() - dmg);
a->damage = dmg;
a->sequence = zone->random.Int(0, 1234567);
a->source = GetHiddenTrigger()!=nullptr ? GetHiddenTrigger()->GetID() : trigger->GetID();
a->spellid = 0;
a->target = trigger->GetID();
a->type = 253;
trigger->CastToClient()->QueuePacket(outapp);
safe_delete(outapp);
}
}
respawn_timer.Start((respawn_time + zone->random.Int(0, respawn_var)) * 1000);
chkarea_timer.Disable();
disarmed = true;
}
Trap* EntityList::FindNearbyTrap(Mob* searcher, float max_dist) {
float dist = 999999;
Trap* current_trap = nullptr;
float max_dist2 = max_dist*max_dist;
Trap *cur;
for (auto it = trap_list.begin(); it != trap_list.end(); ++it) {
cur = it->second;
if(cur->disarmed)
continue;
auto diff = searcher->GetPosition() - cur->m_Position;
float curdist = diff.m_X * diff.m_X + diff.m_Y * diff.m_Y + diff.m_Z * diff.m_Z;
if (curdist < max_dist2 && curdist < dist)
{
dist = curdist;
current_trap = cur;
}
}
return current_trap;
}
Mob* EntityList::GetTrapTrigger(Trap* trap) {
Mob* savemob = 0;
float maxdist = trap->radius * trap->radius;
for (auto it = client_list.begin(); it != client_list.end(); ++it) {
Client* cur = it->second;
auto diff = cur->GetPosition() - trap->m_Position;
diff.ABS_XYZ();
if ((diff.m_X*diff.m_X + diff.m_Y*diff.m_Y) <= maxdist
&& diff.m_Z < trap->maxzdiff)
{
<<<<<<< HEAD
if (MakeRandomInt(0,100) < trap->chance)
return cur;
=======
if (zone->random.Roll(trap->chance))
return(cur);
>>>>>>> master
else
savemob = cur;
}
}
return savemob;
}
//todo: rewrite this to not need direct access to trap members.
bool ZoneDatabase::LoadTraps(const char* zonename, int16 version) {
std::string query = StringFormat("SELECT id, x, y, z, effect, effectvalue, effectvalue2, skill, "
"maxzdiff, radius, chance, message, respawn_time, respawn_var, level "
"FROM traps WHERE zone='%s' AND version=%u", zonename, version);
auto results = QueryDatabase(query);
if (!results.Success()) {
LogFile->write(EQEMuLog::Error, "Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
return false;
}
for (auto row = results.begin(); row != results.end(); ++row) {
Trap* trap = new Trap();
trap->trap_id = atoi(row[0]);
trap->m_Position = xyz_location(atof(row[1]), atof(row[2]), atof(row[3]));
trap->effect = atoi(row[4]);
trap->effectvalue = atoi(row[5]);
trap->effectvalue2 = atoi(row[6]);
trap->skill = atoi(row[7]);
trap->maxzdiff = atof(row[8]);
trap->radius = atof(row[9]);
trap->chance = atoi(row[10]);
trap->message = row[11];
trap->respawn_time = atoi(row[12]);
trap->respawn_var = atoi(row[13]);
trap->level = atoi(row[14]);
entity_list.AddTrap(trap);
trap->CreateHiddenTrigger();
}
return true;
}
void Trap::CreateHiddenTrigger()
{
if(hiddenTrigger)
return;
const NPCType *base_type = database.GetNPCType(500);
NPCType *make_npc = new NPCType;
memcpy(make_npc, base_type, sizeof(NPCType));
make_npc->max_hp = 100000;
make_npc->cur_hp = 100000;
strcpy(make_npc->name, "a_trap");
make_npc->runspeed = 0.0f;
make_npc->bodytype = BT_Special;
make_npc->race = 127;
make_npc->gender = 0;
make_npc->loottable_id = 0;
make_npc->npc_spells_id = 0;
make_npc->d_meele_texture1 = 0;
make_npc->d_meele_texture2 = 0;
make_npc->trackable = 0;
make_npc->level = level;
strcpy(make_npc->special_abilities, "19,1^20,1^24,1^25,1");
NPC* npca = new NPC(make_npc, nullptr, xyz_heading(m_Position, 0.0f), FlyMode3);
npca->GiveNPCTypeData(make_npc);
entity_list.AddNPC(npca);
hiddenTrigger = npca;
ownHiddenTrigger = true;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,519 +0,0 @@
#ifndef ZONEDB_H_
#define ZONEDB_H_
#include "../common/shareddb.h"
#include "../common/eq_packet_structs.h"
<<<<<<< HEAD
#include "../common/loottable.h"
#include "zonedump.h"
#include "position.h"
=======
>>>>>>> master
#include "../common/faction.h"
class Client;
class Corpse;
class Merc;
class NPC;
class Petition;
class Spawn2;
class SpawnGroupList;
class ItemInst;
struct CharacterEventLog_Struct;
struct Door;
struct ExtendedProfile_Struct;
struct NPCType;
struct PlayerCorpse_Struct;
struct ZonePoint;
struct npcDecayTimes_Struct;
template <class TYPE> class LinkedList;
//#include "doors.h"
struct wplist {
int index;
float x;
float y;
float z;
int pause;
float heading;
};
#pragma pack(1)
struct DBnpcspells_entries_Struct {
int16 spellid;
uint16 type;
uint8 minlevel;
uint8 maxlevel;
int16 manacost;
int32 recast_delay;
int16 priority;
int16 resist_adjust;
};
#pragma pack()
#pragma pack(1)
struct DBnpcspellseffects_entries_Struct {
int16 spelleffectid;
uint8 minlevel;
uint8 maxlevel;
int32 base;
int32 limit;
int32 max;
};
#pragma pack()
struct DBnpcspells_Struct {
uint32 parent_list;
uint16 attack_proc;
uint8 proc_chance;
uint16 range_proc;
int16 rproc_chance;
uint16 defensive_proc;
int16 dproc_chance;
uint32 numentries;
uint32 fail_recast;
uint32 engaged_no_sp_recast_min;
uint32 engaged_no_sp_recast_max;
uint8 engaged_beneficial_self_chance;
uint8 engaged_beneficial_other_chance;
uint8 engaged_detrimental_chance;
uint32 pursue_no_sp_recast_min;
uint32 pursue_no_sp_recast_max;
uint8 pursue_detrimental_chance;
uint32 idle_no_sp_recast_min;
uint32 idle_no_sp_recast_max;
uint8 idle_beneficial_chance;
DBnpcspells_entries_Struct entries[0];
};
struct DBnpcspellseffects_Struct {
uint32 parent_list;
uint32 numentries;
DBnpcspellseffects_entries_Struct entries[0];
};
struct DBTradeskillRecipe_Struct {
SkillUseTypes tradeskill;
int16 skill_needed;
uint16 trivial;
bool nofail;
bool replace_container;
std::vector< std::pair<uint32,uint8> > onsuccess;
std::vector< std::pair<uint32,uint8> > onfail;
std::vector< std::pair<uint32,uint8> > salvage;
std::string name;
uint8 must_learn;
bool has_learnt;
uint32 madecount;
uint32 recipe_id;
bool quest;
};
struct PetRecord {
uint32 npc_type; // npc_type id for the pet data to use
bool temporary;
int16 petpower;
uint8 petcontrol; // What kind of control over the pet is possible (Animation, familiar, ...)
uint8 petnaming; // How to name the pet (Warder, pet, random name, familiar, ...)
bool monsterflag; // flag for if a random monster appearance should get picked
uint32 equipmentset; // default equipment for the pet
};
// Actual pet info for a client.
struct PetInfo {
uint16 SpellID;
int16 petpower;
uint32 HP;
uint32 Mana;
float size;
SpellBuff_Struct Buffs[BUFF_COUNT];
uint32 Items[EmuConstants::EQUIPMENT_SIZE];
char Name[64];
};
struct ZoneSpellsBlocked {
uint32 spellid;
int8 type;
xyz_location m_Location;
xyz_location m_Difference;
char message[256];
};
struct TraderCharges_Struct {
uint32 ItemID[80];
int32 SerialNumber[80];
uint32 ItemCost[80];
int32 Charges[80];
};
const int MaxMercStanceID = 9;
struct MercStanceInfo {
uint8 ProficiencyID;
uint8 ClassID;
uint32 StanceID;
uint8 IsDefault;
};
struct MercTemplate {
uint32 MercTemplateID;
uint32 MercType; // From dbstr_us.txt - Apprentice (330000100), Journeyman (330000200), Master (330000300)
uint32 MercSubType; // From dbstr_us.txt - 330020105^23^Race: Guktan<br>Type: Healer<br>Confidence: High<br>Proficiency: Apprentice, Tier V...
uint16 RaceID;
uint8 ClassID;
uint32 MercNPCID;
uint8 ProficiencyID;
uint8 TierID;
uint8 CostFormula; // To determine cost to client
uint32 ClientVersion; // Only send valid mercs per expansion
uint8 MercNameType; // Determines if merc gets random name or default text
char MercNamePrefix[25];
char MercNameSuffix[25];
uint32 Stances[MaxMercStanceID];
};
struct MercInfo {
uint32 mercid;
uint8 slot;
char merc_name[64];
uint32 MercTemplateID;
const MercTemplate* myTemplate;
uint32 SuspendedTime;
bool IsSuspended;
uint32 MercTimerRemaining;
uint8 Gender;
float MercSize;
int32 State;
uint32 Stance;
int32 hp;
int32 mana;
int32 endurance;
uint8 face;
uint8 luclinHairStyle;
uint8 luclinHairColor;
uint8 luclinEyeColor;
uint8 luclinEyeColor2;
uint8 luclinBeardColor;
uint8 luclinBeard;
uint32 drakkinHeritage;
uint32 drakkinTattoo;
uint32 drakkinDetails;
};
struct MercSpellEntry {
uint8 proficiencyid;
uint16 spellid; // <= 0 = no spell
uint32 type; // 0 = never, must be one (and only one) of the defined values
int16 stance; // 0 = all, + = only this stance, - = all except this stance
uint8 minlevel;
uint8 maxlevel;
int16 slot;
uint16 proc_chance;
uint32 time_cancast; // when we can cast this spell next
};
struct ClientMercEntry {
uint32 id;
uint32 npcid;
};
class ZoneDatabase : public SharedDatabase {
typedef std::list<ServerLootItem_Struct*> ItemList;
public:
ZoneDatabase();
ZoneDatabase(const char* host, const char* user, const char* passwd, const char* database,uint32 port);
virtual ~ZoneDatabase();
/* Objects and World Containers */
void LoadWorldContainer(uint32 parentid, ItemInst* container);
void SaveWorldContainer(uint32 zone_id, uint32 parent_id, const ItemInst* container);
void DeleteWorldContainer(uint32 parent_id,uint32 zone_id);
uint32 AddObject(uint32 type, uint32 icon, const Object_Struct& object, const ItemInst* inst);
void UpdateObject(uint32 id, uint32 type, uint32 icon, const Object_Struct& object, const ItemInst* inst);
void DeleteObject(uint32 id);
Ground_Spawns* LoadGroundSpawns(uint32 zone_id, int16 version, Ground_Spawns* gs);
/* Traders */
void SaveTraderItem(uint32 char_id,uint32 itemid,uint32 uniqueid, int32 charges,uint32 itemcost,uint8 slot);
void UpdateTraderItemCharges(int char_id, uint32 ItemInstID, int32 charges);
void UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charges, uint32 NewPrice);
void DeleteTraderItem(uint32 char_id);
void DeleteTraderItem(uint32 char_id,uint16 slot_id);
ItemInst* LoadSingleTraderItem(uint32 char_id, int uniqueid);
Trader_Struct* LoadTraderItem(uint32 char_id);
TraderCharges_Struct* LoadTraderItemWithCharges(uint32 char_id);
/* Buyer/Barter */
void AddBuyLine(uint32 CharID, uint32 BuySlot, uint32 ItemID, const char *ItemName, uint32 Quantity, uint32 Price);
void RemoveBuyLine(uint32 CharID, uint32 BuySlot);
void DeleteBuyLines(uint32 CharID);
void UpdateBuyLine(uint32 CharID, uint32 BuySlot, uint32 Quantity);
/* General Character Related Stuff */
bool SetServerFilters(char* name, ServerSideFilters_Struct *ssfs);
uint32 GetServerFilters(char* name, ServerSideFilters_Struct *ssfs);
void SaveBuffs(Client *c);
void LoadBuffs(Client *c);
void LoadPetInfo(Client *c);
void SavePetInfo(Client *c);
void RemoveTempFactions(Client *c);
/* Character Data Loaders */
bool LoadCharacterFactionValues(uint32 character_id, faction_map & val_list);
bool LoadCharacterSpellBook(uint32 character_id, PlayerProfile_Struct* pp);
bool LoadCharacterMemmedSpells(uint32 character_id, PlayerProfile_Struct* pp);
bool LoadCharacterLanguages(uint32 character_id, PlayerProfile_Struct* pp);
bool LoadCharacterDisciplines(uint32 character_id, PlayerProfile_Struct* pp);
bool LoadCharacterSkills(uint32 character_id, PlayerProfile_Struct* pp);
bool LoadCharacterData(uint32 character_id, PlayerProfile_Struct* pp, ExtendedProfile_Struct* m_epp);
bool LoadCharacterCurrency(uint32 character_id, PlayerProfile_Struct* pp);
bool LoadCharacterBindPoint(uint32 character_id, PlayerProfile_Struct* pp);
bool LoadCharacterMaterialColor(uint32 character_id, PlayerProfile_Struct* pp);
bool LoadCharacterBandolier(uint32 character_id, PlayerProfile_Struct* pp);
bool LoadCharacterTribute(uint32 character_id, PlayerProfile_Struct* pp);
bool LoadCharacterPotions(uint32 character_id, PlayerProfile_Struct* pp);
bool LoadCharacterLeadershipAA(uint32 character_id, PlayerProfile_Struct* pp);
/* Character Data Saves */
bool SaveCharacterBindPoint(uint32 character_id, uint32 zone_id, uint32 instance_id, const xyz_heading& position, uint8 is_home);
bool SaveCharacterCurrency(uint32 character_id, PlayerProfile_Struct* pp);
bool SaveCharacterData(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp, ExtendedProfile_Struct* m_epp);
bool SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 current_level);
bool SaveCharacterSpell(uint32 character_id, uint32 spell_id, uint32 slot_id);
bool SaveCharacterMemorizedSpell(uint32 character_id, uint32 spell_id, uint32 slot_id);
bool SaveCharacterMaterialColor(uint32 character_id, uint32 slot_id, uint32 color);
bool SaveCharacterSkill(uint32 character_id, uint32 skill_id, uint32 value);
bool SaveCharacterLanguage(uint32 character_id, uint32 lang_id, uint32 value);
bool SaveCharacterDisc(uint32 character_id, uint32 slot_id, uint32 disc_id);
bool SaveCharacterTribute(uint32 character_id, PlayerProfile_Struct* pp);
bool SaveCharacterBandolier(uint32 character_id, uint8 bandolier_id, uint8 bandolier_slot, uint32 item_id, uint32 icon, const char* bandolier_name);
bool SaveCharacterPotionBelt(uint32 character_id, uint8 potion_id, uint32 item_id, uint32 icon);
bool SaveCharacterLeadershipAA(uint32 character_id, PlayerProfile_Struct* pp);
/* Character Data Deletes */
bool DeleteCharacterSpell(uint32 character_id, uint32 spell_id, uint32 slot_id);
bool DeleteCharacterMemorizedSpell(uint32 character_id, uint32 spell_id, uint32 slot_id);
bool DeleteCharacterDisc(uint32 character_id, uint32 slot_id);
bool DeleteCharacterBandolier(uint32 character_id, uint32 band_id);
bool DeleteCharacterLeadershipAAs(uint32 character_id);
bool DeleteCharacterAAs(uint32 character_id);
bool DeleteCharacterDye(uint32 character_id);
/* Character Inventory */
bool NoRentExpired(const char* name);
/* Corpses */
bool DeleteItemOffCharacterCorpse(uint32 db_id, uint32 equip_slot, uint32 item_id);
uint32 GetCharacterCorpseItemCount(uint32 corpse_id);
bool LoadCharacterCorpseData(uint32 corpse_id, PlayerCorpse_Struct* pcs);
Corpse* LoadCharacterCorpse(uint32 player_corpse_id);
Corpse* SummonBuriedCharacterCorpses(uint32 char_id, uint32 dest_zoneid, uint16 dest_instanceid, const xyz_heading& position);
void MarkCorpseAsRezzed(uint32 dbid);
bool GetDecayTimes(npcDecayTimes_Struct* npcCorpseDecayTimes);
bool BuryCharacterCorpse(uint32 dbid);
bool BuryAllCharacterCorpses(uint32 charid);
bool DeleteCharacterCorpse(uint32 dbid);
bool SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zoneid, uint16 dest_instanceid, const xyz_heading& position);
bool SummonAllGraveyardCorpses(uint32 cur_zoneid, uint32 dest_zoneid, uint16 dest_instanceid, const xyz_heading& position);
bool UnburyCharacterCorpse(uint32 dbid, uint32 new_zoneid, uint16 dest_instanceid, const xyz_heading& position);
bool LoadCharacterCorpses(uint32 iZoneID, uint16 iInstanceID);
bool DeleteGraveyard(uint32 zone_id, uint32 graveyard_id);
uint32 GetCharacterCorpseDecayTimer(uint32 corpse_db_id);
uint32 GetCharacterBuriedCorpseCount(uint32 char_id);
uint32 SendCharacterCorpseToGraveyard(uint32 dbid, uint32 zoneid, uint16 instanceid, const xyz_heading& position);
uint32 CreateGraveyardRecord(uint32 graveyard_zoneid, const xyz_heading& position);
uint32 AddGraveyardIDToZone(uint32 zone_id, uint32 graveyard_id);
uint32 SaveCharacterCorpse(uint32 charid, const char* charname, uint32 zoneid, uint16 instanceid, PlayerCorpse_Struct* dbpc, const xyz_heading& position);
uint32 UpdateCharacterCorpse(uint32 dbid, uint32 charid, const char* charname, uint32 zoneid, uint16 instanceid, PlayerCorpse_Struct* dbpc, const xyz_heading& position, bool rezzed = false);
uint32 GetFirstCorpseID(uint32 char_id);
uint32 GetCharacterCorpseCount(uint32 char_id);
uint32 GetCharacterCorpseID(uint32 char_id, uint8 corpse);
uint32 GetCharacterCorpseItemAt(uint32 corpse_id, uint16 slotid);
uint32 GetPlayerCorpseTimeLeft(uint8 corpse, uint8 type);
/* Faction */
bool GetNPCFactionList(uint32 npcfaction_id, int32* faction_id, int32* value, uint8* temp, int32* primary_faction = 0);
bool GetFactionData(FactionMods* fd, uint32 class_mod, uint32 race_mod, uint32 deity_mod, int32 faction_id); //needed for factions Dec, 16 2001
bool GetFactionName(int32 faction_id, char* name, uint32 buflen); // needed for factions Dec, 16 2001
bool GetFactionIdsForNPC(uint32 nfl_id, std::list<struct NPCFaction*> *faction_list, int32* primary_faction = 0); // improve faction handling
bool SetCharacterFactionLevel(uint32 char_id, int32 faction_id, int32 value, uint8 temp, faction_map &val_list); // needed for factions Dec, 16 2001
bool LoadFactionData();
/* AAs */
bool LoadAAEffects();
bool LoadAAEffects2();
bool LoadSwarmSpells();
SendAA_Struct*GetAASkillVars(uint32 skill_id);
uint8 GetTotalAALevels(uint32 skill_id);
uint32 GetSizeAA();
uint32 CountAAs();
void LoadAAs(SendAA_Struct **load);
uint32 CountAAEffects();
void FillAAEffects(SendAA_Struct* aa_struct);
/* Zone related */
bool GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct *data, bool &can_bind, bool &can_combat, bool &can_levitate, bool &can_castoutdoor, bool &is_city, bool &is_hotzone, bool &allow_mercs, uint8 &zone_type, int &ruleset, char **map_filename);
bool SaveZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct* zd);
bool LoadStaticZonePoints(LinkedList<ZonePoint*>* zone_point_list,const char* zonename, uint32 version);
bool UpdateZoneSafeCoords(const char* zonename, const xyz_location& location);
uint8 GetUseCFGSafeCoords();
int getZoneShutDownDelay(uint32 zoneID, uint32 version);
/* Spawns and Spawn Points */
bool LoadSpawnGroups(const char* zone_name, uint16 version, SpawnGroupList* spawn_group_list);
bool LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_group_list);
bool PopulateZoneSpawnList(uint32 zoneid, LinkedList<Spawn2*> &spawn2_list, int16 version, uint32 repopdelay = 0);
Spawn2* LoadSpawn2(LinkedList<Spawn2*> &spawn2_list, uint32 spawn2id, uint32 timeleft);
bool CreateSpawn2(Client *c, uint32 spawngroup, const char* zone, const xyz_heading& position, uint32 respawn, uint32 variance, uint16 condition, int16 cond_value);
void UpdateSpawn2Timeleft(uint32 id, uint16 instance_id,uint32 timeleft);
uint32 GetSpawnTimeLeft(uint32 id, uint16 instance_id);
void UpdateSpawn2Status(uint32 id, uint8 new_status);
/* Grids/Paths */
uint32 GetFreeGrid(uint16 zoneid);
void DeleteGrid(Client *c, uint32 sg2, uint32 grid_num, bool grid_too, uint16 zoneid);
void DeleteWaypoint(Client *c, uint32 grid_num, uint32 wp_num, uint16 zoneid);
void AddWP(Client *c, uint32 gridid, uint32 wpnum, const xyz_heading& position, uint32 pause, uint16 zoneid);
uint32 AddWPForSpawn(Client *c, uint32 spawn2id, const xyz_heading& position, uint32 pause, int type1, int type2, uint16 zoneid);
void ModifyGrid(Client *c, bool remove, uint32 id, uint8 type = 0, uint8 type2 = 0, uint16 zoneid = 0);
void ModifyWP(Client *c, uint32 grid_id, uint32 wp_num, const xyz_location& location, uint32 script = 0, uint16 zoneid = 0);
uint8 GetGridType(uint32 grid, uint32 zoneid);
uint8 GetGridType2(uint32 grid, uint16 zoneid);
bool GetWaypoints(uint32 grid, uint16 zoneid, uint32 num, wplist* wp);
void AssignGrid(Client *client, const xy_location& location, uint32 id);
int GetHighestGrid(uint32 zoneid);
int GetHighestWaypoint(uint32 zoneid, uint32 gridid);
/* NPCs */
uint32 NPCSpawnDB(uint8 command, const char* zone, uint32 zone_version, Client *c, NPC* spawn = 0, uint32 extra = 0); // 0 = Create 1 = Add; 2 = Update; 3 = Remove; 4 = Delete
uint32 CreateNewNPCCommand(const char* zone, uint32 zone_version, Client *client, NPC* spawn, uint32 extra);
uint32 AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_version, Client *client, NPC* spawn, uint32 respawnTime);
uint32 DeleteSpawnLeaveInNPCTypeTable(const char* zone, Client *client, NPC* spawn);
uint32 DeleteSpawnRemoveFromNPCTypeTable(const char* zone, uint32 zone_version, Client *client, NPC* spawn);
uint32 AddSpawnFromSpawnGroup(const char* zone, uint32 zone_version, Client *client, NPC* spawn, uint32 spawnGroupID);
uint32 AddNPCTypes(const char* zone, uint32 zone_version, Client *client, NPC* spawn, uint32 spawnGroupID);
uint32 UpdateNPCTypeAppearance(Client *client, NPC* spawn);
bool SetSpecialAttkFlag(uint8 id, const char* flag);
bool GetPetEntry(const char *pet_type, PetRecord *into);
bool GetPoweredPetEntry(const char *pet_type, int16 petpower, PetRecord *into);
bool GetBasePetItems(int32 equipmentset, uint32 *items);
void AddLootTableToNPC(NPC* npc, uint32 loottable_id, ItemList* itemlist, uint32* copper, uint32* silver, uint32* gold, uint32* plat);
void AddLootDropToNPC(NPC* npc, uint32 lootdrop_id, ItemList* itemlist, uint8 droplimit, uint8 mindrop);
uint32 GetMaxNPCSpellsID();
uint32 GetMaxNPCSpellsEffectsID();
DBnpcspells_Struct* GetNPCSpells(uint32 iDBSpellsID);
DBnpcspellseffects_Struct* GetNPCSpellsEffects(uint32 iDBSpellsEffectsID);
const NPCType* GetNPCType(uint32 id);
/* Mercs */
const NPCType* GetMercType(uint32 id, uint16 raceid, uint32 clientlevel);
void LoadMercEquipment(Merc *merc);
void SaveMercBuffs(Merc *merc);
void LoadMercBuffs(Merc *merc);
bool LoadMercInfo(Client *c);
bool LoadCurrentMerc(Client *c);
bool SaveMerc(Merc *merc);
bool DeleteMerc(uint32 merc_id);
/* Petitions */
void UpdateBug(BugStruct* bug);
void UpdateBug(PetitionBug_Struct* bug);
void DeletePetitionFromDB(Petition* wpet);
void UpdatePetitionToDB(Petition* wpet);
void InsertPetitionToDB(Petition* wpet);
void RefreshPetitionsFromDB();
/* Merchants */
void SaveMerchantTemp(uint32 npcid, uint32 slot, uint32 item, uint32 charges);
void DeleteMerchantTemp(uint32 npcid, uint32 slot);
/* Tradeskills */
bool GetTradeRecipe(const ItemInst* container, uint8 c_type, uint32 some_id, uint32 char_id, DBTradeskillRecipe_Struct *spec);
bool GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id, uint32 char_id, DBTradeskillRecipe_Struct *spec);
uint32 GetZoneForage(uint32 ZoneID, uint8 skill); /* for foraging */
uint32 GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id, uint8 &npc_chance);
void UpdateRecipeMadecount(uint32 recipe_id, uint32 char_id, uint32 madecount);
bool EnableRecipe(uint32 recipe_id);
bool DisableRecipe(uint32 recipe_id);
/* Tribute */
bool LoadTributes();
/* Doors */
bool DoorIsOpen(uint8 door_id,const char* zone_name);
void SetDoorPlace(uint8 value,uint8 door_id,const char* zone_name);
bool LoadDoors(int32 iDoorCount, Door *into, const char *zone_name, int16 version);
bool CheckGuildDoor(uint8 doorid,uint16 guild_id, const char* zone);
bool SetGuildDoor(uint8 doorid,uint16 guild_id, const char* zone);
uint32 GetGuildEQID(uint32 guilddbid);
void UpdateDoorGuildID(int doorid, int guild_id);
int32 GetDoorsCount(uint32* oMaxID, const char *zone_name, int16 version);
int32 GetDoorsCountPlusOne(const char *zone_name, int16 version);
int32 GetDoorsDBCountPlusOne(const char *zone_name, int16 version);
void InsertDoor(uint32 did, uint16 ddoorid, const char* ddoor_name, const xyz_heading& position, uint8 dopentype, uint16 dguildid, uint32 dlockpick, uint32 dkeyitem, uint8 ddoor_param, uint8 dinvert, int dincline, uint16 dsize);
/* Blocked Spells */
int32 GetBlockedSpellsCount(uint32 zoneid);
bool LoadBlockedSpells(int32 blockedSpellsCount, ZoneSpellsBlocked* into, uint32 zoneid);
/* Traps */
bool LoadTraps(const char* zonename, int16 version);
char* GetTrapMessage(uint32 trap_id);
/* Time */
uint32 GetZoneTZ(uint32 zoneid, uint32 version);
bool SetZoneTZ(uint32 zoneid, uint32 version, uint32 tz);
/* Group */
void RefreshGroupFromDB(Client *c);
uint8 GroupCount(uint32 groupid);
/* Raid */
uint8 RaidGroupCount(uint32 raidid, uint32 groupid);
/* Instancing */
void ListAllInstances(Client* c, uint32 charid);
/* QGlobals */
void QGlobalPurge();
/* Alternate Currency */
void LoadAltCurrencyValues(uint32 char_id, std::map<uint32, uint32> &currency);
void UpdateAltCurrencyValue(uint32 char_id, uint32 currency_id, uint32 value);
/*
* Misc stuff.
* PLEASE DO NOT ADD TO THIS COLLECTION OF CRAP UNLESS YOUR METHOD
* REALLY HAS NO BETTER SECTION
*/
bool logevents(const char* accountname,uint32 accountid,uint8 status,const char* charname,const char* target, const char* descriptiontype, const char* description,int event_nid);
void GetEventLogs(const char* name,char* target,uint32 account_id=0,uint8 eventid=0,char* detail=0,char* timestamp=0, CharacterEventLog_Struct* cel=0);
uint32 GetKarma(uint32 acct_id);
void UpdateKarma(uint32 acct_id, uint32 amount);
/* Things which really dont belong here... */
int16 CommandRequirement(const char* commandname);
protected:
void ZDBInitVars();
uint32 max_faction;
Faction** faction_array;
uint32 npc_spells_maxid;
uint32 npc_spellseffects_maxid;
DBnpcspells_Struct** npc_spells_cache;
bool* npc_spells_loadtried;
DBnpcspellseffects_Struct** npc_spellseffects_cache;
bool* npc_spellseffects_loadtried;
uint8 door_isopen_array[255];
};
extern ZoneDatabase database;
#endif /*ZONEDB_H_*/