From 8eb7d0aaa89888c30eb193bd08acf9a993c9e0f5 Mon Sep 17 00:00:00 2001 From: KimLS Date: Wed, 20 Feb 2013 13:54:26 -0800 Subject: [PATCH] Skill caps load with new smem scheme --- EMuShareMem/NPCFactionLists.h | 2 +- common/CMakeLists.txt | 1 + common/common_profile.h | 2 +- {zone => common}/features.h | 0 common/fixed_memory_hash_set.h | 4 +- common/shareddb.cpp | 217 ++++++++++++++++++++------------- common/shareddb.h | 7 +- common/spdat.h | 87 ++++++------- shared_memory/CMakeLists.txt | 2 + shared_memory/main.cpp | 13 ++ shared_memory/skill_caps.cpp | 45 +++++++ shared_memory/skill_caps.h | 25 ++++ shared_memory/spells.cpp | 7 +- zone/CMakeLists.txt | 1 - zone/MobAI.cpp | 2 +- zone/Object.cpp | 2 +- zone/QuestParserCollection.cpp | 2 +- zone/aggro.cpp | 2 +- zone/client.cpp | 2 +- zone/client_logs.cpp | 2 +- zone/client_logs.h | 2 +- zone/command.cpp | 6 +- zone/embparser.cpp | 2 +- zone/embparser.h | 2 +- zone/embperl.cpp | 2 +- zone/entity.cpp | 2 +- zone/exp.cpp | 2 +- zone/faction.h | 2 +- zone/groups.h | 2 +- zone/mob.h | 2 +- zone/net.cpp | 69 +---------- zone/perl_PlayerCorpse.cpp | 2 +- zone/perl_client.cpp | 2 +- zone/perl_doors.cpp | 2 +- zone/perl_entity.cpp | 2 +- zone/perl_groups.cpp | 2 +- zone/perl_hateentry.cpp | 2 +- zone/perl_mob.cpp | 2 +- zone/perl_npc.cpp | 2 +- zone/perl_object.cpp | 2 +- zone/perl_perlpacket.cpp | 2 +- zone/perl_questitem.cpp | 2 +- zone/perl_raids.cpp | 2 +- zone/perlparser.cpp | 2 +- zone/spell_effects.cpp | 2 +- zone/tasks.cpp | 2 +- zone/tribute.cpp | 2 +- zone/updatemgr.cpp | 2 +- zone/updatemgr.h | 2 +- zone/waypoints.cpp | 2 +- zone/zone.cpp | 2 +- zone/zone.h | 2 +- zone/zone_profile.cpp | 2 +- zone/zone_profile.h | 2 +- 54 files changed, 311 insertions(+), 253 deletions(-) rename {zone => common}/features.h (100%) create mode 100644 shared_memory/skill_caps.cpp create mode 100644 shared_memory/skill_caps.h diff --git a/EMuShareMem/NPCFactionLists.h b/EMuShareMem/NPCFactionLists.h index df1d222d8..b93192d6d 100644 --- a/EMuShareMem/NPCFactionLists.h +++ b/EMuShareMem/NPCFactionLists.h @@ -1,5 +1,5 @@ #include "../common/types.h" -#include "../zone/features.h" +#include "../common/features.h" #include "../zone/faction.h" #include "../common/EMuShareMem.h" diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index cc917d617..c7ff86d62 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -130,6 +130,7 @@ SET(common_headers eqtime.h errmsg.h extprofile.h + features.h fixed_memory_hash_set.h guild_base.h guilds.h diff --git a/common/common_profile.h b/common/common_profile.h index 6d65795c9..034a59d63 100644 --- a/common/common_profile.h +++ b/common/common_profile.h @@ -19,7 +19,7 @@ #define COMMON_PROFILE_H #ifdef ZONE -#include "../zone/features.h" +#include "../common/features.h" #ifndef EQPROFILE #ifdef COMMON_PROFILE diff --git a/zone/features.h b/common/features.h similarity index 100% rename from zone/features.h rename to common/features.h diff --git a/common/fixed_memory_hash_set.h b/common/fixed_memory_hash_set.h index 3a8525bf2..db06b1278 100644 --- a/common/fixed_memory_hash_set.h +++ b/common/fixed_memory_hash_set.h @@ -50,7 +50,7 @@ namespace EQEmu { byte *ptr = data; *reinterpret_cast(ptr) = max_element_id; - offset_count_ = max_element_id; + offset_count_ = max_element_id + 1; ptr += sizeof(key_type); *reinterpret_cast(ptr) = element_count; @@ -227,7 +227,7 @@ namespace EQEmu { //! Calculates how much memory we should allocate based on element size and count static size_type estimated_size(key_type element_count, key_type max_elements) { size_type total_size = 3 * sizeof(key_type); - total_size += sizeof(key_type) * max_elements; + total_size += sizeof(key_type) * (max_elements + 1); total_size += sizeof(T) * element_count; return total_size; } diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 11bc00139..e1b6f3545 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1,17 +1,20 @@ #include "shareddb.h" -#include "../common/Item.h" -#include "../common/EMuShareMem.h" -#include "../common/classes.h" -#include "../common/rulesys.h" -#include "../common/seperator.h" +#include +#include +#include +#include "Item.h" +#include "EMuShareMem.h" +#include "classes.h" +#include "rulesys.h" +#include "seperator.h" #include "MiscFunctions.h" #include "eq_packet_structs.h" #include "guilds.h" #include "extprofile.h" -#include -#include -#include +#include "memory_mapped_file.h" +#include "ipc_mutex.h" +#include "eqemu_exception.h" using namespace std; @@ -22,14 +25,14 @@ extern LoadEMuShareMemDLL EMuShareMemDLL; SharedDatabase *SharedDatabase::s_usedb = NULL; SharedDatabase::SharedDatabase() -: Database() +: Database(), skill_caps_mmf(NULL) { SDBInitVars(); s_usedb = this; } SharedDatabase::SharedDatabase(const char* host, const char* user, const char* passwd, const char* database, uint32 port) -: Database(host, user, passwd, database, port) +: Database(host, user, passwd, database, port), skill_caps_mmf(NULL) { SDBInitVars(); s_usedb = this; @@ -46,6 +49,7 @@ void SharedDatabase::SDBInitVars() { } SharedDatabase::~SharedDatabase() { + safe_delete(skill_caps_mmf); } bool SharedDatabase::SetHideMe(uint32 account_id, uint8 hideme) @@ -1519,15 +1523,62 @@ bool SharedDatabase::extDBLoadSkillCaps() { } bool SharedDatabase::LoadSkillCaps() { - if (!EMuShareMemDLL.Load()) - return false; - - uint8 class_count = PLAYER_CLASS_COUNT; - uint8 skill_count = HIGHEST_SKILL+1; - uint8 level_count = HARD_LEVEL_CAP+1; + if(skill_caps_mmf) + return true; - return EMuShareMemDLL.SkillCaps.LoadSkillCaps(&extDBLoadSkillCaps, - sizeof(uint16), class_count, skill_count, level_count); + uint32 class_count = PLAYER_CLASS_COUNT; + uint32 skill_count = HIGHEST_SKILL + 1; + uint32 level_count = HARD_LEVEL_CAP + 1; + uint32 size = (class_count * skill_count * level_count * sizeof(uint16)); + + try { + EQEmu::IPCMutex mutex("skill_caps"); + mutex.Lock(); + skill_caps_mmf = new EQEmu::MemoryMappedFile("shared/skill_caps"); + if(skill_caps_mmf->Size() != size) { + EQ_EXCEPT("SharedDatabase", "Unable to load skill caps: skill_caps_mmf->Size() != size"); + } + + mutex.Unlock(); + } catch(std::exception &ex) { + LogFile->write(EQEMuLog::Error, "Error loading skill caps: %s", ex.what()); + return false; + } + + return true; +} + +void SharedDatabase::LoadSkillCaps(void *data) { + uint32 class_count = PLAYER_CLASS_COUNT; + uint32 skill_count = HIGHEST_SKILL + 1; + uint32 level_count = HARD_LEVEL_CAP + 1; + + char errbuf[MYSQL_ERRMSG_SIZE]; + char *query = 0; + MYSQL_RES *result; + MYSQL_ROW row; + if(RunQuery(query, MakeAnyLenString(&query, + "SELECT skillID, class, level, cap FROM skill_caps ORDER BY skillID, class, level"), + errbuf, &result)) { + safe_delete_array(query); + + while((row = mysql_fetch_row(result))) { + uint8 skillID = atoi(row[0]); + uint8 class_ = atoi(row[1]) - 1; + uint8 level = atoi(row[2]); + uint16 cap = atoi(row[3]); + if(skillID >= skill_count || class_ >= class_count || level >= level_count) + continue; + + uint32 index = (((class_ * class_count) + skillID) * level_count) + level; + uint16 *skill_caps_table = reinterpret_cast(data); + skill_caps_table[index] = cap; + } + mysql_free_result(result); + } else { + LogFile->write(EQEMuLog::Error, "Error loading skill caps from database: %s", errbuf); + safe_delete_array(query); + } } bool SharedDatabase::DBLoadSkillCaps() { @@ -1567,48 +1618,82 @@ bool SharedDatabase::DBLoadSkillCaps() { } uint16 SharedDatabase::GetSkillCap(uint8 Class_, SkillType Skill, uint8 Level) { - if(Class_ == 0) - return(0); - int SkillMaxLevel = RuleI(Character, SkillCapMaxLevel); - if (SkillMaxLevel < 1) { - SkillMaxLevel = RuleI(Character, MaxLevel); - } - if(Level > SkillMaxLevel){ - return EMuShareMemDLL.SkillCaps.GetSkillCap(Class_-1, Skill, SkillMaxLevel); - } - else{ - return EMuShareMemDLL.SkillCaps.GetSkillCap(Class_-1, Skill, Level); - } + if(!skill_caps_mmf) { + return 0; + } + + if(Class_ == 0) + return 0; + + int SkillMaxLevel = RuleI(Character, SkillCapMaxLevel); + if(SkillMaxLevel < 1) { + SkillMaxLevel = RuleI(Character, MaxLevel); + } + + uint32 class_count = PLAYER_CLASS_COUNT; + uint32 skill_count = HIGHEST_SKILL + 1; + uint32 level_count = HARD_LEVEL_CAP + 1; + if(Level > static_cast(SkillMaxLevel)){ + Level = static_cast(SkillMaxLevel); + } + + uint32 index = ((((Class_ - 1) * class_count) + Skill) * level_count) + Level; + uint16 *skill_caps_table = reinterpret_cast(skill_caps_mmf->Get()); + return skill_caps_table[index]; } uint8 SharedDatabase::GetTrainLevel(uint8 Class_, SkillType Skill, uint8 Level) { - if(Class_ == 0) - return(0); + if(!skill_caps_mmf) { + return 0; + } - uint8 ret = 0; - int SkillMaxLevel = RuleI(Character, SkillCapMaxLevel); - if (SkillMaxLevel < 1) { - SkillMaxLevel = RuleI(Character, MaxLevel); - } - if(Level > SkillMaxLevel) { - ret = EMuShareMemDLL.SkillCaps.GetTrainLevel(Class_-1, Skill, SkillMaxLevel); + if(Class_ == 0) + return 0; + + int SkillMaxLevel = RuleI(Character, SkillCapMaxLevel); + if (SkillMaxLevel < 1) { + SkillMaxLevel = RuleI(Character, MaxLevel); + } + + uint32 class_count = PLAYER_CLASS_COUNT; + uint32 skill_count = HIGHEST_SKILL + 1; + uint32 level_count = HARD_LEVEL_CAP + 1; + uint8 ret = 0; + + if(Level > static_cast(SkillMaxLevel)) { + uint32 index = ((((Class_ - 1) * skill_count) + Skill) * level_count); + uint16 *skill_caps_table = reinterpret_cast(skill_caps_mmf->Get()); + for(uint8 x = 0; x < Level; x++){ + if(skill_caps_table[index + x]){ + ret = x; + break; + } + } } else { - ret = EMuShareMemDLL.SkillCaps.GetTrainLevel(Class_-1, Skill, Level); + uint32 index = ((((Class_ - 1) * skill_count) + Skill) * level_count); + uint16 *skill_caps_table = reinterpret_cast(skill_caps_mmf->Get()); + for(int x = 0; x < SkillMaxLevel; x++){ + if(skill_caps_table[index + x]){ + ret = x; + break; + } + } } - if(ret > GetSkillCap(Class_, Skill, Level)) - ret = GetSkillCap(Class_, Skill, Level); + + if(ret > GetSkillCap(Class_, Skill, Level)) + ret = GetSkillCap(Class_, Skill, Level); - return ret; + return ret; } -void SharedDatabase::DBLoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpellID) { +void SharedDatabase::LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpellID) { const char *DSQuery = "SELECT `spellid`, `type` from `damageshieldtypes` WHERE `spellid` > 0 " "AND `spellid` <= %i"; - const char *ERR_MYSQLERROR = "Error in DBLoadDamageShieldTypes: %s %s"; + const char *ERR_MYSQLERROR = "Error in LoadDamageShieldTypes: %s %s"; char errbuf[MYSQL_ERRMSG_SIZE]; char* query = 0; @@ -1777,10 +1862,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { sp[tempid].base2[y]=atoi(row[32+y]); // effect_limit_value for(y=0; y< EFFECT_COUNT;y++) sp[tempid].max[y]=atoi(row[44+y]); - - sp[tempid].icon=atoi(row[56]); - sp[tempid].memicon=atoi(row[57]); - + for(y=0; y< 4;y++) sp[tempid].components[y]=atoi(row[58+y]); @@ -1793,7 +1875,6 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { for(y=0; y< EFFECT_COUNT;y++) sp[tempid].formula[y]=atoi(row[70+y]); - sp[tempid].LightType=atoi(row[82]); sp[tempid].goodEffect=atoi(row[83]); sp[tempid].Activated=atoi(row[84]); sp[tempid].resisttype=atoi(row[85]); @@ -1816,63 +1897,31 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { sp[tempid].classes[y]=atoi(row[104+y]); sp[tempid].CastingAnim=atoi(row[120]); - sp[tempid].TargetAnim=atoi(row[121]); - sp[tempid].TravelType=atoi(row[122]); sp[tempid].SpellAffectIndex=atoi(row[123]); sp[tempid].disallow_sit=atoi(row[124]); - sp[tempid].spacing125=atoi(row[125]); for (y = 0; y < 16; y++) sp[tempid].deities[y]=atoi(row[126+y]); - for (y = 0; y < 2; y++) - sp[tempid].spacing142[y]=atoi(row[142+y]); - - sp[tempid].new_icon=atoi(row[144]); - sp[tempid].spellanim=atoi(row[145]); sp[tempid].uninterruptable=atoi(row[146]); sp[tempid].ResistDiff=atoi(row[147]); - sp[tempid].dot_stacking_exempt=atoi(row[148]); - sp[tempid].deletable=atoi(row[149]); sp[tempid].RecourseLink = atoi(row[150]); - for(y = 0; y < 3;y++) - sp[tempid].spacing151[y]=atoi(row[151+y]); - sp[tempid].short_buff_box = atoi(row[154]); sp[tempid].descnum = atoi(row[155]); - sp[tempid].typedescnum = atoi(row[156]); sp[tempid].effectdescnum = atoi(row[157]); - for(y = 0; y < 4;y++) - sp[tempid].spacing158[y]=atoi(row[158+y]); - sp[tempid].bonushate=atoi(row[162]); - for(y = 0; y < 3;y++) - sp[tempid].spacing163[y]=atoi(row[163+y]); - sp[tempid].EndurCost=atoi(row[166]); sp[tempid].EndurTimerIndex=atoi(row[167]); - sp[tempid].IsDisciplineBuff=atoi(row[168]); - - for(y = 0; y < 4; y++) - sp[tempid].spacing169[y]=atoi(row[169+y]); - sp[tempid].HateAdded=atoi(row[173]); sp[tempid].EndurUpkeep=atoi(row[174]); - - sp[tempid].spacing175=atoi(row[175]); sp[tempid].numhits = atoi(row[176]); - sp[tempid].pvpresistbase=atoi(row[177]); sp[tempid].pvpresistcalc=atoi(row[178]); sp[tempid].pvpresistcap=atoi(row[179]); sp[tempid].spell_category=atoi(row[180]); - - for(y = 0; y < 4;y++) - sp[tempid].spacing181[y]=atoi(row[181+y]); - sp[tempid].can_mgb=atoi(row[185]); sp[tempid].dispel_flag = atoi(row[186]); sp[tempid].MinResist = atoi(row[189]); @@ -1883,14 +1932,14 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { sp[tempid].directional_start = (float)atoi(row[194]); sp[tempid].directional_end = (float)atoi(row[195]); sp[tempid].spellgroup=atoi(row[207]); - sp[tempid].field209=atoi(row[209]); + sp[tempid].powerful_flag=atoi(row[209]); sp[tempid].CastRestriction = atoi(row[211]); sp[tempid].AllowRest = atoi(row[212]) != 0; sp[tempid].DamageShieldType = 0; } mysql_free_result(result); - DBLoadDamageShieldTypes(sp, max_spells); + LoadDamageShieldTypes(sp, max_spells); } else { _log(SPELLS__LOAD_ERR, "Error in LoadSpells query '%s' %s", query, errbuf); safe_delete_array(query); diff --git a/common/shareddb.h b/common/shareddb.h index c3d948aca..15eba6956 100644 --- a/common/shareddb.h +++ b/common/shareddb.h @@ -16,6 +16,9 @@ struct NPCFactionList; struct Faction; struct LootTable_Struct; struct LootDrop_Struct; +namespace EQEmu { + class MemoryMappedFile; +} /* * This object is inherited by world and zone's DB object, @@ -94,10 +97,11 @@ public: bool DBLoadNPCFactionLists(int32 iNPCFactionListCount, uint32 iMaxNPCFactionListID); bool DBLoadLoot(); bool DBLoadSkillCaps(); - void DBLoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpellID); int GetMaxSpellID(); void LoadSpells(void *data, int max_spells); + void LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpellID); + void LoadSkillCaps(void *data); bool LoadSkillCaps(); @@ -125,6 +129,7 @@ protected: uint32 npc_spells_maxid; + EQEmu::MemoryMappedFile *skill_caps_mmf; private: static SharedDatabase *s_usedb; }; diff --git a/common/spdat.h b/common/spdat.h index f7d2613f5..e2d1c2017 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -18,8 +18,8 @@ #ifndef SPDAT_H #define SPDAT_H -#include "../common/classes.h" -#include "../common/skills.h" +#include "classes.h" +#include "skills.h" #define SPELL_UNKNOWN 0xFFFF #define SPELLBOOK_UNKNOWN 0xFFFFFFFF //player profile spells are 32 bit @@ -603,7 +603,7 @@ typedef enum { // struct SPDat_Spell_Struct { -/* 000 */ int id; // not used +/* 000 */ //int id; // not used /* 001 */ char name[64]; // Name of the spell /* 002 */ char player_1[32]; // "PLAYER_1" /* 003 */ char teleport_zone[64]; // Teleport zone, pet name summoned, or item summoned @@ -623,93 +623,82 @@ struct SPDat_Spell_Struct /* 017 */ uint32 buffduration; /* 018 */ uint32 AEDuration; // sentinel, rain of something /* 019 */ uint16 mana; // Mana Used -/* 020 */ int32 base[EFFECT_COUNT]; //various purposes -/* 032 */ int base2[EFFECT_COUNT]; //various purposes +/* 020 */ int base[EFFECT_COUNT]; //various purposes +/* 032 */ int base2[EFFECT_COUNT]; //various purposes /* 044 */ int16 max[EFFECT_COUNT]; -/* 056 */ uint16 icon; // Spell icon -/* 057 */ uint16 memicon; // Icon on membarthing +/* 056 */ //uint16 icon; // Spell icon +/* 057 */ //uint16 memicon; // Icon on membarthing /* 058 */ int32 components[4]; // reagents /* 062 */ int component_counts[4]; // amount of regents used -/* 066 */ signed NoexpendReagent[4]; // focus items (Need but not used; Flame Lick has a Fire Beetle Eye focus.) +/* 066 */ int NoexpendReagent[4]; // focus items (Need but not used; Flame Lick has a Fire Beetle Eye focus.) // If it is a number between 1-4 it means components[number] is a focus and not to expend it // If it is a valid itemid it means this item is a focus as well /* 070 */ uint16 formula[EFFECT_COUNT]; // Spell's value formula -/* 082 */ int LightType; // probaly another effecttype flag -/* 083 */ int goodEffect; //0=detrimental, 1=Beneficial, 2=Beneficial, Group Only +/* 082 */ //int LightType; // probaly another effecttype flag +/* 083 */ int8 goodEffect; //0=detrimental, 1=Beneficial, 2=Beneficial, Group Only /* 084 */ int Activated; // probaly another effecttype flag /* 085 */ int resisttype; /* 086 */ int effectid[EFFECT_COUNT]; // Spell's effects /* 098 */ SpellTargetType targettype; // Spell's Target /* 099 */ int basediff; // base difficulty fizzle adjustment /* 100 */ SkillType skill; -/* 101 */ int16 zonetype; // 01=Outdoors, 02=dungeons, ff=Any -/* 102 */ uint16 EnvironmentType; -/* 103 */ int TimeOfDay; +/* 101 */ int8 zonetype; // 01=Outdoors, 02=dungeons, ff=Any +/* 102 */ int8 EnvironmentType; +/* 103 */ int8 TimeOfDay; /* 104 */ uint8 classes[PLAYER_CLASS_COUNT]; // Classes, and their min levels /* 120 */ uint8 CastingAnim; -/* 121 */ uint8 TargetAnim; -/* 122 */ uint32 TravelType; +/* 121 */ //uint8 TargetAnim; +/* 122 */ //uint32 TravelType; /* 123 */ uint16 SpellAffectIndex; -/* 124 */ int disallow_sit; // 124: high-end Yaulp spells (V, VI, VII, VIII [Rk 1, 2, & 3], & Gallenite's Bark of Fury -/* 125 */ int spacing125; // 125: Words of the Skeptic +/* 124 */ int8 disallow_sit; // 124: high-end Yaulp spells (V, VI, VII, VIII [Rk 1, 2, & 3], & Gallenite's Bark of Fury +/* 125 */ // 125: Words of the Skeptic /* 126 */ int8 deities[16]; // Deity check. 201 - 216 per http://www.eqemulator.net/wiki/wikka.php?wakka=DeityList // -1: Restrict to Deity; 1: Restrict to Deity, but only used on non-Live (Test Server "Blessing of ...") spells; 0: Don't restrict -/* 142 */ int spacing142[2]; // 142: between 0 & 100 +/* 142 */ // 142: between 0 & 100 // 143: always set to 0 -/* 144 */ int16 new_icon; // Spell icon used by the client in uifiles/default/spells??.tga, both for spell gems & buff window. Looks to depreciate icon & memicon -/* 145 */ int16 spellanim; // Doesn't look like it's the same as #doanim, so not sure what this is +/* 144 */ //int16 new_icon // Spell icon used by the client in uifiles/default/spells??.tga, both for spell gems & buff window. Looks to depreciate icon & memicon +/* 145 */ //int16 spellanim; // Doesn't look like it's the same as #doanim, so not sure what this is /* 146 */ int8 uninterruptable; // Looks like anything != 0 is uninterruptable. Values are mostly -1, 0, & 1 (Fetid Breath = 90?) /* 147 */ int16 ResistDiff; -/* 148 */ int dot_stacking_exempt; -/* 149 */ int deletable; -/* 150 */ uint16 RecourseLink; -/* 151 */ int spacing151[3]; // 151: -1, 0, or 1 +/* 148 */ //int dot_stacking_exempt; +/* 149 */ //int deletable; +/* 150 */ uint16 RecourseLink; +/* 151 */ // 151: -1, 0, or 1 // 152 & 153: all set to 0 -/* 154 */ int8 short_buff_box; // != 0, goes to short buff box. Not really supported in the server code +/* 154 */ int8 short_buff_box; // != 0, goes to short buff box. /* 155 */ int descnum; // eqstr of description of spell -/* 156 */ int typedescnum; // eqstr of type description +/* 156 */ //int typedescnum; // eqstr of type description /* 157 */ int effectdescnum; // eqstr of effect description -/* 158 */ int spacing158[4]; +/* 158 */ /* 162 */ int bonushate; -/* 163 */ int spacing163[3]; +/* 163 */ /* 166 */ int EndurCost; -/* 167 */ int EndurTimerIndex; -/* 168 */ int IsDisciplineBuff; //Will goto the combat window when cast -/* 169 */ int spacing169[4]; +/* 167 */ int8 EndurTimerIndex; +/* 168 */ //int IsDisciplineBuff; //Will goto the combat window when cast +/* 169 */ /* 173 */ int HateAdded; /* 174 */ int EndurUpkeep; -/* 175 */ int spacing175; +/* 175 */ /* 176 */ int numhits; /* 177 */ int pvpresistbase; /* 178 */ int pvpresistcalc; /* 179 */ int pvpresistcap; /* 180 */ int spell_category; -/* 181 */ int spacing181[4]; -/* 185 */ int can_mgb; // 0=no, -1 or 1 = yes +/* 181 */ +/* 185 */ int8 can_mgb; // 0=no, -1 or 1 = yes /* 186 */ int dispel_flag; /* 189 */ int MinResist; /* 190 */ int MaxResist; -/* 191 */ int viral_targets; -/* 192 */ int viral_timer; +/* 191 */ uint8 viral_targets; +/* 192 */ uint8 viral_timer; /* 193 */ int NimbusEffect; /* 194 */ float directional_start; /* 195 */ float directional_end; /* 207 */ int spellgroup; -/* 209 */ int field209; // Need more investigation to figure out what to call this, for now we know -1 makes charm spells not break before their duration is complete, it does alot more though +/* 209 */ int powerful_flag; // Need more investigation to figure out what to call this, for now we know -1 makes charm spells not break before their duration is complete, it does alot more though /* 211 */ int CastRestriction; //Various restriction categories for spells most seem targetable race related but have also seen others for instance only castable if target hp 20% or lower or only if target out of combat /* 212 */ bool AllowRest; -/* 219 */ int maxtargets; // not in DB yet, is used for beam and ring spells for target # limits - -//shared memory errors -/* 186 */ /*int8 nodispell;*/ // 0=can be dispelled, -1=can't be dispelled at all, 1=most can be cancelled w/ a cure but not dispelled -/* 187 */ /*uint8 npc_category;*/ // 0=not used, 1=AoE Detrimental, 2=DD, 3=Buffs, 4=Pets, 5=Healing, 6=Gate, 7=Debuff, 8=Dispell -/* 188 */ /*uint32 npc_usefulness;*/ // higher number = more useful, lower number = less useful -/* 189 */ /*int spacing189[18];*/ -/* 207 */ /*uint32 spellgroup;*/ -/* 208 */ /*int spacing208[7];*/ -// Might be newer fields in the live version, which is what some of the last fields are - - +/* 219 */ //int maxtargets; // not in DB yet, is used for beam and ring spells for target # limits uint8 DamageShieldType; // This field does not exist in spells_us.txt }; diff --git a/shared_memory/CMakeLists.txt b/shared_memory/CMakeLists.txt index 6373d8ffd..4b4442d74 100644 --- a/shared_memory/CMakeLists.txt +++ b/shared_memory/CMakeLists.txt @@ -3,10 +3,12 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) SET(shared_memory_sources main.cpp spells.cpp + skill_caps.cpp ) SET(shared_memory_headers spells.h + skill_caps.h ) ADD_EXECUTABLE(shared_memory ${shared_memory_sources} ${shared_memory_headers}) diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index 0e5305452..011a11309 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -25,6 +25,7 @@ #include "../common/rulesys.h" #include "../common/eqemu_exception.h" #include "spells.h" +#include "skill_caps.h" //blah global variables =( RuleManager *rules = new RuleManager(); @@ -55,6 +56,8 @@ int main(int argc, char **argv) { bool load_all = true; bool load_spells = true; + bool load_skill_caps = true; + if(load_all || load_spells) { LogFile->write(EQEMuLog::Status, "Loading spells..."); try { @@ -64,6 +67,16 @@ int main(int argc, char **argv) { return 0; } } + + if(load_all || load_skill_caps) { + LogFile->write(EQEMuLog::Status, "Loading skill caps..."); + try { + LoadSkillCaps(&database); + } catch(std::exception &ex) { + LogFile->write(EQEMuLog::Error, "%s", ex.what()); + return 0; + } + } return 0; } \ No newline at end of file diff --git a/shared_memory/skill_caps.cpp b/shared_memory/skill_caps.cpp new file mode 100644 index 000000000..01c0cb6f6 --- /dev/null +++ b/shared_memory/skill_caps.cpp @@ -0,0 +1,45 @@ +/* EQEMu: Everquest Server Emulator + Copyright (C) 2001-2013 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 "skill_caps.h" +#include "../common/debug.h" +#include "../common/shareddb.h" +#include "../common/ipc_mutex.h" +#include "../common/memory_mapped_file.h" +#include "../common/eqemu_exception.h" +#include "../common/spdat.h" +#include "../common/classes.h" +#include "../common/features.h" + +void LoadSkillCaps(SharedDatabase *database) { + EQEmu::IPCMutex mutex("skill_caps"); + mutex.Lock(); + + uint32 class_count = PLAYER_CLASS_COUNT; + uint32 skill_count = HIGHEST_SKILL + 1; + uint32 level_count = HARD_LEVEL_CAP + 1; + uint32 size = (class_count * skill_count * level_count * sizeof(uint16)); + EQEmu::MemoryMappedFile mmf("shared/skill_caps", size); + mmf.ZeroFile(); + + void *ptr = mmf.Get(); + database->LoadSkillCaps(ptr); + mmf.SetLoaded(); + + mutex.Unlock(); +} \ No newline at end of file diff --git a/shared_memory/skill_caps.h b/shared_memory/skill_caps.h new file mode 100644 index 000000000..044f83534 --- /dev/null +++ b/shared_memory/skill_caps.h @@ -0,0 +1,25 @@ +/* EQEMu: Everquest Server Emulator + Copyright (C) 2001-2013 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 +*/ + +#ifndef __EQEMU_SHARED_MEMORY_SKILL_CAPS_H +#define __EQEMU_SHARED_MEMORY_SKILL_CAPS_H + +class SharedDatabase; +void LoadSkillCaps(SharedDatabase *database); + +#endif diff --git a/shared_memory/spells.cpp b/shared_memory/spells.cpp index 0b91e101f..ef9670e75 100644 --- a/shared_memory/spells.cpp +++ b/shared_memory/spells.cpp @@ -27,11 +27,10 @@ void LoadSpells(SharedDatabase *database) { EQEmu::IPCMutex mutex("spells"); mutex.Lock(); - int records = database->GetMaxSpellID(); - if(records == -1) { - EQ_EXCEPT("Shared Memory", "Unable to get maximum number of spells from the database."); + int records = database->GetMaxSpellID() + 1; + if(records == 0) { + EQ_EXCEPT("Shared Memory", "Unable to get any spells from the database."); } - ++records; uint32 size = records * sizeof(SPDat_Spell_Struct); EQEmu::MemoryMappedFile mmf("shared/spells", size); diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt index 7743b4a3b..ae0839b61 100644 --- a/zone/CMakeLists.txt +++ b/zone/CMakeLists.txt @@ -106,7 +106,6 @@ SET(zone_headers errmsg.h event_codes.h faction.h - features.h forage.h groups.h guild_mgr.h diff --git a/zone/MobAI.cpp b/zone/MobAI.cpp index 79426a61f..4bc063998 100644 --- a/zone/MobAI.cpp +++ b/zone/MobAI.cpp @@ -32,7 +32,7 @@ using namespace std; #include "StringIDs.h" #include "../common/MiscFunctions.h" #include "../common/rulesys.h" -#include "features.h" +#include "../common/features.h" #include "QuestParserCollection.h" #include "watermap.h" diff --git a/zone/Object.cpp b/zone/Object.cpp index 6fb91ba75..d396e368c 100644 --- a/zone/Object.cpp +++ b/zone/Object.cpp @@ -25,7 +25,7 @@ #include "../common/packet_functions.h" #include "../common/packet_dump.h" #include "../common/MiscFunctions.h" -#include "features.h" +#include "../common/features.h" #include "StringIDs.h" using namespace std; diff --git a/zone/QuestParserCollection.cpp b/zone/QuestParserCollection.cpp index 05e43733b..e2a09075a 100644 --- a/zone/QuestParserCollection.cpp +++ b/zone/QuestParserCollection.cpp @@ -4,7 +4,7 @@ #include "QuestInterface.h" #include "zone.h" #include "zonedb.h" -#include "features.h" +#include "../common/features.h" #include #include diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 67a30568d..a343e8722 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -1441,7 +1441,7 @@ bool Mob::PassCharismaCheck(Mob* caster, Mob* spellTarget, uint16 spell_id) { if(IsCharmSpell(spell_id)) { - if (spells[spell_id].field209 == -1) //If charm spell has this set(-1), it can not break till end of duration. + if (spells[spell_id].powerful_flag == -1) //If charm spell has this set(-1), it can not break till end of duration. return true; //1: The mob has a default 25% chance of being allowed a resistance check against the charm. diff --git a/zone/client.cpp b/zone/client.cpp index bde18d13f..44419bfcd 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -45,7 +45,7 @@ using namespace std; extern volatile bool RunLoops; -#include "features.h" +#include "../common/features.h" #include "masterentity.h" #include "worldserver.h" #include "../common/misc.h" diff --git a/zone/client_logs.cpp b/zone/client_logs.cpp index 3a4922bfd..3e25176fa 100644 --- a/zone/client_logs.cpp +++ b/zone/client_logs.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "../common/debug.h" -#include "features.h" +#include "../common/features.h" #ifdef CLIENT_LOGS #include "client_logs.h" diff --git a/zone/client_logs.h b/zone/client_logs.h index 7a16eb7d7..374cc00ff 100644 --- a/zone/client_logs.h +++ b/zone/client_logs.h @@ -19,7 +19,7 @@ #ifndef CLIENT_LOGS_H #define CLIENT_LOGS_H #include "../common/debug.h" -#include "features.h" +#include "../common/features.h" #ifdef CLIENT_LOGS #include "../common/eq_packet_structs.h" diff --git a/zone/command.cpp b/zone/command.cpp index 3c32d2d9a..f6cf2c1cb 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -56,7 +56,7 @@ #include "masterentity.h" #include "map.h" #include "watermap.h" -#include "features.h" +#include "../common/features.h" #include "pathing.h" #include "client_logs.h" #include "guild_mgr.h" @@ -4285,13 +4285,10 @@ void command_spellinfo(Client *c, const Seperator *sep) c->Message(0, " base[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->base[0], s->base[1], s->base[2], s->base[3], s->base[4], s->base[5], s->base[6], s->base[7], s->base[8], s->base[9], s->base[10], s->base[11]); c->Message(0, " base22[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->base2[0], s->base2[1], s->base2[2], s->base2[3], s->base2[4], s->base2[5], s->base2[6], s->base2[7], s->base2[8], s->base2[9], s->base2[10], s->base2[11]); c->Message(0, " max[12]: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", s->max[0], s->max[1], s->max[2], s->max[3], s->max[4], s->max[5], s->max[6], s->max[7], s->max[8], s->max[9], s->max[10], s->max[11]); - c->Message(0, " icon: %d", s->icon); - c->Message(0, " memicon: %d", s->memicon); c->Message(0, " components[4]: %d, %d, %d, %d", s->components[0], s->components[1], s->components[2], s->components[3]); c->Message(0, " component_counts[4]: %d, %d, %d, %d", s->component_counts[0], s->component_counts[1], s->component_counts[2], s->component_counts[3]); c->Message(0, " NoexpendReagent[4]: %d, %d, %d, %d", s->NoexpendReagent[0], s->NoexpendReagent[1], s->NoexpendReagent[2], s->NoexpendReagent[3]); c->Message(0, " formula[12]: 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x", s->formula[0], s->formula[1], s->formula[2], s->formula[3], s->formula[4], s->formula[5], s->formula[6], s->formula[7], s->formula[8], s->formula[9], s->formula[10], s->formula[11]); - c->Message(0, " LightType: %d", s->LightType); c->Message(0, " goodEffect: %d", s->goodEffect); c->Message(0, " Activated: %d", s->Activated); c->Message(0, " resisttype: %d", s->resisttype); @@ -4307,7 +4304,6 @@ void command_spellinfo(Client *c, const Seperator *sep) s->classes[5], s->classes[6], s->classes[7], s->classes[8], s->classes[9], s->classes[10], s->classes[11], s->classes[12], s->classes[13], s->classes[14]); c->Message(0, " CastingAnim: %d", s->CastingAnim); - c->Message(0, " TargetAnim: %d", s->TargetAnim); c->Message(0, " SpellAffectIndex: %d", s->SpellAffectIndex); c->Message(0, " RecourseLink: %d", s->RecourseLink); } diff --git a/zone/embparser.cpp b/zone/embparser.cpp index 87484be3a..dc77b4e75 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -25,7 +25,7 @@ #include "../common/debug.h" #include "masterentity.h" -#include "features.h" +#include "../common/features.h" #include "embparser.h" #include "questmgr.h" #include "command.h" diff --git a/zone/embparser.h b/zone/embparser.h index daebae775..7b58b5930 100644 --- a/zone/embparser.h +++ b/zone/embparser.h @@ -9,7 +9,7 @@ #include "client.h" #include "parser.h" #include "embperl.h" -#include "features.h" +#include "../common/features.h" #include "QuestParserCollection.h" #include "QuestInterface.h" diff --git a/zone/embperl.cpp b/zone/embperl.cpp index c94a7537a..13e822ddf 100644 --- a/zone/embperl.cpp +++ b/zone/embperl.cpp @@ -16,7 +16,7 @@ Eglin #include #include "embperl.h" #include "embxs.h" -#include "features.h" +#include "../common/features.h" #ifndef GvCV_set #define GvCV_set(gv,cv) (GvCV(gv) = (cv)) #endif diff --git a/zone/entity.cpp b/zone/entity.cpp index c79c2f03e..3d5164fd6 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -40,7 +40,7 @@ using namespace std; #include "../common/packet_functions.h" #include "petitions.h" #include "../common/spdat.h" -#include "features.h" +#include "../common/features.h" #include "StringIDs.h" #include "parser.h" #include "../common/dbasync.h" diff --git a/zone/exp.cpp b/zone/exp.cpp index ede539a69..4d43b64af 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "../common/debug.h" -#include "features.h" +#include "../common/features.h" #include "masterentity.h" #include "StringIDs.h" #include "../common/MiscFunctions.h" diff --git a/zone/faction.h b/zone/faction.h index d7705bb8f..f7c35c002 100644 --- a/zone/faction.h +++ b/zone/faction.h @@ -19,7 +19,7 @@ #define FACTION_H #include "../common/types.h" -#include "features.h" +#include "../common/features.h" #include #include diff --git a/zone/groups.h b/zone/groups.h index 37910e2c0..51c54ce82 100644 --- a/zone/groups.h +++ b/zone/groups.h @@ -24,7 +24,7 @@ #include "../common/eq_packet_structs.h" #include "entity.h" #include "mob.h" -#include "features.h" +#include "../common/features.h" #include "../common/servertalk.h" #define MAX_MARKED_NPCS 3 diff --git a/zone/mob.h b/zone/mob.h index 11c3b1ae9..1b3407620 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -18,7 +18,7 @@ #ifndef MOB_H #define MOB_H -#include "features.h" +#include "../common/features.h" #include "common.h" #include "entity.h" #include "hate_list.h" diff --git a/zone/net.cpp b/zone/net.cpp index a3825c1f1..c0898e3a0 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -17,7 +17,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "../common/debug.h" -#include "features.h" +#include "../common/features.h" #include using namespace std; #include @@ -599,15 +599,6 @@ NetConnection::~NetConnection() { if (WorldAddress != 0) safe_delete_array(WorldAddress); } -bool chrcmpI(const char* a, const char* b) { -#if EQDEBUG >= 11 - _log(EQEMuLog::Debug, "crhcmpl() a:%i b:%i", (int*) a, (int*) b); -#endif - if(((int)* a)==((int)* b)) - return false; - else - return true; -} void LoadSpells(EQEmu::MemoryMappedFile **mmf) { int records = database.GetMaxSpellID() + 1; @@ -618,7 +609,7 @@ void LoadSpells(EQEmu::MemoryMappedFile **mmf) { *mmf = new EQEmu::MemoryMappedFile("shared/spells"); uint32 size = (*mmf)->Size(); if(size != (records * sizeof(SPDat_Spell_Struct))) { - EQ_EXCEPT("zone", "Unable to load spells: (*mmf)->Size() != records * sizeof(SPDat_Spell_Struct)"); + EQ_EXCEPT("Zone", "Unable to load spells: (*mmf)->Size() != records * sizeof(SPDat_Spell_Struct)"); } spells = reinterpret_cast((*mmf)->Get()); @@ -658,59 +649,3 @@ void UpdateWindowTitle(char* iNewTitle) { #endif } -/*bool ZoneBootup(uint32 iZoneID, bool iStaticZone) { - const char* zonename = database.GetZoneName(iStaticZone); - if (iZoneID == 0 || zonename == 0) - return false; - if (zone != 0 || ZoneLoaded) { - cerr << "Error: Zone::Bootup call when zone already booted!" << endl; - worldserver.SetZone(0); - return false; - } - numclients = 0; - zone = new Zone(iZoneID, zonename, net.GetZoneAddress(), net.GetZonePort()); - if (!zone->Init(iStaticZone)) { - safe_delete(zone); - cerr << "Zone->Init failed" << endl; - worldserver.SetZone(0); - return false; - } - if (!eqns.Open(net.GetZonePort())) { - safe_delete(zone); - cerr << "NetConnection::Init failed" << endl; - worldserver.SetZone(0); - return false; - } - if (!zone->LoadZoneCFG(zone->GetShortName(), true)) // try loading the zone name... - zone->LoadZoneCFG(zone->GetFileName()); // if that fails, try the file name, then load defaults - - //petition_list.ClearPetitions(); - //petition_list.ReadDatabase(); - ZoneLoaded = true; - worldserver.SetZone(iZoneID); - zone->GetTimeSync(); - cout << "-----------" << endl << "Zone server '" << zonename << "' listening on port:" << net.GetZonePort() << endl << "-----------" << endl; - //entity_list.WriteEntityIDs(); - UpdateWindowTitle(); - return true; -}*/ - -// Original source found at http://www.castaglia.org/proftpd/doc/devel-guide/src/lib/strsep.c.html -char *strsep(char **stringp, const char *delim) -{ - char *res; - - if(!stringp || !*stringp || !**stringp) - return (char*)0; - - res = *stringp; - while(**stringp && !strchr(delim,**stringp)) - (*stringp)++; - - if(**stringp) { - **stringp = '\0'; - (*stringp)++; - } - - return res; -} diff --git a/zone/perl_PlayerCorpse.cpp b/zone/perl_PlayerCorpse.cpp index fd68a4961..95d7aa9f5 100644 --- a/zone/perl_PlayerCorpse.cpp +++ b/zone/perl_PlayerCorpse.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "features.h" +#include "../common/features.h" #ifdef EMBPERL_XS_CLASSES #include "../common/debug.h" #include "embperl.h" diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 4b06b716f..caa80d77b 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "features.h" +#include "../common/features.h" #ifdef EMBPERL_XS_CLASSES #include "../common/debug.h" #include "embperl.h" diff --git a/zone/perl_doors.cpp b/zone/perl_doors.cpp index 92f314fc9..bf6aaf2a4 100644 --- a/zone/perl_doors.cpp +++ b/zone/perl_doors.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "features.h" +#include "../common/features.h" #ifdef EMBPERL_XS_CLASSES #include "../common/debug.h" #include "embperl.h" diff --git a/zone/perl_entity.cpp b/zone/perl_entity.cpp index 1102f76db..4594cff41 100644 --- a/zone/perl_entity.cpp +++ b/zone/perl_entity.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "features.h" +#include "../common/features.h" #ifdef EMBPERL_XS_CLASSES #include "../common/debug.h" #include diff --git a/zone/perl_groups.cpp b/zone/perl_groups.cpp index 54cb3b836..3f45bf68a 100644 --- a/zone/perl_groups.cpp +++ b/zone/perl_groups.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "features.h" +#include "../common/features.h" #ifdef EMBPERL_XS_CLASSES #include "../common/debug.h" #include "embperl.h" diff --git a/zone/perl_hateentry.cpp b/zone/perl_hateentry.cpp index 4d30af0ac..6fef9d59c 100644 --- a/zone/perl_hateentry.cpp +++ b/zone/perl_hateentry.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "features.h" +#include "../common/features.h" #include "client.h" #ifdef EMBPERL_XS_CLASSES #include "../common/debug.h" diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index 32d7282b1..0e0b8321f 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "features.h" +#include "../common/features.h" #ifdef EMBPERL_XS_CLASSES #include "../common/debug.h" #include "embperl.h" diff --git a/zone/perl_npc.cpp b/zone/perl_npc.cpp index 86f0fa039..c228d81db 100644 --- a/zone/perl_npc.cpp +++ b/zone/perl_npc.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "features.h" +#include "../common/features.h" #ifdef EMBPERL_XS_CLASSES #include "../common/debug.h" #include "embperl.h" diff --git a/zone/perl_object.cpp b/zone/perl_object.cpp index b465736f0..9643edff2 100644 --- a/zone/perl_object.cpp +++ b/zone/perl_object.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "features.h" +#include "../common/features.h" #ifdef EMBPERL_XS_CLASSES #include "../common/debug.h" #include "embperl.h" diff --git a/zone/perl_perlpacket.cpp b/zone/perl_perlpacket.cpp index 7ec92ba58..0b3e020f9 100644 --- a/zone/perl_perlpacket.cpp +++ b/zone/perl_perlpacket.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "features.h" +#include "../common/features.h" #ifdef EMBPERL_XS_CLASSES #include "../common/debug.h" #include "embperl.h" diff --git a/zone/perl_questitem.cpp b/zone/perl_questitem.cpp index 12e5f38c6..e6b54a3b0 100644 --- a/zone/perl_questitem.cpp +++ b/zone/perl_questitem.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "features.h" +#include "../common/features.h" #include "client.h" #ifdef EMBPERL_XS_CLASSES #include "../common/debug.h" diff --git a/zone/perl_raids.cpp b/zone/perl_raids.cpp index b44f39668..b0dc4086e 100644 --- a/zone/perl_raids.cpp +++ b/zone/perl_raids.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "features.h" +#include "../common/features.h" #ifdef EMBPERL_XS_CLASSES #include "../common/debug.h" #include "embperl.h" diff --git a/zone/perlparser.cpp b/zone/perlparser.cpp index 8c3062069..148e50154 100644 --- a/zone/perlparser.cpp +++ b/zone/perlparser.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "features.h" +#include "../common/features.h" #ifdef EMBPERL #ifdef EMBPERL_XS diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 8973dd2f8..6f155dd4a 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -741,7 +741,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) // define spells with fixed duration // charm spells with -1 in field 209 are all of fixed duration, so lets use that instead of spell_ids - if(spells[spell_id].field209 == -1) + if(spells[spell_id].powerful_flag == -1) bBreak = true; if (!bBreak) diff --git a/zone/tasks.cpp b/zone/tasks.cpp index ad89aaa35..545c276eb 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -30,7 +30,7 @@ Copyright (C) 2001-2008 EQEMu Development Team (http://eqemulator.net) #include "../common/MiscFunctions.h" #include "../common/rulesys.h" #include "masterentity.h" -#include "features.h" +#include "../common/features.h" #include "QuestParserCollection.h" diff --git a/zone/tribute.cpp b/zone/tribute.cpp index d0989c6b4..a6124d00a 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -17,7 +17,7 @@ */ #include "../common/debug.h" #include "../common/eq_packet_structs.h" -#include "features.h" +#include "../common/features.h" #include "masterentity.h" #include "../common/packet_dump.h" #include "../common/MiscFunctions.h" diff --git a/zone/updatemgr.cpp b/zone/updatemgr.cpp index 16b9e3ca3..bf71bd017 100644 --- a/zone/updatemgr.cpp +++ b/zone/updatemgr.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "../common/debug.h" -#include "features.h" +#include "../common/features.h" #ifdef PACKET_UPDATE_MANAGER #include "updatemgr.h" diff --git a/zone/updatemgr.h b/zone/updatemgr.h index 4c2733e70..7ca4da0ef 100644 --- a/zone/updatemgr.h +++ b/zone/updatemgr.h @@ -18,7 +18,7 @@ #ifndef UPDATE_MANAGER_H #define UPDATE_MANAGER_H -#include "features.h" +#include "../common/features.h" #ifdef PACKET_UPDATE_MANAGER #include "../common/timer.h" diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 7855e4b35..277e1539c 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -33,7 +33,7 @@ using namespace std; #include "StringIDs.h" #include "../common/MiscFunctions.h" #include "../common/rulesys.h" -#include "features.h" +#include "../common/features.h" #include "QuestParserCollection.h" struct wp_distance diff --git a/zone/zone.cpp b/zone/zone.cpp index 78e00bb66..7af90fd6a 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -35,7 +35,7 @@ using namespace std; #endif #include "masterentity.h" -#include "features.h" +#include "../common/features.h" #include "spawngroup.h" #include "spawn2.h" #include "zone.h" diff --git a/zone/zone.h b/zone/zone.h index 903390e2f..856362edc 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -25,7 +25,7 @@ #include "../common/servertalk.h" #include "../common/rulesys.h" #include "../common/eq_packet_structs.h" -#include "features.h" +#include "../common/features.h" #include "spawngroup.h" //#include "mob.h" #include "zonedump.h" diff --git a/zone/zone_profile.cpp b/zone/zone_profile.cpp index 1c7ce9f6f..f26a5786d 100644 --- a/zone/zone_profile.cpp +++ b/zone/zone_profile.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "../common/debug.h" -#include "features.h" +#include "../common/features.h" #ifdef EQPROFILE #include "zone_profile.h" diff --git a/zone/zone_profile.h b/zone/zone_profile.h index 59fcc7a3c..04deea562 100644 --- a/zone/zone_profile.h +++ b/zone/zone_profile.h @@ -19,7 +19,7 @@ #define ZONE_PROFILE_H #ifdef ZONE //only possibly profile if we are building zone -#include "features.h" +#include "../common/features.h" #endif #ifdef EQPROFILE