From 2c252417634473316aa83e7bd175520cc597f816 Mon Sep 17 00:00:00 2001 From: KimLS Date: Wed, 16 Oct 2013 15:47:08 -0700 Subject: [PATCH 1/3] Fix for lua say links, other branch taking longer than thought so making this its own commit --- zone/lua_general.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index 22d3dd656..68819835a 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -600,16 +600,18 @@ int lua_merchant_count_item(uint32 npc_id, uint32 item_id) { } std::string lua_item_link(int item_id) { - char text[250]; + char text[250] = { 0 }; quest_manager.varlink(text, item_id); return std::string(text); } -void lua_say_link(const char *phrase, bool silent, const char *link_name) { +std::string lua_say_link(const char *phrase, bool silent, const char *link_name) { char text[256] = { 0 }; strncpy(text, phrase, 255); quest_manager.saylink(text, silent, link_name); + + return std::string(text); } const char *lua_get_guild_name_by_id(uint32 guild_id) { From 403ac53a9ee1f58eb11481ba36f6ba987e215472 Mon Sep 17 00:00:00 2001 From: Uleat Date: Fri, 18 Oct 2013 20:33:41 -0400 Subject: [PATCH 2/3] Renamed/expanded 'BagTypes' enumeration --- changelog.txt | 4 + common/Item.cpp | 6 +- common/eq_constants.h | 224 +++++++++++++++++++++++++------------ common/eq_packet_structs.h | 2 +- zone/mob.cpp | 2 +- zone/object.h | 45 +------- zone/special_attacks.cpp | 2 +- zone/tradeskills.cpp | 133 ++++++++++++---------- 8 files changed, 238 insertions(+), 180 deletions(-) diff --git a/changelog.txt b/changelog.txt index 7d5a86c5b..19198d592 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,9 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 10/18/2013 == +Uleat: Expanded the 'Bag Type' enumeration to include all known values. Also, set in place additional 'Bag Type' to 'Skill Type' conversions. Some of these will need to be verified before activation. +Uleat: Cleaned up some unused enumerations to show a move towards standardization. More to come... + == 10/12/2013 == demonstar55: Allow Titanium and lower clients to enter Tutorial zone from character select Bad_Captain: Fixed merc crash issue by updating special_abilities & vwMercNpcTypes (Sorvani). diff --git a/common/Item.cpp b/common/Item.cpp index 1f74b1b85..ff54f0426 100644 --- a/common/Item.cpp +++ b/common/Item.cpp @@ -1201,7 +1201,7 @@ int16 Inventory::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, boo if (inst && inst->IsType(ItemClassContainer) && inst->GetItem()->BagSize >= min_size) { - if(inst->GetItem()->BagType == bagTypeQuiver && inst->GetItem()->ItemType != ItemTypeArrow) + if(inst->GetItem()->BagType == BagType_Quiver && inst->GetItem()->ItemType != ItemTypeArrow) { continue; } @@ -1861,9 +1861,9 @@ bool Inventory::CanItemFitInContainer(const Item_Struct *ItemToTry, const Item_S if(ItemToTry->Size > Container->BagSize) return false; - if((Container->BagType == bagTypeQuiver) && (ItemToTry->ItemType != ItemTypeArrow)) return false; + if((Container->BagType == BagType_Quiver) && (ItemToTry->ItemType != ItemTypeArrow)) return false; - if((Container->BagType == bagTypeBandolier) && (ItemToTry->ItemType != ItemTypeThrowingv2)) return false; + if((Container->BagType == BagType_Bandolier) && (ItemToTry->ItemType != ItemTypeThrowingv2)) return false; return true; } diff --git a/common/eq_constants.h b/common/eq_constants.h index 9f77c0bda..1c5248461 100644 --- a/common/eq_constants.h +++ b/common/eq_constants.h @@ -21,19 +21,20 @@ #include "skills.h" /* -** Item attributes +** Item attributes ** +** (There are no grepwin hits other than these declarations... Do they have a use?) */ -enum ItemAttrib +enum ItemAttributes : uint32 { - ItemAttribLore = (1 << 0), - ItemAttribArtifact = (1 << 1), - ItemAttribSummoned = (1 << 2), - ItemAttribMagic = (1 << 3), - ItemAttribAugment = (1 << 4), - ItemAttribPendingLore = (1 << 5), - ItemAttribNone = 0, - ItemAttribUnknown = 0xFFFFFFFF + ItemAttr_None = 0x00000000, + ItemAttr_Lore = 0x00000001, + ItemAttr_Artifact = 0x00000002, + ItemAttr_Summoned = 0x00000004, + ItemAttr_Magic = 0x00000008, + ItemAttr_Augment = 0x00000010, + ItemAttr_PendingLore = 0x00000020, + ItemAttr_Unknown = 0xFFFFFFFF }; /* @@ -101,18 +102,77 @@ enum ItemTypes }; /* - Bag types +** Container types +** +** This correlates to world 'object.type' (object.h/Object.cpp) as well as Item_Struct.BagType +** +** (ref: database, web forums and eqstr_us.txt) */ -enum { - bagTypeSmallBag = 0, - bagTypeLargeBag = 1, - bagTypeQuiver = 2, - bagTypeBeltPouch = 3, - bagTypeBandolier = 8 - //... there are 50 types +enum ContainerTypes : uint8 +{ +/*3400*/ BagType_SmallBag = 0, +/*3401*/ BagType_LargeBag, +/*3402*/ BagType_Quiver, +/*3403*/ BagType_BeltPouch, +/*3404*/ BagType_WristPouch, +/*3405*/ BagType_BackPack, +/*3406*/ BagType_SmallChest, +/*3407*/ BagType_LargeChest, +/*----*/ BagType_Bandolier, // <*Database Reference Only> +/*3408*/ BagType_MedicineBag, +/*3409*/ BagType_ToolBox, +/*3410*/ BagType_Lexicon, +/*3411*/ BagType_Mortar, +/*3412*/ BagType_SelfDusting, // Quest container (Auto-clear contents?) +/*3413*/ BagType_MixingBowl, +/*3414*/ BagType_Oven, +/*3415*/ BagType_SewingKit, +/*3416*/ BagType_Forge, +/*3417*/ BagType_FletchingKit, +/*3418*/ BagType_BrewBarrel, +/*3419*/ BagType_JewelersKit, +/*3420*/ BagType_PotteryWheel, +/*3421*/ BagType_Kiln, +/*3422*/ BagType_Keymaker, // (no database entries as of peq rev 69) +/*3423*/ BagType_WizardsLexicon, +/*3424*/ BagType_MagesLexicon, +/*3425*/ BagType_NecromancersLexicon, +/*3426*/ BagType_EnchantersLexicon, +/*----*/ BagType_Unknown01, // (a coin pouch/purse?) (no database entries as of peq rev 69) +/*----*/ BagType_ConcordanceofResearch, // <*Database Reference Only> +/*3427*/ BagType_AlwaysWorks, // Quest container (Never-fail combines?) +/*3428*/ BagType_KoadaDalForge, // High Elf +/*3429*/ BagType_TeirDalForge, // Dark Elf +/*3430*/ BagType_OggokForge, // Ogre +/*3431*/ BagType_StormguardForge, // Dwarf +/*3432*/ BagType_AkanonForge, // Gnome +/*3433*/ BagType_NorthmanForge, // Barbarian +/*----*/ BagType_Unknown02, // (no database entries as of peq rev 69) +/*3434*/ BagType_CabilisForge, // Iksar +/*3435*/ BagType_FreeportForge, // Human 1 +/*3436*/ BagType_RoyalQeynosForge, // Human 2 +/*3439*/ BagType_HalflingTailoringKit, +/*3438*/ BagType_ErudTailoringKit, +/*3440*/ BagType_FierDalTailoringKit, // Wood Elf +/*3441*/ BagType_FierDalFletchingKit, // Wood Elf +/*3437*/ BagType_IksarPotteryWheel, +/*3442*/ BagType_TackleBox, +/*3443*/ BagType_TrollForge, +/*3445*/ BagType_FierDalForge, // Wood Elf +/*3444*/ BagType_ValeForge, // Halfling +/*3446*/ BagType_ErudForge, +/*----*/ BagType_TradersSatchel, // <*Database Reference Only> (db: Yellow Trader's Satchel Token?) +/*5785*/ BagType_GuktaForge, // Froglok (no database entries as of peq rev 69) +/*3359*/ BagType_AugmentationSealer, +/*----*/ BagType_IceCreamChurn, // <*Database Reference Only> +/*6325*/ BagType_Transformationmold, // Ornamentation +/*6340*/ BagType_Detransformationmold, // Ornamentation Stripper +/*5400*/ BagType_Unattuner, +/*7684*/ BagType_TradeskillBag, +/*7692*/ BagType_CollectibleBag, +/*----*/ BagType_Count }; - /* ** Item Effect Types ** @@ -171,28 +231,33 @@ typedef enum { } EmuAppearance; /* -** Diety List +** Diety types +** +** (ref: eqstr_us.txt) +** +** (Another orphaned enumeration...) */ -#define DEITY_UNKNOWN 0 -#define DEITY_AGNOSTIC 396 -#define DEITY_BRELL 202 -#define DEITY_CAZIC 203 -#define DEITY_EROL 204 -#define DEITY_BRISTLE 205 -#define DEITY_INNY 206 -#define DEITY_KARANA 207 -#define DEITY_MITH 208 -#define DEITY_PREXUS 209 -#define DEITY_QUELLIOUS 210 -#define DEITY_RALLOS 211 -#define DEITY_SOLUSEK 213 -#define DEITY_TRIBUNAL 214 -#define DEITY_TUNARE 215 - -//Guessed: -#define DEITY_BERT 201 -#define DEITY_RODCET 212 -#define DEITY_VEESHAN 216 +enum DeityTypes +{ +/*----*/ Deity_Unknown = 0, +/*3251*/ Deity_Bertoxxulous = 201, +/*3262*/ Deity_BrellSirilis, +/*3253*/ Deity_CazicThule, +/*3256*/ Deity_ErollisiMarr, +/*3252*/ Deity_Bristlebane, +/*3254*/ Deity_Innoruuk, +/*3255*/ Deity_Karana, +/*3257*/ Deity_MithanielMarr, +/*3259*/ Deity_Prexus, +/*3260*/ Deity_Quellious, +/*3266*/ Deity_RallosZek, +/*3258*/ Deity_RodcetNife, +/*3261*/ Deity_SolusekRo, +/*3263*/ Deity_TheTribunal, +/*3264*/ Deity_Tunare, +/*3265*/ Deity_Veeshan, +/*3250*/ Deity_Agnostic = 396 +}; // msg_type's for custom usercolors #define MT_Say 256 @@ -435,31 +500,33 @@ typedef enum { #define STAT_HASTE 19 #define STAT_DAMAGE_SHIELD 20 -/** -* Recast timer types. Used as an off set to charProfileStruct timers. +/* +** Recast timer types. Used as an off set to charProfileStruct timers. +** +** (Another orphaned enumeration...) */ -enum RecastTypes +enum RecastTimerTypes { - RecastTimer0 = 0, - RecastTimer1, - WeaponHealClickTimer, // 2 - MuramiteBaneNukeClickTimer, // 3 - RecastTimer4, - DispellClickTimer, // 5 (also click heal orbs?) - EpicTimer, // 6 - OoWBPClickTimer, // 7 - VishQuestClassItemTimer, // 8 - HealPotionTimer, // 9 - RecastTimer10, - RecastTimer11, - RecastTimer12, - RecastTimer13, - RecastTimer14, - RecastTimer15, - RecastTimer16, - RecastTimer17, - RecastTimer18, - ModRodTimer // 19 + RecTimer_0 = 0, + RecTimer_1, + RecTimer_WeaponHealClick, // 2 + RecTimer_MuramiteBaneNukeClick, // 3 + RecTimer_4, + RecTimer_DispellClick, // 5 (also click heal orbs?) + RecTimer_Epic, // 6 + RecTimer_OoWBPClick, // 7 + RecTimer_VishQuestClassItem, // 8 + RecTimer_HealPotion, // 9 + RecTimer_10, + RecTimer_11, + RecTimer_12, + RecTimer_13, + RecTimer_14, + RecTimer_15, + RecTimer_16, + RecTimer_17, + RecTimer_18, + RecTimer_ModRod // 19 }; enum GroupUpdateAction @@ -574,20 +641,33 @@ static const uint8 SkillDamageTypes[HIGHEST_SKILL+1] = { /* -** Inventory Slot Equipment Enum -** Mostly used for third-party tools to reference inventory slots +** Inventory Slot Equipment Enum +** Mostly used for third-party tools to reference inventory slots ** -** NOTE: Numbering for personal inventory goes top to bottom, then left to right +** [pre-HoT] +** NOTE: Numbering for personal inventory goes top to bottom, then left to right ** It's the opposite for inside bags: left to right, then top to bottom ** Example: -** inventory: containers: -** 1 6 1 2 -** 2 7 3 4 -** 3 8 5 6 -** 4 9 7 8 -** 5 10 9 10 +** Inventory: Containers: +** 1 5 1 2 +** 2 6 3 4 +** 3 7 5 6 +** 4 8 7 8 +** - - 9 10 +** +** [HoT and Higher] +** Note: Numbering for inventory and bags goes left to right, then top to bottom +** Example: +** Inventory: Containers: +** 1 2 1 2 +** 3 4 3 4 +** 5 6 5 6 +** 7 8 7 8 +** 9 10 9 10 +** - - 11 12 [Note: Additional slots are only available in RoF and higher] ** */ + enum InventorySlot { //////////////////////// diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index f5bc21a5d..29c5eb030 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -2880,7 +2880,7 @@ struct LogServer_Struct { /*260*/ uint8 enable_petition_wnd; /*261*/ uint8 enablevoicemacros; /*262*/ uint8 enablemail; -/*263*/ uint8 disable_tutorial_go_home; +/*263*/ uint8 disable_tutorial_go_home; // This appears valid on Ti and RoF..other clients need verification /*264*/ }; diff --git a/zone/mob.cpp b/zone/mob.cpp index 501271e2a..91f42f161 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -2049,7 +2049,7 @@ void Mob::SetAttackTimer() { const ItemInst *pi = CastToClient()->GetInv().GetItem(r); if(!pi) continue; - if(pi->IsType(ItemClassContainer) && pi->GetItem()->BagType == bagTypeQuiver) + if(pi->IsType(ItemClassContainer) && pi->GetItem()->BagType == BagType_Quiver) { float temp_wr = ( pi->GetItem()->BagWR / RuleI(Combat, QuiverWRHasteDiv) ); if(temp_wr > max_quiver) diff --git a/zone/object.h b/zone/object.h index d122c29e2..faf9555e6 100644 --- a/zone/object.h +++ b/zone/object.h @@ -71,46 +71,9 @@ IT10725_ACTORDEF=Shuriken */ // Object Types -#define OT_DROPPEDITEM 0x01 -#define OT_MEDICINEBAG 0x09 -#define OT_TOOLBOX 0x0A -#define OT_OVEN 0x0F -#define OT_SEWINGKIT 0x10 //and loom -#define OT_FORGE 0x11 -#define OT_FLETCHINGKIT 0x12 -#define OT_BREWBARREL 0x13 -#define OT_JEWELERSKIT 0x14 -#define OT_POTTERYWHEEL 0x15 -#define OT_KILN 0x16 -#define OT_KEYMAKER 0x17 -#define OT_WIZARDLEX 0x18 -#define OT_MAGELEX 0x19 -#define OT_NECROLEX 0x1A -#define OT_ENCHLEX 0x1B -// high elf forge is 0x1F (Koada'dal forge) -#define OT_TEIRDALFORGE 0x20 //dark elf -#define OT_OGGOKFORGE 0x21 //ogre -#define OT_STORMGUARDF 0x22 //dwarven -#define OT_VALEFORGE 0x31 //halfling -// gnome forge 0x23 (ak'anon forge) -// barbarian forge 0x24 (northman forge) -// -// iksar forge 0x26 (cabilis forge) -// human forge 0x27 (qeynos or freeport?) (royal qeynos forge or freeport forge) -// human forge 0x28 (qeynos or freeport?) -// halfling tailoring kit 0x29 -// erudite tailoring kit 0x2A -// wood elf tailoring kit 0x2B -// wood elf fletching kit 0x2C -// iksar pottery wheel 0x2D -#define OT_TACKLEBOX 0x2e -// troll forge 0x2F (grobb forge) -#define OT_FIERDALFFORGE 0x30 -// erudite forge 0x32 (erud forge) -#define OT_AUGMENT 0x35 -//... (shar vahl forge) -//... wood elf (fier'dal forge) -//... (froglok forge) +extern ContainerTypes; + +#define OT_DROPPEDITEM BagType_LargeBag // Icon values: //0x0453 a pie @@ -209,7 +172,7 @@ protected: ItemInst* m_inst; // Item representing object bool m_inuse; // Currently in use by a client? uint32 m_id; // Database key, different than drop_id - uint32 m_type; // Object Type, ie, forge, oven, dropped item, etc + uint32 m_type; // Object Type, ie, forge, oven, dropped item, etc (ref: ContainerTypes) uint32 m_icon; // Icon to use for forge, oven, etc float m_max_x; float m_max_y; diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 2630b4b64..7873c47ef 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -736,7 +736,7 @@ void Client::RangedAttack(Mob* other) { if(pi == nullptr || !pi->IsType(ItemClassContainer)) continue; const Item_Struct* bagitem = pi->GetItem(); - if(!bagitem || bagitem->BagType != bagTypeQuiver) + if(!bagitem || bagitem->BagType != BagType_Quiver) continue; //we found a quiver, look for the ammo in it diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index bdc59248e..90df72573 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -576,68 +576,79 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac parse->EventPlayer(EVENT_COMBINE_FAILURE, user, spec.name.c_str(), spec.recipe_id); } -SkillType Object::TypeToSkill(uint32 type) { - SkillType tradeskill = TradeskillUnknown; - switch (type) { - case OT_MEDICINEBAG: { - tradeskill = ALCHEMY; - break; - } - case OT_SEWINGKIT: { - tradeskill = TAILORING; - break; - } - case OT_FORGE: - case OT_TEIRDALFORGE: - case OT_OGGOKFORGE: - case OT_FIERDALFFORGE: - case OT_STORMGUARDF: - case OT_VALEFORGE: { - tradeskill = BLACKSMITHING; - break; - } - case OT_FLETCHINGKIT: { - tradeskill = FLETCHING; - break; - } - case OT_BREWBARREL: { - tradeskill = BREWING; - break; - } - case OT_JEWELERSKIT: { - tradeskill = JEWELRY_MAKING; - break; - } - case OT_POTTERYWHEEL: - case OT_KILN: { - tradeskill = POTTERY; - break; - } - case OT_OVEN: { - tradeskill = BAKING; - break; - } - case OT_TACKLEBOX: { - tradeskill = FISHING; - break; - } - case OT_KEYMAKER: { //unknown for now... - tradeskill = TradeskillUnknown; - break; - } - case OT_TOOLBOX: { - tradeskill = TINKERING; - break; - } - case OT_WIZARDLEX: - case OT_MAGELEX: - case OT_NECROLEX: - case OT_ENCHLEX: { - tradeskill = RESEARCH; - break; - } +SkillType Object::TypeToSkill(uint32 type) +{ + switch(type) // grouped and ordered by SkillType name - new types need to be verified for proper SkillType and use + { + /*ALCHEMY*/ + case BagType_MedicineBag: { return (SkillType)ALCHEMY; } + + /*BAKING*/ + // case BagType_MixingBowl: // No idea... + case BagType_Oven: { return (SkillType)BAKING; } + + /*BLACKSMITHING*/ + case BagType_Forge: + // case BagType_KoadaDalForge: + case BagType_TeirDalForge: + case BagType_OggokForge: + case BagType_StormguardForge: + // case BagType_AkanonForge: + // case BagType_NorthmanForge: + // case BagType_CabilisForge: + // case BagType_FreeportForge: + // case BagType_RoyalQeynosForge: + // case BagType_TrollForge: + case BagType_FierDalForge: + case BagType_ValeForge: { return (SkillType)BLACKSMITHING; } // Delete return if BagType_GuktaForge enabled + // case BagType_ErudForge: + // case BagType_GuktaForge: { return (SkillType)BLACKSMITHING; } + + /*BREWING*/ + // case BagType_IceCreamChurn: // No idea... + case BagType_BrewBarrel: { return (SkillType)BREWING; } + + /*FISHING*/ + case BagType_TackleBox: { return (SkillType)FISHING; } + + /*FLETCHING*/ + case BagType_FletchingKit: { return (SkillType)FLETCHING; } // Delete return if BagType_FierDalFletchingKit enabled + // case BagType_FierDalFletchingKit: { return (SkillType)FLETCHING; } + + /*JEWELRY_MAKING*/ + case BagType_JewelersKit: { return (SkillType)JEWELRY_MAKING; } + + /*MAKE_POISON*/ + // This is a guess and needs to be verified... (Could be ALCHEMY) + // case BagType_Mortar: { return (SkillType)MAKE_POISON; } + + /*POTTERY*/ + case BagType_PotteryWheel: + case BagType_Kiln: { return (SkillType)POTTERY; } // Delete return if BagType_IksarPotteryWheel enabled + // case BagType_IksarPotteryWheel: { return (SkillType)POTTERY; } + + /*RESEARCH*/ + // case BagType_Lexicon: + case BagType_WizardsLexicon: + case BagType_MagesLexicon: + case BagType_NecromancersLexicon: + case BagType_EnchantersLexicon: { return (SkillType)RESEARCH; } // Delete return if BagType_ConcordanceofResearch enabled + // case BagType_ConcordanceofResearch: { return (SkillType)RESEARCH; } + + /*TAILORING*/ + case BagType_SewingKit: { return (SkillType)TAILORING; } // Delete return if BagType_FierDalTailoringKit enabled + // case BagType_HalflingTailoringKit: + // case BagType_ErudTailoringKit: + // case BagType_FierDalTailoringKit: { return (SkillType)TAILORING; } + + /*TINKERING*/ + case BagType_ToolBox: { return (SkillType)TINKERING; } + + /*Undefined*/ + default: { break; } } - return(tradeskill); + + return TradeskillUnknown; } void Client::TradeskillSearchResults(const char *query, unsigned long qlen, unsigned long objtype, unsigned long someid) { From 4ef9732e370d8f9ada09f675a8cb0ce5a3f471c5 Mon Sep 17 00:00:00 2001 From: KimLS Date: Fri, 18 Oct 2013 21:43:47 -0700 Subject: [PATCH 3/3] Compile fix --- zone/object.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/zone/object.h b/zone/object.h index faf9555e6..e2f2bf6b6 100644 --- a/zone/object.h +++ b/zone/object.h @@ -70,9 +70,6 @@ IT10714_ACTORDEF=Augmentation Sealer IT10725_ACTORDEF=Shuriken */ -// Object Types -extern ContainerTypes; - #define OT_DROPPEDITEM BagType_LargeBag // Icon values: