mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-21 18:31:30 +00:00
Renamed and moved SkillUseTypes enumeration to EQEmu::skills::SkillType; eq_dictionary work
This commit is contained in:
parent
615158e701
commit
71f128731f
@ -1,5 +1,9 @@
|
|||||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
== 05/25/2016 ==
|
||||||
|
Uleat: Renamed and moved enumeration SkillUseTypes to EQEmu::skill::SkillType - added class EQEmu::SkillProfile, though not implemented at this time
|
||||||
|
Uleat: Some more work on eq_dictionary
|
||||||
|
|
||||||
== 05/21/2016 ==
|
== 05/21/2016 ==
|
||||||
Uleat: Moved struct Item_Struct into namespace EQEmu along with associated enumerations - enumerations into namespace EQEmu::item (run shared_memory)
|
Uleat: Moved struct Item_Struct into namespace EQEmu along with associated enumerations - enumerations into namespace EQEmu::item (run shared_memory)
|
||||||
Uleat: Fixed a few possible crash points in linux builds associated with augments/ornamentations
|
Uleat: Fixed a few possible crash points in linux builds associated with augments/ornamentations
|
||||||
|
|||||||
@ -15,6 +15,7 @@ SET(common_sources
|
|||||||
deity.cpp
|
deity.cpp
|
||||||
emu_constants.cpp
|
emu_constants.cpp
|
||||||
emu_legacy.cpp
|
emu_legacy.cpp
|
||||||
|
emu_limits.cpp
|
||||||
emu_opcodes.cpp
|
emu_opcodes.cpp
|
||||||
emu_tcp_connection.cpp
|
emu_tcp_connection.cpp
|
||||||
emu_tcp_server.cpp
|
emu_tcp_server.cpp
|
||||||
@ -121,6 +122,7 @@ SET(common_headers
|
|||||||
deity.h
|
deity.h
|
||||||
emu_constants.h
|
emu_constants.h
|
||||||
emu_legacy.h
|
emu_legacy.h
|
||||||
|
emu_limits.h
|
||||||
emu_opcodes.h
|
emu_opcodes.h
|
||||||
emu_oplist.h
|
emu_oplist.h
|
||||||
emu_tcp_connection.h
|
emu_tcp_connection.h
|
||||||
|
|||||||
@ -18,241 +18,3 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "emu_constants.h"
|
#include "emu_constants.h"
|
||||||
#include "string_util.h"
|
|
||||||
|
|
||||||
|
|
||||||
uint16 EQEmu::constants::InventoryTypeSize(int16 type_index)
|
|
||||||
{
|
|
||||||
switch (type_index) {
|
|
||||||
case legacy::TypePossessions:
|
|
||||||
return legacy::TYPE_POSSESSIONS_SIZE;
|
|
||||||
case legacy::TypeBank:
|
|
||||||
return legacy::TYPE_BANK_SIZE;
|
|
||||||
case legacy::TypeSharedBank:
|
|
||||||
return legacy::TYPE_SHARED_BANK_SIZE;
|
|
||||||
case legacy::TypeTrade:
|
|
||||||
return legacy::TYPE_TRADE_SIZE;
|
|
||||||
case legacy::TypeWorld:
|
|
||||||
return legacy::TYPE_WORLD_SIZE;
|
|
||||||
case legacy::TypeLimbo:
|
|
||||||
return legacy::TYPE_LIMBO_SIZE;
|
|
||||||
case legacy::TypeTribute:
|
|
||||||
return legacy::TYPE_TRIBUTE_SIZE;
|
|
||||||
case legacy::TypeTrophyTribute:
|
|
||||||
return legacy::TYPE_TROPHY_TRIBUTE_SIZE;
|
|
||||||
case legacy::TypeGuildTribute:
|
|
||||||
return legacy::TYPE_GUILD_TRIBUTE_SIZE;
|
|
||||||
case legacy::TypeMerchant:
|
|
||||||
return legacy::TYPE_MERCHANT_SIZE;
|
|
||||||
case legacy::TypeDeleted:
|
|
||||||
return legacy::TYPE_DELETED_SIZE;
|
|
||||||
case legacy::TypeCorpse:
|
|
||||||
return legacy::TYPE_CORPSE_SIZE;
|
|
||||||
case legacy::TypeBazaar:
|
|
||||||
return legacy::TYPE_BAZAAR_SIZE;
|
|
||||||
case legacy::TypeInspect:
|
|
||||||
return legacy::TYPE_INSPECT_SIZE;
|
|
||||||
case legacy::TypeRealEstate:
|
|
||||||
return legacy::TYPE_REAL_ESTATE_SIZE;
|
|
||||||
case legacy::TypeViewMODPC:
|
|
||||||
return legacy::TYPE_VIEW_MOD_PC_SIZE;
|
|
||||||
case legacy::TypeViewMODBank:
|
|
||||||
return legacy::TYPE_VIEW_MOD_BANK_SIZE;
|
|
||||||
case legacy::TypeViewMODSharedBank:
|
|
||||||
return legacy::TYPE_VIEW_MOD_SHARED_BANK_SIZE;
|
|
||||||
case legacy::TypeViewMODLimbo:
|
|
||||||
return legacy::TYPE_VIEW_MOD_LIMBO_SIZE;
|
|
||||||
case legacy::TypeAltStorage:
|
|
||||||
return legacy::TYPE_ALT_STORAGE_SIZE;
|
|
||||||
case legacy::TypeArchived:
|
|
||||||
return legacy::TYPE_ARCHIVED_SIZE;
|
|
||||||
case legacy::TypeMail:
|
|
||||||
return legacy::TYPE_MAIL_SIZE;
|
|
||||||
case legacy::TypeGuildTrophyTribute:
|
|
||||||
return legacy::TYPE_GUILD_TROPHY_TRIBUTE_SIZE;
|
|
||||||
case legacy::TypeKrono:
|
|
||||||
return legacy::TYPE_KRONO_SIZE;
|
|
||||||
case legacy::TypeOther:
|
|
||||||
return legacy::TYPE_OTHER_SIZE;
|
|
||||||
default:
|
|
||||||
return NOT_USED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
const char* EQEmu::constants::InventoryLocationName(Location_Struct location)
|
|
||||||
{
|
|
||||||
// not ready for implementation...
|
|
||||||
std::string ret_str;
|
|
||||||
StringFormat(ret_str, "%s, %s, %s, %s", InventoryMapName(location.map), InventoryMainName(location.main), InventorySubName(location.sub), InventoryAugName(location.aug));
|
|
||||||
return ret_str;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
const char* EQEmu::constants::InventoryTypeName(int16 type_index)
|
|
||||||
{
|
|
||||||
switch (type_index) {
|
|
||||||
case INVALID_INDEX:
|
|
||||||
return "Invalid Type";
|
|
||||||
case legacy::TypePossessions:
|
|
||||||
return "Possessions";
|
|
||||||
case legacy::TypeBank:
|
|
||||||
return "Bank";
|
|
||||||
case legacy::TypeSharedBank:
|
|
||||||
return "SharedBank";
|
|
||||||
case legacy::TypeTrade:
|
|
||||||
return "Trade";
|
|
||||||
case legacy::TypeWorld:
|
|
||||||
return "World";
|
|
||||||
case legacy::TypeLimbo:
|
|
||||||
return "Limbo";
|
|
||||||
case legacy::TypeTribute:
|
|
||||||
return "Tribute";
|
|
||||||
case legacy::TypeTrophyTribute:
|
|
||||||
return "TrophyTribute";
|
|
||||||
case legacy::TypeGuildTribute:
|
|
||||||
return "GuildTribute";
|
|
||||||
case legacy::TypeMerchant:
|
|
||||||
return "Merchant";
|
|
||||||
case legacy::TypeDeleted:
|
|
||||||
return "Deleted";
|
|
||||||
case legacy::TypeCorpse:
|
|
||||||
return "Corpse";
|
|
||||||
case legacy::TypeBazaar:
|
|
||||||
return "Bazaar";
|
|
||||||
case legacy::TypeInspect:
|
|
||||||
return "Inspect";
|
|
||||||
case legacy::TypeRealEstate:
|
|
||||||
return "RealEstate";
|
|
||||||
case legacy::TypeViewMODPC:
|
|
||||||
return "ViewMODPC";
|
|
||||||
case legacy::TypeViewMODBank:
|
|
||||||
return "ViewMODBank";
|
|
||||||
case legacy::TypeViewMODSharedBank:
|
|
||||||
return "ViewMODSharedBank";
|
|
||||||
case legacy::TypeViewMODLimbo:
|
|
||||||
return "ViewMODLimbo";
|
|
||||||
case legacy::TypeAltStorage:
|
|
||||||
return "AltStorage";
|
|
||||||
case legacy::TypeArchived:
|
|
||||||
return "Archived";
|
|
||||||
case legacy::TypeMail:
|
|
||||||
return "Mail";
|
|
||||||
case legacy::TypeGuildTrophyTribute:
|
|
||||||
return "GuildTrophyTribute";
|
|
||||||
case legacy::TypeKrono:
|
|
||||||
return "Krono";
|
|
||||||
case legacy::TypeOther:
|
|
||||||
return "Other";
|
|
||||||
default:
|
|
||||||
return "Unknown Type";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* EQEmu::constants::InventorySlotName(int16 slot_index)
|
|
||||||
{
|
|
||||||
switch (slot_index) {
|
|
||||||
case INVALID_INDEX:
|
|
||||||
return "Invalid Slot";
|
|
||||||
case legacy::SlotCharm:
|
|
||||||
return "Charm";
|
|
||||||
case legacy::SlotEar1:
|
|
||||||
return "Ear1";
|
|
||||||
case legacy::SlotHead:
|
|
||||||
return "Head";
|
|
||||||
case legacy::SlotFace:
|
|
||||||
return "Face";
|
|
||||||
case legacy::SlotEar2:
|
|
||||||
return "Ear2";
|
|
||||||
case legacy::SlotNeck:
|
|
||||||
return "Neck";
|
|
||||||
case legacy::SlotShoulders:
|
|
||||||
return "Shoulders";
|
|
||||||
case legacy::SlotArms:
|
|
||||||
return "Arms";
|
|
||||||
case legacy::SlotBack:
|
|
||||||
return "Back";
|
|
||||||
case legacy::SlotWrist1:
|
|
||||||
return "Wrist1";
|
|
||||||
case legacy::SlotWrist2:
|
|
||||||
return "Wrist2";
|
|
||||||
case legacy::SlotRange:
|
|
||||||
return "Range";
|
|
||||||
case legacy::SlotHands:
|
|
||||||
return "Hands";
|
|
||||||
case legacy::SlotPrimary:
|
|
||||||
return "Primary";
|
|
||||||
case legacy::SlotSecondary:
|
|
||||||
return "Secondary";
|
|
||||||
case legacy::SlotFinger1:
|
|
||||||
return "Finger1";
|
|
||||||
case legacy::SlotFinger2:
|
|
||||||
return "Finger2";
|
|
||||||
case legacy::SlotChest:
|
|
||||||
return "Chest";
|
|
||||||
case legacy::SlotLegs:
|
|
||||||
return "Legs";
|
|
||||||
case legacy::SlotFeet:
|
|
||||||
return "Feet";
|
|
||||||
case legacy::SlotWaist:
|
|
||||||
return "Waist";
|
|
||||||
case legacy::SlotPowerSource:
|
|
||||||
return "PowerSource";
|
|
||||||
case legacy::SlotAmmo:
|
|
||||||
return "Ammo";
|
|
||||||
case legacy::SlotGeneral1:
|
|
||||||
return "General1";
|
|
||||||
case legacy::SlotGeneral2:
|
|
||||||
return "General2";
|
|
||||||
case legacy::SlotGeneral3:
|
|
||||||
return "General3";
|
|
||||||
case legacy::SlotGeneral4:
|
|
||||||
return "General4";
|
|
||||||
case legacy::SlotGeneral5:
|
|
||||||
return "General5";
|
|
||||||
case legacy::SlotGeneral6:
|
|
||||||
return "General6";
|
|
||||||
case legacy::SlotGeneral7:
|
|
||||||
return "General7";
|
|
||||||
case legacy::SlotGeneral8:
|
|
||||||
return "General8";
|
|
||||||
/*
|
|
||||||
case legacy::SlotGeneral9:
|
|
||||||
return "General9";
|
|
||||||
case legacy::SlotGeneral10:
|
|
||||||
return "General10";
|
|
||||||
*/
|
|
||||||
case legacy::SlotCursor:
|
|
||||||
return "Cursor";
|
|
||||||
default:
|
|
||||||
return "Unknown Slot";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* EQEmu::constants::InventorySubName(int16 sub_index)
|
|
||||||
{
|
|
||||||
if (sub_index == INVALID_INDEX)
|
|
||||||
return "Invalid Sub";
|
|
||||||
|
|
||||||
if ((uint16)sub_index >= legacy::ITEM_CONTAINER_SIZE)
|
|
||||||
return "Unknown Sub";
|
|
||||||
|
|
||||||
static std::string ret_str;
|
|
||||||
ret_str = StringFormat("Container%i", (sub_index + 1)); // zero-based index..but, count starts at one
|
|
||||||
|
|
||||||
return ret_str.c_str();
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* EQEmu::constants::InventoryAugName(int16 aug_index)
|
|
||||||
{
|
|
||||||
if (aug_index == INVALID_INDEX)
|
|
||||||
return "Invalid Aug";
|
|
||||||
|
|
||||||
if ((uint16)aug_index >= legacy::ITEM_COMMON_SIZE)
|
|
||||||
return "Unknown Aug";
|
|
||||||
|
|
||||||
static std::string ret_str;
|
|
||||||
ret_str = StringFormat("Augment%i", (aug_index + 1)); // zero-based index..but, count starts at one
|
|
||||||
|
|
||||||
return ret_str.c_str();
|
|
||||||
}
|
|
||||||
|
|||||||
@ -21,41 +21,32 @@
|
|||||||
#define COMMON_EMU_CONSTANTS_H
|
#define COMMON_EMU_CONSTANTS_H
|
||||||
|
|
||||||
#include "eq_limits.h"
|
#include "eq_limits.h"
|
||||||
// (future use)
|
|
||||||
//using namespace RoF2::maps; // server inventory maps enumeration (code and database sync'd to reference)
|
|
||||||
//using namespace RoF::slots; // server possessions slots enumeration (code and database sync'd to reference)
|
|
||||||
|
|
||||||
#include "emu_legacy.h"
|
#include "emu_legacy.h"
|
||||||
#include "inventory_version.h"
|
#include "inventory_version.h"
|
||||||
#include "light_source.h"
|
//#include "deity.h"
|
||||||
#include "deity.h"
|
//#include "say_link.h"
|
||||||
#include "say_link.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
// *** DO NOT CHANGE without a full understanding of the consequences..the server is set up to use these settings explicitly!! ***
|
|
||||||
// *** You will cause compilation failures and corrupt your database if partial or incorrect attempts to change them are made!! ***
|
|
||||||
|
|
||||||
// Hard-coded values usually indicate that further research is needed and the values given are from the old (known) system
|
|
||||||
|
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQEmu
|
||||||
{
|
{
|
||||||
// an immutable value is required to initialize arrays, etc... use this class as a repository for those
|
namespace inventory {
|
||||||
|
//using namespace RoF2::invtype;
|
||||||
|
//using namespace RoF2::invslot;
|
||||||
|
//using namespace RoF2::invbag;
|
||||||
|
//using namespace RoF2::invaug;
|
||||||
|
|
||||||
|
} /*inventory*/
|
||||||
|
|
||||||
namespace constants {
|
namespace constants {
|
||||||
// database
|
const EQEmu::versions::ClientVersion CharacterCreationClient = EQEmu::versions::ClientVersion::RoF2;
|
||||||
static const EQEmu::versions::ClientVersion CharacterCreationClient = EQEmu::versions::ClientVersion::RoF2;
|
const size_t CharacterCreationMax = RoF2::constants::CharacterCreationLimit;
|
||||||
static const size_t CharacterCreationLimit = RoF2::consts::CHARACTER_CREATION_LIMIT;
|
|
||||||
|
|
||||||
// inventory
|
const size_t SayLinkBodySize = RoF2::constants::SayLinkBodySize;
|
||||||
extern uint16 InventoryTypeSize(int16 type_index);
|
|
||||||
//extern const char* InventoryLocationName(Location_Struct location);
|
|
||||||
extern const char* InventoryTypeName(int16 type_index);
|
|
||||||
extern const char* InventorySlotName(int16 slot_index);
|
|
||||||
extern const char* InventorySubName(int16 sub_index);
|
|
||||||
extern const char* InventoryAugName(int16 aug_index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* COMMON_EMU_CONSTANTS_H */
|
} /*constants*/
|
||||||
|
|
||||||
|
} /*EQEmu*/
|
||||||
|
|
||||||
|
#endif /*COMMON_EMU_CONSTANTS_H*/
|
||||||
|
|||||||
18
common/emu_limits.cpp
Normal file
18
common/emu_limits.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/* EQEMu: Everquest Server Emulator
|
||||||
|
|
||||||
|
Copyright (C) 2001-2016 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
|
||||||
|
*/
|
||||||
56
common/emu_limits.h
Normal file
56
common/emu_limits.h
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
/* EQEMu: Everquest Server Emulator
|
||||||
|
|
||||||
|
Copyright (C) 2001-2016 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 COMMON_EMU_LIMITS_H
|
||||||
|
#define COMMON_EMU_LIMITS_H
|
||||||
|
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
|
namespace EntityLimits
|
||||||
|
{
|
||||||
|
namespace npc {
|
||||||
|
enum : int { Invalid = -1, Null, Safety };
|
||||||
|
|
||||||
|
enum : bool { False = false, True = true };
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace merc {
|
||||||
|
enum : int { Invalid = -1, Null, Safety };
|
||||||
|
|
||||||
|
enum : bool { False = false, True = true };
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace bot {
|
||||||
|
enum : int { Invalid = -1, Null, Safety };
|
||||||
|
|
||||||
|
enum : bool { False = false, True = true };
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace pet {
|
||||||
|
enum : int { Invalid = -1, Null, Safety };
|
||||||
|
|
||||||
|
enum : bool { False = false, True = true };
|
||||||
|
}
|
||||||
|
|
||||||
|
}; /*EntityLimits*/
|
||||||
|
|
||||||
|
#endif /*COMMON_EMU_LIMITS_H*/
|
||||||
@ -399,7 +399,7 @@ static const uint8 DamageTypeUnknown = 0xFF;
|
|||||||
**
|
**
|
||||||
** (indexed by 'Skill' of SkillUseTypes)
|
** (indexed by 'Skill' of SkillUseTypes)
|
||||||
*/
|
*/
|
||||||
static const uint8 SkillDamageTypes[HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
|
static const uint8 SkillDamageTypes[EQEmu::skills::HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
|
||||||
{
|
{
|
||||||
/*1HBlunt*/ 0,
|
/*1HBlunt*/ 0,
|
||||||
/*1HSlashing*/ 1,
|
/*1HSlashing*/ 1,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "eq_constants.h"
|
#include "eq_constants.h"
|
||||||
#include "inventory_version.h" // inv2 watch
|
#include "inventory_version.h"
|
||||||
#include "../common/patches/titanium_limits.h"
|
#include "../common/patches/titanium_limits.h"
|
||||||
#include "../common/patches/sof_limits.h"
|
#include "../common/patches/sof_limits.h"
|
||||||
#include "../common/patches/sod_limits.h"
|
#include "../common/patches/sod_limits.h"
|
||||||
@ -31,35 +31,50 @@
|
|||||||
#include "../common/patches/rof2_limits.h"
|
#include "../common/patches/rof2_limits.h"
|
||||||
|
|
||||||
|
|
||||||
// *** DO NOT CHANGE without a full understanding of the consequences..the server is set up to use these settings explicitly!! ***
|
|
||||||
// *** You will cause compilation failures and corrupt your database if partial or incorrect attempts to change them are made!! ***
|
|
||||||
|
|
||||||
// Hard-coded values usually indicate that further research is needed and the values given are from the old (known) system
|
|
||||||
|
|
||||||
|
|
||||||
namespace EQEmu
|
namespace EQEmu
|
||||||
{
|
{
|
||||||
namespace limits {
|
namespace constants {
|
||||||
// database
|
|
||||||
extern size_t CharacterCreationLimit(versions::ClientVersion client_version);
|
extern size_t CharacterCreationLimit(versions::ClientVersion client_version);
|
||||||
|
|
||||||
// inventory
|
} /*constants*/
|
||||||
|
|
||||||
|
namespace inventory {
|
||||||
extern uint16 InventoryTypeSize(versions::InventoryVersion inventory_version, int16 inv_type);
|
extern uint16 InventoryTypeSize(versions::InventoryVersion inventory_version, int16 inv_type);
|
||||||
extern uint64 PossessionsBitmask(versions::InventoryVersion inventory_version);
|
extern uint64 PossessionsBitmask(versions::InventoryVersion inventory_version);
|
||||||
extern uint64 EquipmentBitmask(versions::InventoryVersion inventory_version);
|
|
||||||
extern uint64 GeneralBitmask(versions::InventoryVersion inventory_version);
|
|
||||||
extern uint64 CursorBitmask(versions::InventoryVersion inventory_version);
|
|
||||||
|
|
||||||
extern bool AllowEmptyBagInBag(versions::InventoryVersion inventory_version);
|
extern bool AllowEmptyBagInBag(versions::InventoryVersion inventory_version);
|
||||||
extern bool AllowClickCastFromBag(versions::InventoryVersion inventory_version);
|
extern bool AllowClickCastFromBag(versions::InventoryVersion inventory_version);
|
||||||
|
|
||||||
// items
|
extern uint16 ItemAugSize(versions::InventoryVersion inventory_version);
|
||||||
extern uint16 ItemCommonSize(versions::InventoryVersion inventory_version);
|
extern uint16 ItemBagSize(versions::InventoryVersion inventory_version);
|
||||||
extern uint16 ItemContainerSize(versions::InventoryVersion inventory_version);
|
|
||||||
|
|
||||||
// player profile
|
extern bool ConcatenateInvTypeLimbo(versions::InventoryVersion inventory_version);
|
||||||
|
|
||||||
|
extern bool AllowOverLevelEquipment(versions::InventoryVersion inventory_version);
|
||||||
|
|
||||||
|
} /*inventory*/
|
||||||
|
|
||||||
|
namespace profile {
|
||||||
extern bool CoinHasWeight(versions::InventoryVersion inventory_version);
|
extern bool CoinHasWeight(versions::InventoryVersion inventory_version);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* COMMON_EQ_LIMITS_H */
|
} /*profile*/
|
||||||
|
|
||||||
|
} /*EQEmu*/
|
||||||
|
|
||||||
|
namespace ClientUnknown
|
||||||
|
{
|
||||||
|
enum : int { Invalid = -1, Null, Safety };
|
||||||
|
|
||||||
|
enum : bool { False = false, True = true };
|
||||||
|
|
||||||
|
} /*ClientUnknown*/
|
||||||
|
|
||||||
|
namespace Client62
|
||||||
|
{
|
||||||
|
enum : int { Invalid = -1, Null, Safety };
|
||||||
|
|
||||||
|
enum : bool { False = false, True = true };
|
||||||
|
|
||||||
|
} /*Client62*/
|
||||||
|
|
||||||
|
#endif /*COMMON_EQ_LIMITS_H*/
|
||||||
|
|||||||
@ -1517,17 +1517,38 @@ struct ExpUpdate_Struct
|
|||||||
enum ItemPacketType
|
enum ItemPacketType
|
||||||
{
|
{
|
||||||
ItemPacketViewLink = 0x00,
|
ItemPacketViewLink = 0x00,
|
||||||
|
ItemPacketMerchant = 0x64,
|
||||||
ItemPacketTradeView = 0x65,
|
ItemPacketTradeView = 0x65,
|
||||||
ItemPacketLoot = 0x66,
|
ItemPacketLoot = 0x66,
|
||||||
ItemPacketTrade = 0x67,
|
ItemPacketTrade = 0x67,
|
||||||
ItemPacketCharInventory = 0x69,
|
ItemPacketCharInventory = 0x69,
|
||||||
ItemPacketSummonItem = 0x6A,
|
ItemPacketSummonItem = 0x6A,
|
||||||
ItemPacketTributeItem = 0x6C,
|
|
||||||
ItemPacketMerchant = 0x64,
|
|
||||||
ItemPacketWorldContainer = 0x6B,
|
ItemPacketWorldContainer = 0x6B,
|
||||||
ItemPacketCharmUpdate = 0x6E,
|
ItemPacketTributeItem = 0x6C,
|
||||||
|
ItemPacketGuildTribute = 0x6D,
|
||||||
|
ItemPacketCharmUpdate = 0x6E, // noted as incorrect
|
||||||
ItemPacketInvalid = 0xFF
|
ItemPacketInvalid = 0xFF
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//enum ItemPacketType
|
||||||
|
//{
|
||||||
|
// ItemPacketMerchant = /*100*/ 0x64, // Titanium+
|
||||||
|
// ItemPacketTradeView = /*101*/ 0x65,
|
||||||
|
// ItemPacketLoot = /*102*/ 0x66,
|
||||||
|
// ItemPacketTrade = /*103*/ 0x67,
|
||||||
|
// ItemPacketCharInventory = /*105*/ 0x69,
|
||||||
|
// ItemPacketLimbo = /*106*/ 0x6A, // name change
|
||||||
|
// ItemPacketWorldContainer = /*107*/ 0x6B,
|
||||||
|
// ItemPacketTributeItem = /*108*/ 0x6C,
|
||||||
|
// ItemPacketGuildTribute = /*109*/ 0x6D, // missing from EQEmu
|
||||||
|
// ItemPacket10 = /*110*/ 0x6E,
|
||||||
|
// ItemPacket11 = /*111*/ 0x6F, // UF+ (equipment slots only) (RoF+ checks '(WORD*)slot + 4 != -1' [(WORD*)]slot + 2 would be bag index - if used) (guess)
|
||||||
|
// ItemPacket12 = /*112*/ 0x70, // RoF+ (causes stat update) (could be TrophyTribute and GuildTrophyTribute together - two case methodology - is it checking for GuildID?)
|
||||||
|
// ItemPacketRecovery = /*113*/ 0x71, (same handler as merchant..exception: parameter is '1' versus merchant '0' looks like tab id)
|
||||||
|
// ItemPacket14 = /*115*/ 0x73, (real estate/moving crate?)
|
||||||
|
// ItemPacket__ = /*xxx*/ 0xXX // switch 'default' - all clients
|
||||||
|
//};
|
||||||
|
|
||||||
struct ItemPacket_Struct
|
struct ItemPacket_Struct
|
||||||
{
|
{
|
||||||
/*00*/ ItemPacketType PacketType;
|
/*00*/ ItemPacketType PacketType;
|
||||||
|
|||||||
@ -24,6 +24,8 @@
|
|||||||
#include "shareddb.h"
|
#include "shareddb.h"
|
||||||
#include "string_util.h"
|
#include "string_util.h"
|
||||||
|
|
||||||
|
#include "../common/light_source.h"
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -927,7 +929,7 @@ bool Inventory::SupportsClickCasting(int16 slot_id)
|
|||||||
}
|
}
|
||||||
else if (slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::legacy::GENERAL_BAGS_END)
|
else if (slot_id >= EQEmu::legacy::GENERAL_BAGS_BEGIN && slot_id <= EQEmu::legacy::GENERAL_BAGS_END)
|
||||||
{
|
{
|
||||||
if (EQEmu::limits::AllowClickCastFromBag(m_inventory_version))
|
if (EQEmu::inventory::AllowClickCastFromBag(m_inventory_version))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,6 +32,7 @@ class EvolveInfo; // Stores information about an evolving item family
|
|||||||
#include "../common/item_struct.h"
|
#include "../common/item_struct.h"
|
||||||
#include "../common/timer.h"
|
#include "../common/timer.h"
|
||||||
#include "../common/bodytypes.h"
|
#include "../common/bodytypes.h"
|
||||||
|
#include "../common/deity.h" // aren't we already in '/common'?
|
||||||
|
|
||||||
#include "string_util.h"
|
#include "string_util.h"
|
||||||
|
|
||||||
@ -77,6 +78,7 @@ enum {
|
|||||||
invWhereCursor = 0x20
|
invWhereCursor = 0x20
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ItemInst;
|
||||||
|
|
||||||
// ########################################
|
// ########################################
|
||||||
// Class: Queue
|
// Class: Queue
|
||||||
|
|||||||
@ -2346,12 +2346,12 @@ namespace RoF
|
|||||||
outapp->WriteUInt8(0); // Unknown
|
outapp->WriteUInt8(0); // Unknown
|
||||||
outapp->WriteUInt8(0); // Unknown
|
outapp->WriteUInt8(0); // Unknown
|
||||||
|
|
||||||
outapp->WriteUInt32(consts::BANDOLIERS_SIZE);
|
outapp->WriteUInt32(profile::BandoliersSize);
|
||||||
|
|
||||||
// Copy bandoliers where server and client indexes converge
|
// Copy bandoliers where server and client indexes converge
|
||||||
for (uint32 r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
for (uint32 r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++r) {
|
||||||
outapp->WriteString(emu->bandoliers[r].Name);
|
outapp->WriteString(emu->bandoliers[r].Name);
|
||||||
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 j = 0; j < profile::BandolierItemCount; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||||
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
|
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
|
||||||
outapp->WriteUInt32(emu->bandoliers[r].Items[j].ID);
|
outapp->WriteUInt32(emu->bandoliers[r].Items[j].ID);
|
||||||
if (emu->bandoliers[r].Items[j].Icon) {
|
if (emu->bandoliers[r].Items[j].Icon) {
|
||||||
@ -2364,19 +2364,19 @@ namespace RoF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||||
for (uint32 r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
for (uint32 r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++r) {
|
||||||
outapp->WriteString("");
|
outapp->WriteString("");
|
||||||
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 j = 0; j < profile::BandolierItemCount; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||||
outapp->WriteString("");
|
outapp->WriteString("");
|
||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
outapp->WriteSInt32(-1);
|
outapp->WriteSInt32(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
outapp->WriteUInt32(consts::POTION_BELT_ITEM_COUNT);
|
outapp->WriteUInt32(profile::PotionBeltSize);
|
||||||
|
|
||||||
// Copy potion belt where server and client indexes converge
|
// Copy potion belt where server and client indexes converge
|
||||||
for (uint32 r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
for (uint32 r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
|
||||||
outapp->WriteString(emu->potionbelt.Items[r].Name);
|
outapp->WriteString(emu->potionbelt.Items[r].Name);
|
||||||
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
|
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
|
||||||
if (emu->potionbelt.Items[r].Icon) {
|
if (emu->potionbelt.Items[r].Icon) {
|
||||||
@ -2388,7 +2388,7 @@ namespace RoF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||||
for (uint32 r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
for (uint32 r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
|
||||||
outapp->WriteString("");
|
outapp->WriteString("");
|
||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
outapp->WriteSInt32(-1);
|
outapp->WriteSInt32(-1);
|
||||||
@ -3002,7 +3002,7 @@ namespace RoF
|
|||||||
|
|
||||||
size_t names_length = 0;
|
size_t names_length = 0;
|
||||||
size_t character_count = 0;
|
size_t character_count = 0;
|
||||||
for (; character_count < emu->CharCount && character_count < consts::CHARACTER_CREATION_LIMIT; ++character_count) {
|
for (; character_count < emu->CharCount && character_count < constants::SayLinkBodySize; ++character_count) {
|
||||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||||
names_length += strlen(emu_cse->Name);
|
names_length += strlen(emu_cse->Name);
|
||||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||||
@ -5214,7 +5214,7 @@ namespace RoF
|
|||||||
|
|
||||||
structs::InventorySlot_Struct slot_id = ServerToRoFSlot(slot_id_in);
|
structs::InventorySlot_Struct slot_id = ServerToRoFSlot(slot_id_in);
|
||||||
|
|
||||||
hdr.slot_type = (inst->GetMerchantSlot() ? inventory::TypeMerchant : slot_id.Type);
|
hdr.slot_type = (inst->GetMerchantSlot() ? invtype::InvTypeMerchant : slot_id.Type);
|
||||||
hdr.main_slot = (inst->GetMerchantSlot() ? inst->GetMerchantSlot() : slot_id.Slot);
|
hdr.main_slot = (inst->GetMerchantSlot() ? inst->GetMerchantSlot() : slot_id.Slot);
|
||||||
hdr.sub_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.SubIndex);
|
hdr.sub_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.SubIndex);
|
||||||
hdr.aug_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.AugIndex);
|
hdr.aug_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.AugIndex);
|
||||||
@ -5402,7 +5402,7 @@ namespace RoF
|
|||||||
isbs.augdistiller = 65535;
|
isbs.augdistiller = 65535;
|
||||||
isbs.augrestrict = item->AugRestrict;
|
isbs.augrestrict = item->AugRestrict;
|
||||||
|
|
||||||
for (int index = 0; index < consts::ITEM_COMMON_SIZE; ++index) {
|
for (int index = 0; index < invaug::ItemAugSize; ++index) {
|
||||||
isbs.augslots[index].type = item->AugSlotType[index];
|
isbs.augslots[index].type = item->AugSlotType[index];
|
||||||
isbs.augslots[index].visible = item->AugSlotVisible[index];
|
isbs.augslots[index].visible = item->AugSlotVisible[index];
|
||||||
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
|
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
|
||||||
@ -5650,11 +5650,11 @@ namespace RoF
|
|||||||
uint32 TempSlot = 0;
|
uint32 TempSlot = 0;
|
||||||
|
|
||||||
if (serverSlot < 56 || serverSlot == EQEmu::legacy::SlotPowerSource) { // Main Inventory and Cursor
|
if (serverSlot < 56 || serverSlot == EQEmu::legacy::SlotPowerSource) { // Main Inventory and Cursor
|
||||||
RoFSlot.Type = inventory::TypePossessions;
|
RoFSlot.Type = invtype::InvTypePossessions;
|
||||||
RoFSlot.Slot = serverSlot;
|
RoFSlot.Slot = serverSlot;
|
||||||
|
|
||||||
if (serverSlot == EQEmu::legacy::SlotPowerSource)
|
if (serverSlot == EQEmu::legacy::SlotPowerSource)
|
||||||
RoFSlot.Slot = inventory::SlotPowerSource;
|
RoFSlot.Slot = invslot::PossessionsPowerSource;
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::SlotCursor) // Cursor and Extended Corpse Inventory
|
else if (serverSlot >= EQEmu::legacy::SlotCursor) // Cursor and Extended Corpse Inventory
|
||||||
RoFSlot.Slot += 3;
|
RoFSlot.Slot += 3;
|
||||||
@ -5669,22 +5669,22 @@ namespace RoF
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) { // (> 250 && < 341)
|
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) { // (> 250 && < 341)
|
||||||
RoFSlot.Type = inventory::TypePossessions;
|
RoFSlot.Type = invtype::InvTypePossessions;
|
||||||
TempSlot = serverSlot - 1;
|
TempSlot = serverSlot - 1;
|
||||||
RoFSlot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 2;
|
RoFSlot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 2;
|
||||||
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
|
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
|
||||||
|
|
||||||
if (RoFSlot.Slot >= inventory::SlotGeneral9) // (> 30)
|
if (RoFSlot.Slot >= invslot::PossessionsGeneral9) // (> 30)
|
||||||
RoFSlot.Slot = inventory::SlotCursor;
|
RoFSlot.Slot = invslot::PossessionsCursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::TRIBUTE_BEGIN && serverSlot <= EQEmu::legacy::TRIBUTE_END) { // Tribute
|
else if (serverSlot >= EQEmu::legacy::TRIBUTE_BEGIN && serverSlot <= EQEmu::legacy::TRIBUTE_END) { // Tribute
|
||||||
RoFSlot.Type = inventory::TypeTribute;
|
RoFSlot.Type = invtype::InvTypeTribute;
|
||||||
RoFSlot.Slot = serverSlot - EQEmu::legacy::TRIBUTE_BEGIN;
|
RoFSlot.Slot = serverSlot - EQEmu::legacy::TRIBUTE_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::BANK_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END) {
|
else if (serverSlot >= EQEmu::legacy::BANK_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END) {
|
||||||
RoFSlot.Type = inventory::TypeBank;
|
RoFSlot.Type = invtype::InvTypeBank;
|
||||||
TempSlot = serverSlot - EQEmu::legacy::BANK_BEGIN;
|
TempSlot = serverSlot - EQEmu::legacy::BANK_BEGIN;
|
||||||
RoFSlot.Slot = TempSlot;
|
RoFSlot.Slot = TempSlot;
|
||||||
|
|
||||||
@ -5695,7 +5695,7 @@ namespace RoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END) {
|
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END) {
|
||||||
RoFSlot.Type = inventory::TypeSharedBank;
|
RoFSlot.Type = invtype::InvTypeSharedBank;
|
||||||
TempSlot = serverSlot - EQEmu::legacy::SHARED_BANK_BEGIN;
|
TempSlot = serverSlot - EQEmu::legacy::SHARED_BANK_BEGIN;
|
||||||
RoFSlot.Slot = TempSlot;
|
RoFSlot.Slot = TempSlot;
|
||||||
|
|
||||||
@ -5706,7 +5706,7 @@ namespace RoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::TRADE_BEGIN && serverSlot <= EQEmu::legacy::TRADE_BAGS_END) {
|
else if (serverSlot >= EQEmu::legacy::TRADE_BEGIN && serverSlot <= EQEmu::legacy::TRADE_BAGS_END) {
|
||||||
RoFSlot.Type = inventory::TypeTrade;
|
RoFSlot.Type = invtype::InvTypeTrade;
|
||||||
TempSlot = serverSlot - EQEmu::legacy::TRADE_BEGIN;
|
TempSlot = serverSlot - EQEmu::legacy::TRADE_BEGIN;
|
||||||
RoFSlot.Slot = TempSlot;
|
RoFSlot.Slot = TempSlot;
|
||||||
|
|
||||||
@ -5730,7 +5730,7 @@ namespace RoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::WORLD_BEGIN && serverSlot <= EQEmu::legacy::WORLD_END) {
|
else if (serverSlot >= EQEmu::legacy::WORLD_BEGIN && serverSlot <= EQEmu::legacy::WORLD_END) {
|
||||||
RoFSlot.Type = inventory::TypeWorld;
|
RoFSlot.Type = invtype::InvTypeWorld;
|
||||||
TempSlot = serverSlot - EQEmu::legacy::WORLD_BEGIN;
|
TempSlot = serverSlot - EQEmu::legacy::WORLD_BEGIN;
|
||||||
RoFSlot.Slot = TempSlot;
|
RoFSlot.Slot = TempSlot;
|
||||||
}
|
}
|
||||||
@ -5754,7 +5754,7 @@ namespace RoF
|
|||||||
RoFSlot.Slot = serverSlot;
|
RoFSlot.Slot = serverSlot;
|
||||||
|
|
||||||
if (serverSlot == EQEmu::legacy::SlotPowerSource)
|
if (serverSlot == EQEmu::legacy::SlotPowerSource)
|
||||||
RoFSlot.Slot = inventory::SlotPowerSource;
|
RoFSlot.Slot = invslot::PossessionsPowerSource;
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::SlotCursor) // Cursor and Extended Corpse Inventory
|
else if (serverSlot >= EQEmu::legacy::SlotCursor) // Cursor and Extended Corpse Inventory
|
||||||
RoFSlot.Slot += 3;
|
RoFSlot.Slot += 3;
|
||||||
@ -5791,11 +5791,11 @@ namespace RoF
|
|||||||
uint32 ServerSlot = INVALID_INDEX;
|
uint32 ServerSlot = INVALID_INDEX;
|
||||||
uint32 TempSlot = 0;
|
uint32 TempSlot = 0;
|
||||||
|
|
||||||
if (rofSlot.Type == inventory::TypePossessions && rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
|
if (rofSlot.Type == invtype::InvTypePossessions && rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
|
||||||
if (rofSlot.Slot == inventory::SlotPowerSource)
|
if (rofSlot.Slot == invslot::PossessionsPowerSource)
|
||||||
TempSlot = EQEmu::legacy::SlotPowerSource;
|
TempSlot = EQEmu::legacy::SlotPowerSource;
|
||||||
|
|
||||||
else if (rofSlot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory
|
else if (rofSlot.Slot >= invslot::PossessionsCursor) // Cursor and Extended Corpse Inventory
|
||||||
TempSlot = rofSlot.Slot - 3;
|
TempSlot = rofSlot.Slot - 3;
|
||||||
|
|
||||||
/*else if (RoFSlot.MainSlot == slots::MainGeneral9 || RoFSlot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF inventory/corpse slots
|
/*else if (RoFSlot.MainSlot == slots::MainGeneral9 || RoFSlot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF inventory/corpse slots
|
||||||
@ -5809,7 +5809,7 @@ namespace RoF
|
|||||||
// For now, it's probably best to leave as-is and let this work itself out in the inventory rework.
|
// For now, it's probably best to leave as-is and let this work itself out in the inventory rework.
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
else if (rofSlot.Slot >= inventory::SlotAmmo) // Ammo and Main Inventory
|
else if (rofSlot.Slot >= invslot::PossessionsAmmo) // Ammo and Main Inventory
|
||||||
TempSlot = rofSlot.Slot - 1;
|
TempSlot = rofSlot.Slot - 1;
|
||||||
|
|
||||||
else // Worn Slots
|
else // Worn Slots
|
||||||
@ -5821,7 +5821,7 @@ namespace RoF
|
|||||||
ServerSlot = TempSlot;
|
ServerSlot = TempSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rofSlot.Type == inventory::TypeBank) {
|
else if (rofSlot.Type == invtype::InvTypeBank) {
|
||||||
TempSlot = EQEmu::legacy::BANK_BEGIN;
|
TempSlot = EQEmu::legacy::BANK_BEGIN;
|
||||||
|
|
||||||
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
|
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
|
||||||
@ -5833,7 +5833,7 @@ namespace RoF
|
|||||||
ServerSlot = TempSlot;
|
ServerSlot = TempSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rofSlot.Type == inventory::TypeSharedBank) {
|
else if (rofSlot.Type == invtype::InvTypeSharedBank) {
|
||||||
TempSlot = EQEmu::legacy::SHARED_BANK_BEGIN;
|
TempSlot = EQEmu::legacy::SHARED_BANK_BEGIN;
|
||||||
|
|
||||||
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
|
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
|
||||||
@ -5845,7 +5845,7 @@ namespace RoF
|
|||||||
ServerSlot = TempSlot;
|
ServerSlot = TempSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rofSlot.Type == inventory::TypeTrade) {
|
else if (rofSlot.Type == invtype::InvTypeTrade) {
|
||||||
TempSlot = EQEmu::legacy::TRADE_BEGIN;
|
TempSlot = EQEmu::legacy::TRADE_BEGIN;
|
||||||
|
|
||||||
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
|
if (rofSlot.SubIndex >= SUB_INDEX_BEGIN)
|
||||||
@ -5859,7 +5859,7 @@ namespace RoF
|
|||||||
ServerSlot = TempSlot;
|
ServerSlot = TempSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rofSlot.Type == inventory::TypeWorld) {
|
else if (rofSlot.Type == invtype::InvTypeWorld) {
|
||||||
TempSlot = EQEmu::legacy::WORLD_BEGIN;
|
TempSlot = EQEmu::legacy::WORLD_BEGIN;
|
||||||
|
|
||||||
if (rofSlot.Slot >= SUB_INDEX_BEGIN)
|
if (rofSlot.Slot >= SUB_INDEX_BEGIN)
|
||||||
@ -5877,7 +5877,7 @@ namespace RoF
|
|||||||
ServerSlot = TempSlot;
|
ServerSlot = TempSlot;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
else if (rofSlot.Type == inventory::TypeGuildTribute) {
|
else if (rofSlot.Type == invtype::InvTypeGuildTribute) {
|
||||||
ServerSlot = INVALID_INDEX;
|
ServerSlot = INVALID_INDEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5892,10 +5892,10 @@ namespace RoF
|
|||||||
uint32 TempSlot = 0;
|
uint32 TempSlot = 0;
|
||||||
|
|
||||||
if (rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33)
|
if (rofSlot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33)
|
||||||
if (rofSlot.Slot == inventory::SlotPowerSource)
|
if (rofSlot.Slot == invslot::PossessionsPowerSource)
|
||||||
TempSlot = EQEmu::legacy::SlotPowerSource;
|
TempSlot = EQEmu::legacy::SlotPowerSource;
|
||||||
|
|
||||||
else if (rofSlot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory
|
else if (rofSlot.Slot >= invslot::PossessionsCursor) // Cursor and Extended Corpse Inventory
|
||||||
TempSlot = rofSlot.Slot - 3;
|
TempSlot = rofSlot.Slot - 3;
|
||||||
|
|
||||||
/*else if (RoFSlot.MainSlot == slots::MainGeneral9 || RoFSlot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF inventory slots
|
/*else if (RoFSlot.MainSlot == slots::MainGeneral9 || RoFSlot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF inventory slots
|
||||||
@ -5904,7 +5904,7 @@ namespace RoF
|
|||||||
// Same as above
|
// Same as above
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
else if (rofSlot.Slot >= inventory::SlotAmmo) // Main Inventory and Ammo Slots
|
else if (rofSlot.Slot >= invslot::PossessionsAmmo) // Main Inventory and Ammo Slots
|
||||||
TempSlot = rofSlot.Slot - 1;
|
TempSlot = rofSlot.Slot - 1;
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -5928,7 +5928,7 @@ namespace RoF
|
|||||||
|
|
||||||
static inline void ServerToRoFTextLink(std::string& rofTextLink, const std::string& serverTextLink)
|
static inline void ServerToRoFTextLink(std::string& rofTextLink, const std::string& serverTextLink)
|
||||||
{
|
{
|
||||||
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||||
rofTextLink = serverTextLink;
|
rofTextLink = serverTextLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -5967,7 +5967,7 @@ namespace RoF
|
|||||||
|
|
||||||
static inline void RoFToServerTextLink(std::string& serverTextLink, const std::string& rofTextLink)
|
static inline void RoFToServerTextLink(std::string& serverTextLink, const std::string& rofTextLink)
|
||||||
{
|
{
|
||||||
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rofTextLink.find('\x12') == std::string::npos)) {
|
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (rofTextLink.find('\x12') == std::string::npos)) {
|
||||||
serverTextLink = rofTextLink;
|
serverTextLink = rofTextLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -5976,7 +5976,7 @@ namespace RoF
|
|||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
if (segments[segment_iter].length() <= consts::TEXT_LINK_BODY_LENGTH) {
|
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
|
||||||
serverTextLink.append(segments[segment_iter]);
|
serverTextLink.append(segments[segment_iter]);
|
||||||
// TODO: log size mismatch error
|
// TODO: log size mismatch error
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -2429,12 +2429,12 @@ namespace RoF2
|
|||||||
outapp->WriteUInt8(0); // Unknown
|
outapp->WriteUInt8(0); // Unknown
|
||||||
outapp->WriteUInt8(0); // Unknown
|
outapp->WriteUInt8(0); // Unknown
|
||||||
|
|
||||||
outapp->WriteUInt32(consts::BANDOLIERS_SIZE);
|
outapp->WriteUInt32(profile::BandoliersSize);
|
||||||
|
|
||||||
// Copy bandoliers where server and client indexes converge
|
// Copy bandoliers where server and client indexes converge
|
||||||
for (uint32 r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
for (uint32 r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++r) {
|
||||||
outapp->WriteString(emu->bandoliers[r].Name);
|
outapp->WriteString(emu->bandoliers[r].Name);
|
||||||
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 j = 0; j < profile::BandolierItemCount; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||||
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
|
outapp->WriteString(emu->bandoliers[r].Items[j].Name);
|
||||||
outapp->WriteUInt32(emu->bandoliers[r].Items[j].ID);
|
outapp->WriteUInt32(emu->bandoliers[r].Items[j].ID);
|
||||||
if (emu->bandoliers[r].Items[j].Icon) {
|
if (emu->bandoliers[r].Items[j].Icon) {
|
||||||
@ -2447,19 +2447,19 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||||
for (uint32 r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
for (uint32 r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++r) {
|
||||||
outapp->WriteString("");
|
outapp->WriteString("");
|
||||||
for (uint32 j = 0; j < consts::BANDOLIER_ITEM_COUNT; ++j) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 j = 0; j < profile::BandolierItemCount; ++j) { // Will need adjusting if 'server != client' is ever true
|
||||||
outapp->WriteString("");
|
outapp->WriteString("");
|
||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
outapp->WriteSInt32(-1);
|
outapp->WriteSInt32(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
outapp->WriteUInt32(consts::POTION_BELT_ITEM_COUNT);
|
outapp->WriteUInt32(profile::PotionBeltSize);
|
||||||
|
|
||||||
// Copy potion belt where server and client indexes converge
|
// Copy potion belt where server and client indexes converge
|
||||||
for (uint32 r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
for (uint32 r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
|
||||||
outapp->WriteString(emu->potionbelt.Items[r].Name);
|
outapp->WriteString(emu->potionbelt.Items[r].Name);
|
||||||
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
|
outapp->WriteUInt32(emu->potionbelt.Items[r].ID);
|
||||||
if (emu->potionbelt.Items[r].Icon) {
|
if (emu->potionbelt.Items[r].Icon) {
|
||||||
@ -2471,7 +2471,7 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||||
for (uint32 r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
for (uint32 r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
|
||||||
outapp->WriteString("");
|
outapp->WriteString("");
|
||||||
outapp->WriteUInt32(0);
|
outapp->WriteUInt32(0);
|
||||||
outapp->WriteSInt32(-1);
|
outapp->WriteSInt32(-1);
|
||||||
@ -3095,7 +3095,7 @@ namespace RoF2
|
|||||||
|
|
||||||
size_t names_length = 0;
|
size_t names_length = 0;
|
||||||
size_t character_count = 0;
|
size_t character_count = 0;
|
||||||
for (; character_count < emu->CharCount && character_count < consts::CHARACTER_CREATION_LIMIT; ++character_count) {
|
for (; character_count < emu->CharCount && character_count < constants::CharacterCreationLimit; ++character_count) {
|
||||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||||
names_length += strlen(emu_cse->Name);
|
names_length += strlen(emu_cse->Name);
|
||||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||||
@ -5489,7 +5489,7 @@ namespace RoF2
|
|||||||
|
|
||||||
structs::InventorySlot_Struct slot_id = ServerToRoF2Slot(slot_id_in, packet_type);
|
structs::InventorySlot_Struct slot_id = ServerToRoF2Slot(slot_id_in, packet_type);
|
||||||
|
|
||||||
hdr.slot_type = (inst->GetMerchantSlot() ? inventory::TypeMerchant : slot_id.Type);
|
hdr.slot_type = (inst->GetMerchantSlot() ? invtype::InvTypeMerchant : slot_id.Type);
|
||||||
hdr.main_slot = (inst->GetMerchantSlot() ? inst->GetMerchantSlot() : slot_id.Slot);
|
hdr.main_slot = (inst->GetMerchantSlot() ? inst->GetMerchantSlot() : slot_id.Slot);
|
||||||
hdr.sub_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.SubIndex);
|
hdr.sub_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.SubIndex);
|
||||||
hdr.aug_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.AugIndex);
|
hdr.aug_slot = (inst->GetMerchantSlot() ? 0xffff : slot_id.AugIndex);
|
||||||
@ -5677,7 +5677,7 @@ namespace RoF2
|
|||||||
isbs.augrestrict2 = -1;
|
isbs.augrestrict2 = -1;
|
||||||
isbs.augrestrict = item->AugRestrict;
|
isbs.augrestrict = item->AugRestrict;
|
||||||
|
|
||||||
for (int index = 0; index < consts::ITEM_COMMON_SIZE; ++index) {
|
for (int index = 0; index < invaug::ItemAugSize; ++index) {
|
||||||
isbs.augslots[index].type = item->AugSlotType[index];
|
isbs.augslots[index].type = item->AugSlotType[index];
|
||||||
isbs.augslots[index].visible = item->AugSlotVisible[index];
|
isbs.augslots[index].visible = item->AugSlotVisible[index];
|
||||||
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
|
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
|
||||||
@ -5937,17 +5937,17 @@ namespace RoF2
|
|||||||
if (serverSlot < 56 || serverSlot == EQEmu::legacy::SlotPowerSource) { // Main Inventory and Cursor
|
if (serverSlot < 56 || serverSlot == EQEmu::legacy::SlotPowerSource) { // Main Inventory and Cursor
|
||||||
if (PacketType == ItemPacketLoot)
|
if (PacketType == ItemPacketLoot)
|
||||||
{
|
{
|
||||||
RoF2Slot.Type = inventory::TypeCorpse;
|
RoF2Slot.Type = invtype::InvTypeCorpse;
|
||||||
RoF2Slot.Slot = serverSlot - EQEmu::legacy::CORPSE_BEGIN;
|
RoF2Slot.Slot = serverSlot - EQEmu::legacy::CORPSE_BEGIN;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RoF2Slot.Type = inventory::TypePossessions;
|
RoF2Slot.Type = invtype::InvTypePossessions;
|
||||||
RoF2Slot.Slot = serverSlot;
|
RoF2Slot.Slot = serverSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (serverSlot == EQEmu::legacy::SlotPowerSource)
|
if (serverSlot == EQEmu::legacy::SlotPowerSource)
|
||||||
RoF2Slot.Slot = inventory::SlotPowerSource;
|
RoF2Slot.Slot = invslot::PossessionsPowerSource;
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::SlotCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory
|
else if (serverSlot >= EQEmu::legacy::SlotCursor && PacketType != ItemPacketLoot) // Cursor and Extended Corpse Inventory
|
||||||
RoF2Slot.Slot += 3;
|
RoF2Slot.Slot += 3;
|
||||||
@ -5962,22 +5962,22 @@ namespace RoF2
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) { // (> 250 && < 341)
|
else if (serverSlot >= EQEmu::legacy::GENERAL_BAGS_BEGIN && serverSlot <= EQEmu::legacy::CURSOR_BAG_END) { // (> 250 && < 341)
|
||||||
RoF2Slot.Type = inventory::TypePossessions;
|
RoF2Slot.Type = invtype::InvTypePossessions;
|
||||||
TempSlot = serverSlot - 1;
|
TempSlot = serverSlot - 1;
|
||||||
RoF2Slot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 2;
|
RoF2Slot.Slot = int(TempSlot / EQEmu::legacy::ITEM_CONTAINER_SIZE) - 2;
|
||||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
|
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::legacy::ITEM_CONTAINER_SIZE);
|
||||||
|
|
||||||
if (RoF2Slot.Slot >= inventory::SlotGeneral9) // (> 30)
|
if (RoF2Slot.Slot >= invslot::PossessionsGeneral9) // (> 30)
|
||||||
RoF2Slot.Slot = inventory::SlotCursor;
|
RoF2Slot.Slot = invslot::PossessionsCursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::TRIBUTE_BEGIN && serverSlot <= EQEmu::legacy::TRIBUTE_END) { // Tribute
|
else if (serverSlot >= EQEmu::legacy::TRIBUTE_BEGIN && serverSlot <= EQEmu::legacy::TRIBUTE_END) { // Tribute
|
||||||
RoF2Slot.Type = inventory::TypeTribute;
|
RoF2Slot.Type = invtype::InvTypeTribute;
|
||||||
RoF2Slot.Slot = serverSlot - EQEmu::legacy::TRIBUTE_BEGIN;
|
RoF2Slot.Slot = serverSlot - EQEmu::legacy::TRIBUTE_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::BANK_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END) {
|
else if (serverSlot >= EQEmu::legacy::BANK_BEGIN && serverSlot <= EQEmu::legacy::BANK_BAGS_END) {
|
||||||
RoF2Slot.Type = inventory::TypeBank;
|
RoF2Slot.Type = invtype::InvTypeBank;
|
||||||
TempSlot = serverSlot - EQEmu::legacy::BANK_BEGIN;
|
TempSlot = serverSlot - EQEmu::legacy::BANK_BEGIN;
|
||||||
RoF2Slot.Slot = TempSlot;
|
RoF2Slot.Slot = TempSlot;
|
||||||
|
|
||||||
@ -5988,7 +5988,7 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END) {
|
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END) {
|
||||||
RoF2Slot.Type = inventory::TypeSharedBank;
|
RoF2Slot.Type = invtype::InvTypeSharedBank;
|
||||||
TempSlot = serverSlot - EQEmu::legacy::SHARED_BANK_BEGIN;
|
TempSlot = serverSlot - EQEmu::legacy::SHARED_BANK_BEGIN;
|
||||||
RoF2Slot.Slot = TempSlot;
|
RoF2Slot.Slot = TempSlot;
|
||||||
|
|
||||||
@ -5999,7 +5999,7 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::TRADE_BEGIN && serverSlot <= EQEmu::legacy::TRADE_BAGS_END) {
|
else if (serverSlot >= EQEmu::legacy::TRADE_BEGIN && serverSlot <= EQEmu::legacy::TRADE_BAGS_END) {
|
||||||
RoF2Slot.Type = inventory::TypeTrade;
|
RoF2Slot.Type = invtype::InvTypeTrade;
|
||||||
TempSlot = serverSlot - EQEmu::legacy::TRADE_BEGIN;
|
TempSlot = serverSlot - EQEmu::legacy::TRADE_BEGIN;
|
||||||
RoF2Slot.Slot = TempSlot;
|
RoF2Slot.Slot = TempSlot;
|
||||||
|
|
||||||
@ -6023,7 +6023,7 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::WORLD_BEGIN && serverSlot <= EQEmu::legacy::WORLD_END) {
|
else if (serverSlot >= EQEmu::legacy::WORLD_BEGIN && serverSlot <= EQEmu::legacy::WORLD_END) {
|
||||||
RoF2Slot.Type = inventory::TypeWorld;
|
RoF2Slot.Type = invtype::InvTypeWorld;
|
||||||
TempSlot = serverSlot - EQEmu::legacy::WORLD_BEGIN;
|
TempSlot = serverSlot - EQEmu::legacy::WORLD_BEGIN;
|
||||||
RoF2Slot.Slot = TempSlot;
|
RoF2Slot.Slot = TempSlot;
|
||||||
}
|
}
|
||||||
@ -6047,7 +6047,7 @@ namespace RoF2
|
|||||||
RoF2Slot.Slot = serverSlot;
|
RoF2Slot.Slot = serverSlot;
|
||||||
|
|
||||||
if (serverSlot == EQEmu::legacy::SlotPowerSource)
|
if (serverSlot == EQEmu::legacy::SlotPowerSource)
|
||||||
RoF2Slot.Slot = inventory::SlotPowerSource;
|
RoF2Slot.Slot = invslot::PossessionsPowerSource;
|
||||||
|
|
||||||
else if (serverSlot >= EQEmu::legacy::SlotCursor) // Cursor and Extended Corpse Inventory
|
else if (serverSlot >= EQEmu::legacy::SlotCursor) // Cursor and Extended Corpse Inventory
|
||||||
RoF2Slot.Slot += 3;
|
RoF2Slot.Slot += 3;
|
||||||
@ -6084,11 +6084,11 @@ namespace RoF2
|
|||||||
uint32 ServerSlot = INVALID_INDEX;
|
uint32 ServerSlot = INVALID_INDEX;
|
||||||
uint32 TempSlot = 0;
|
uint32 TempSlot = 0;
|
||||||
|
|
||||||
if (rof2Slot.Type == inventory::TypePossessions && rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
|
if (rof2Slot.Type == invtype::InvTypePossessions && rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 51)
|
||||||
if (rof2Slot.Slot == inventory::SlotPowerSource)
|
if (rof2Slot.Slot == invslot::PossessionsPowerSource)
|
||||||
TempSlot = EQEmu::legacy::SlotPowerSource;
|
TempSlot = EQEmu::legacy::SlotPowerSource;
|
||||||
|
|
||||||
else if (rof2Slot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory
|
else if (rof2Slot.Slot >= invslot::PossessionsCursor) // Cursor and Extended Corpse Inventory
|
||||||
TempSlot = rof2Slot.Slot - 3;
|
TempSlot = rof2Slot.Slot - 3;
|
||||||
|
|
||||||
/*else if (RoF2Slot.MainSlot == slots::MainGeneral9 || RoF2Slot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF2 inventory/corpse slots
|
/*else if (RoF2Slot.MainSlot == slots::MainGeneral9 || RoF2Slot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF2 inventory/corpse slots
|
||||||
@ -6102,7 +6102,7 @@ namespace RoF2
|
|||||||
// For now, it's probably best to leave as-is and let this work itself out in the inventory rework.
|
// For now, it's probably best to leave as-is and let this work itself out in the inventory rework.
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
else if (rof2Slot.Slot >= inventory::SlotAmmo) // Ammo and Main Inventory
|
else if (rof2Slot.Slot >= invslot::PossessionsAmmo) // Ammo and Main Inventory
|
||||||
TempSlot = rof2Slot.Slot - 1;
|
TempSlot = rof2Slot.Slot - 1;
|
||||||
|
|
||||||
else // Worn Slots
|
else // Worn Slots
|
||||||
@ -6114,7 +6114,7 @@ namespace RoF2
|
|||||||
ServerSlot = TempSlot;
|
ServerSlot = TempSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rof2Slot.Type == inventory::TypeBank) {
|
else if (rof2Slot.Type == invtype::InvTypeBank) {
|
||||||
TempSlot = EQEmu::legacy::BANK_BEGIN;
|
TempSlot = EQEmu::legacy::BANK_BEGIN;
|
||||||
|
|
||||||
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
|
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
|
||||||
@ -6126,7 +6126,7 @@ namespace RoF2
|
|||||||
ServerSlot = TempSlot;
|
ServerSlot = TempSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rof2Slot.Type == inventory::TypeSharedBank) {
|
else if (rof2Slot.Type == invtype::InvTypeSharedBank) {
|
||||||
TempSlot = EQEmu::legacy::SHARED_BANK_BEGIN;
|
TempSlot = EQEmu::legacy::SHARED_BANK_BEGIN;
|
||||||
|
|
||||||
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
|
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
|
||||||
@ -6138,7 +6138,7 @@ namespace RoF2
|
|||||||
ServerSlot = TempSlot;
|
ServerSlot = TempSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rof2Slot.Type == inventory::TypeTrade) {
|
else if (rof2Slot.Type == invtype::InvTypeTrade) {
|
||||||
TempSlot = EQEmu::legacy::TRADE_BEGIN;
|
TempSlot = EQEmu::legacy::TRADE_BEGIN;
|
||||||
|
|
||||||
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
|
if (rof2Slot.SubIndex >= SUB_INDEX_BEGIN)
|
||||||
@ -6152,7 +6152,7 @@ namespace RoF2
|
|||||||
ServerSlot = TempSlot;
|
ServerSlot = TempSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rof2Slot.Type == inventory::TypeWorld) {
|
else if (rof2Slot.Type == invtype::InvTypeWorld) {
|
||||||
TempSlot = EQEmu::legacy::WORLD_BEGIN;
|
TempSlot = EQEmu::legacy::WORLD_BEGIN;
|
||||||
|
|
||||||
if (rof2Slot.Slot >= SUB_INDEX_BEGIN)
|
if (rof2Slot.Slot >= SUB_INDEX_BEGIN)
|
||||||
@ -6170,11 +6170,11 @@ namespace RoF2
|
|||||||
ServerSlot = TempSlot;
|
ServerSlot = TempSlot;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
else if (rof2Slot.Type == inventory::TypeGuildTribute) {
|
else if (rof2Slot.Type == invtype::InvTypeGuildTribute) {
|
||||||
ServerSlot = INVALID_INDEX;
|
ServerSlot = INVALID_INDEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (rof2Slot.Type == inventory::TypeCorpse) {
|
else if (rof2Slot.Type == invtype::InvTypeCorpse) {
|
||||||
ServerSlot = rof2Slot.Slot + EQEmu::legacy::CORPSE_BEGIN;
|
ServerSlot = rof2Slot.Slot + EQEmu::legacy::CORPSE_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6189,10 +6189,10 @@ namespace RoF2
|
|||||||
uint32 TempSlot = 0;
|
uint32 TempSlot = 0;
|
||||||
|
|
||||||
if (rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33)
|
if (rof2Slot.Slot < 57) { // Worn/Personal Inventory and Cursor (< 33)
|
||||||
if (rof2Slot.Slot == inventory::SlotPowerSource)
|
if (rof2Slot.Slot == invslot::PossessionsPowerSource)
|
||||||
TempSlot = EQEmu::legacy::SlotPowerSource;
|
TempSlot = EQEmu::legacy::SlotPowerSource;
|
||||||
|
|
||||||
else if (rof2Slot.Slot >= inventory::SlotCursor) // Cursor and Extended Corpse Inventory
|
else if (rof2Slot.Slot >= invslot::PossessionsCursor) // Cursor and Extended Corpse Inventory
|
||||||
TempSlot = rof2Slot.Slot - 3;
|
TempSlot = rof2Slot.Slot - 3;
|
||||||
|
|
||||||
/*else if (RoF2Slot.MainSlot == slots::MainGeneral9 || RoF2Slot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF2 inventory slots
|
/*else if (RoF2Slot.MainSlot == slots::MainGeneral9 || RoF2Slot.MainSlot == slots::MainGeneral10) { // 9th and 10th RoF2 inventory slots
|
||||||
@ -6201,7 +6201,7 @@ namespace RoF2
|
|||||||
// Same as above
|
// Same as above
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
else if (rof2Slot.Slot >= inventory::SlotAmmo) // Main Inventory and Ammo Slots
|
else if (rof2Slot.Slot >= invslot::PossessionsAmmo) // Main Inventory and Ammo Slots
|
||||||
TempSlot = rof2Slot.Slot - 1;
|
TempSlot = rof2Slot.Slot - 1;
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -6225,7 +6225,7 @@ namespace RoF2
|
|||||||
|
|
||||||
static inline void ServerToRoF2TextLink(std::string& rof2TextLink, const std::string& serverTextLink)
|
static inline void ServerToRoF2TextLink(std::string& rof2TextLink, const std::string& serverTextLink)
|
||||||
{
|
{
|
||||||
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||||
rof2TextLink = serverTextLink;
|
rof2TextLink = serverTextLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6257,7 +6257,7 @@ namespace RoF2
|
|||||||
|
|
||||||
static inline void RoF2ToServerTextLink(std::string& serverTextLink, const std::string& rof2TextLink)
|
static inline void RoF2ToServerTextLink(std::string& serverTextLink, const std::string& rof2TextLink)
|
||||||
{
|
{
|
||||||
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (rof2TextLink.find('\x12') == std::string::npos)) {
|
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (rof2TextLink.find('\x12') == std::string::npos)) {
|
||||||
serverTextLink = rof2TextLink;
|
serverTextLink = rof2TextLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6266,7 +6266,7 @@ namespace RoF2
|
|||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
if (segments[segment_iter].length() <= consts::TEXT_LINK_BODY_LENGTH) {
|
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
|
||||||
serverTextLink.append(segments[segment_iter]);
|
serverTextLink.append(segments[segment_iter]);
|
||||||
// TODO: log size mismatch error
|
// TODO: log size mismatch error
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -16,3 +16,251 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "rof2_limits.h"
|
||||||
|
|
||||||
|
#include "../string_util.h"
|
||||||
|
|
||||||
|
|
||||||
|
size_t RoF2::invtype::InvTypeSize(int inv_type)
|
||||||
|
{
|
||||||
|
switch (inv_type) {
|
||||||
|
case invtype::InvTypePossessions:
|
||||||
|
return invtype::InvTypePossessionsSize;
|
||||||
|
case invtype::InvTypeBank:
|
||||||
|
return invtype::InvTypeBankSize;
|
||||||
|
case invtype::InvTypeSharedBank:
|
||||||
|
return invtype::InvTypeSharedBankSize;
|
||||||
|
case invtype::InvTypeTrade:
|
||||||
|
return invtype::InvTypeTradeSize;
|
||||||
|
case invtype::InvTypeWorld:
|
||||||
|
return invtype::InvTypeWorldSize;
|
||||||
|
case invtype::InvTypeLimbo:
|
||||||
|
return invtype::InvTypeLimboSize;
|
||||||
|
case invtype::InvTypeTribute:
|
||||||
|
return invtype::InvTypeTributeSize;
|
||||||
|
case invtype::InvTypeTrophyTribute:
|
||||||
|
return invtype::InvTypeTrophyTributeSize;
|
||||||
|
case invtype::InvTypeGuildTribute:
|
||||||
|
return invtype::InvTypeGuildTributeSize;
|
||||||
|
case invtype::InvTypeMerchant:
|
||||||
|
return invtype::InvTypeMerchantSize;
|
||||||
|
case invtype::InvTypeDeleted:
|
||||||
|
return invtype::InvTypeDeletedSize;
|
||||||
|
case invtype::InvTypeCorpse:
|
||||||
|
return invtype::InvTypeCorpseSize;
|
||||||
|
case invtype::InvTypeBazaar:
|
||||||
|
return invtype::InvTypeBazaarSize;
|
||||||
|
case invtype::InvTypeInspect:
|
||||||
|
return invtype::InvTypeInspectSize;
|
||||||
|
case invtype::InvTypeRealEstate:
|
||||||
|
return invtype::InvTypeRealEstateSize;
|
||||||
|
case invtype::InvTypeViewMODPC:
|
||||||
|
return invtype::InvTypeViewMODPCSize;
|
||||||
|
case invtype::InvTypeViewMODBank:
|
||||||
|
return invtype::InvTypeViewMODBankSize;
|
||||||
|
case invtype::InvTypeViewMODSharedBank:
|
||||||
|
return invtype::InvTypeViewMODSharedBankSize;
|
||||||
|
case invtype::InvTypeViewMODLimbo:
|
||||||
|
return invtype::InvTypeViewMODLimboSize;
|
||||||
|
case invtype::InvTypeAltStorage:
|
||||||
|
return invtype::InvTypeAltStorageSize;
|
||||||
|
case invtype::InvTypeArchived:
|
||||||
|
return invtype::InvTypeArchivedSize;
|
||||||
|
case invtype::InvTypeMail:
|
||||||
|
return invtype::InvTypeMailSize;
|
||||||
|
case invtype::InvTypeGuildTrophyTribute:
|
||||||
|
return invtype::InvTypeGuildTrophyTributeSize;
|
||||||
|
case invtype::InvTypeKrono:
|
||||||
|
return invtype::InvTypeKronoSize;
|
||||||
|
case invtype::InvTypeOther:
|
||||||
|
return invtype::InvTypeOtherSize;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* RoF2::invtype::InvTypeName(int inv_type)
|
||||||
|
{
|
||||||
|
switch (inv_type) {
|
||||||
|
case invtype::InvTypeInvalid:
|
||||||
|
return "Invalid Type";
|
||||||
|
case invtype::InvTypePossessions:
|
||||||
|
return "Possessions";
|
||||||
|
case invtype::InvTypeBank:
|
||||||
|
return "Bank";
|
||||||
|
case invtype::InvTypeSharedBank:
|
||||||
|
return "Shared Bank";
|
||||||
|
case invtype::InvTypeTrade:
|
||||||
|
return "Trade";
|
||||||
|
case invtype::InvTypeWorld:
|
||||||
|
return "World";
|
||||||
|
case invtype::InvTypeLimbo:
|
||||||
|
return "Limbo";
|
||||||
|
case invtype::InvTypeTribute:
|
||||||
|
return "Tribute";
|
||||||
|
case invtype::InvTypeTrophyTribute:
|
||||||
|
return "Trophy Tribute";
|
||||||
|
case invtype::InvTypeGuildTribute:
|
||||||
|
return "Guild Tribute";
|
||||||
|
case invtype::InvTypeMerchant:
|
||||||
|
return "Merchant";
|
||||||
|
case invtype::InvTypeDeleted:
|
||||||
|
return "Deleted";
|
||||||
|
case invtype::InvTypeCorpse:
|
||||||
|
return "Corpse";
|
||||||
|
case invtype::InvTypeBazaar:
|
||||||
|
return "Bazaar";
|
||||||
|
case invtype::InvTypeInspect:
|
||||||
|
return "Inspect";
|
||||||
|
case invtype::InvTypeRealEstate:
|
||||||
|
return "Real Estate";
|
||||||
|
case invtype::InvTypeViewMODPC:
|
||||||
|
return "View MOD PC";
|
||||||
|
case invtype::InvTypeViewMODBank:
|
||||||
|
return "View MOD Bank";
|
||||||
|
case invtype::InvTypeViewMODSharedBank:
|
||||||
|
return "View MOD Shared Bank";
|
||||||
|
case invtype::InvTypeViewMODLimbo:
|
||||||
|
return "View MOD Limbo";
|
||||||
|
case invtype::InvTypeAltStorage:
|
||||||
|
return "Alt Storage";
|
||||||
|
case invtype::InvTypeArchived:
|
||||||
|
return "Archived";
|
||||||
|
case invtype::InvTypeMail:
|
||||||
|
return "Mail";
|
||||||
|
case invtype::InvTypeGuildTrophyTribute:
|
||||||
|
return "Guild Trophy Tribute";
|
||||||
|
case invtype::InvTypeKrono:
|
||||||
|
return "Krono";
|
||||||
|
case invtype::InvTypeOther:
|
||||||
|
return "Other";
|
||||||
|
default:
|
||||||
|
return "Unknown Type";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* RoF2::invslot::InvPossessionsSlotName(int inv_slot)
|
||||||
|
{
|
||||||
|
switch (inv_slot) {
|
||||||
|
case invslot::InvSlotInvalid:
|
||||||
|
return "Invalid Slot";
|
||||||
|
case invslot::PossessionsCharm:
|
||||||
|
return "Charm";
|
||||||
|
case invslot::PossessionsEar1:
|
||||||
|
return "Ear 1";
|
||||||
|
case invslot::PossessionsHead:
|
||||||
|
return "Head";
|
||||||
|
case invslot::PossessionsFace:
|
||||||
|
return "Face";
|
||||||
|
case invslot::PossessionsEar2:
|
||||||
|
return "Ear 2";
|
||||||
|
case invslot::PossessionsNeck:
|
||||||
|
return "Neck";
|
||||||
|
case invslot::PossessionsShoulders:
|
||||||
|
return "Shoulders";
|
||||||
|
case invslot::PossessionsArms:
|
||||||
|
return "Arms";
|
||||||
|
case invslot::PossessionsBack:
|
||||||
|
return "Back";
|
||||||
|
case invslot::PossessionsWrist1:
|
||||||
|
return "Wrist 1";
|
||||||
|
case invslot::PossessionsWrist2:
|
||||||
|
return "Wrist 2";
|
||||||
|
case invslot::PossessionsRange:
|
||||||
|
return "Range";
|
||||||
|
case invslot::PossessionsHands:
|
||||||
|
return "Hands";
|
||||||
|
case invslot::PossessionsPrimary:
|
||||||
|
return "Primary";
|
||||||
|
case invslot::PossessionsSecondary:
|
||||||
|
return "Secondary";
|
||||||
|
case invslot::PossessionsFinger1:
|
||||||
|
return "Finger 1";
|
||||||
|
case invslot::PossessionsFinger2:
|
||||||
|
return "Finger 2";
|
||||||
|
case invslot::PossessionsChest:
|
||||||
|
return "Chest";
|
||||||
|
case invslot::PossessionsLegs:
|
||||||
|
return "Legs";
|
||||||
|
case invslot::PossessionsFeet:
|
||||||
|
return "Feet";
|
||||||
|
case invslot::PossessionsWaist:
|
||||||
|
return "Waist";
|
||||||
|
case invslot::PossessionsPowerSource:
|
||||||
|
return "Power Source";
|
||||||
|
case invslot::PossessionsAmmo:
|
||||||
|
return "Ammo";
|
||||||
|
case invslot::PossessionsGeneral1:
|
||||||
|
return "General 1";
|
||||||
|
case invslot::PossessionsGeneral2:
|
||||||
|
return "General 2";
|
||||||
|
case invslot::PossessionsGeneral3:
|
||||||
|
return "General 3";
|
||||||
|
case invslot::PossessionsGeneral4:
|
||||||
|
return "General 4";
|
||||||
|
case invslot::PossessionsGeneral5:
|
||||||
|
return "General 5";
|
||||||
|
case invslot::PossessionsGeneral6:
|
||||||
|
return "General 6";
|
||||||
|
case invslot::PossessionsGeneral7:
|
||||||
|
return "General 7";
|
||||||
|
case invslot::PossessionsGeneral8:
|
||||||
|
return "General 8";
|
||||||
|
case invslot::PossessionsGeneral9:
|
||||||
|
return "General 9";
|
||||||
|
case invslot::PossessionsGeneral10:
|
||||||
|
return "General 10";
|
||||||
|
case invslot::PossessionsCursor:
|
||||||
|
return "Cursor";
|
||||||
|
default:
|
||||||
|
return "Unknown Slot";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* RoF2::invslot::InvSlotName(int inv_type, int inv_slot)
|
||||||
|
{
|
||||||
|
if (inv_type == invtype::InvTypePossessions)
|
||||||
|
return invslot::InvPossessionsSlotName(inv_slot);
|
||||||
|
|
||||||
|
size_t type_size = invtype::InvTypeSize(inv_type);
|
||||||
|
|
||||||
|
if (!type_size || inv_slot == invslot::InvSlotInvalid)
|
||||||
|
return "Invalid Slot";
|
||||||
|
|
||||||
|
if ((size_t)(inv_slot + 1) >= type_size)
|
||||||
|
return "Unknown Slot";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Slot %i", (inv_slot + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* RoF2::invbag::InvBagIndexName(int bag_index)
|
||||||
|
{
|
||||||
|
if (bag_index == invbag::InvBagInvalid)
|
||||||
|
return "Invalid Bag";
|
||||||
|
|
||||||
|
if ((size_t)bag_index >= invbag::ItemBagSize)
|
||||||
|
return "Unknown Bag";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Bag %i", (bag_index + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* RoF2::invaug::InvAugIndexName(int aug_index)
|
||||||
|
{
|
||||||
|
if (aug_index == invaug::InvAugInvalid)
|
||||||
|
return "Invalid Augment";
|
||||||
|
|
||||||
|
if ((size_t)aug_index >= invaug::ItemAugSize)
|
||||||
|
return "Unknown Augment";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Augment %i", (aug_index + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|||||||
@ -17,183 +17,269 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef COMMON_ROF2_CONSTANTS_H
|
#ifndef COMMON_ROF2_LIMITS_H
|
||||||
#define COMMON_ROF2_CONSTANTS_H
|
#define COMMON_ROF2_LIMITS_H
|
||||||
|
|
||||||
#include "../types.h"
|
#include "../types.h"
|
||||||
|
#include "../client_version.h"
|
||||||
|
#include "../skills.h"
|
||||||
|
|
||||||
|
|
||||||
namespace RoF2
|
namespace RoF2
|
||||||
{
|
{
|
||||||
namespace inventory {
|
enum : int { Invalid = -1, Null, Safety };
|
||||||
typedef enum : int16 {
|
|
||||||
TypePossessions = 0,
|
|
||||||
TypeBank,
|
|
||||||
TypeSharedBank,
|
|
||||||
TypeTrade,
|
|
||||||
TypeWorld,
|
|
||||||
TypeLimbo,
|
|
||||||
TypeTribute,
|
|
||||||
TypeTrophyTribute,
|
|
||||||
TypeGuildTribute,
|
|
||||||
TypeMerchant,
|
|
||||||
TypeDeleted,
|
|
||||||
TypeCorpse,
|
|
||||||
TypeBazaar,
|
|
||||||
TypeInspect,
|
|
||||||
TypeRealEstate,
|
|
||||||
TypeViewMODPC,
|
|
||||||
TypeViewMODBank,
|
|
||||||
TypeViewMODSharedBank,
|
|
||||||
TypeViewMODLimbo,
|
|
||||||
TypeAltStorage,
|
|
||||||
TypeArchived,
|
|
||||||
TypeMail,
|
|
||||||
TypeGuildTrophyTribute,
|
|
||||||
TypeKrono,
|
|
||||||
TypeOther,
|
|
||||||
TypeCount
|
|
||||||
} InventoryTypes;
|
|
||||||
|
|
||||||
typedef enum : int16 {
|
enum : bool { False = false, True = true };
|
||||||
SlotCharm = 0,
|
|
||||||
SlotEar1,
|
|
||||||
SlotHead,
|
|
||||||
SlotFace,
|
|
||||||
SlotEar2,
|
|
||||||
SlotNeck,
|
|
||||||
SlotShoulders,
|
|
||||||
SlotArms,
|
|
||||||
SlotBack,
|
|
||||||
SlotWrist1,
|
|
||||||
SlotWrist2,
|
|
||||||
SlotRange,
|
|
||||||
SlotHands,
|
|
||||||
SlotPrimary,
|
|
||||||
SlotSecondary,
|
|
||||||
SlotFinger1,
|
|
||||||
SlotFinger2,
|
|
||||||
SlotChest,
|
|
||||||
SlotLegs,
|
|
||||||
SlotFeet,
|
|
||||||
SlotWaist,
|
|
||||||
SlotPowerSource,
|
|
||||||
SlotAmmo,
|
|
||||||
SlotGeneral1,
|
|
||||||
SlotGeneral2,
|
|
||||||
SlotGeneral3,
|
|
||||||
SlotGeneral4,
|
|
||||||
SlotGeneral5,
|
|
||||||
SlotGeneral6,
|
|
||||||
SlotGeneral7,
|
|
||||||
SlotGeneral8,
|
|
||||||
SlotGeneral9,
|
|
||||||
SlotGeneral10,
|
|
||||||
SlotCursor,
|
|
||||||
SlotCount,
|
|
||||||
SlotEquipmentBegin = SlotCharm,
|
|
||||||
SlotEquipmentEnd = SlotAmmo,
|
|
||||||
SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1),
|
|
||||||
SlotGeneralBegin = SlotGeneral1,
|
|
||||||
SlotGeneralEnd = SlotGeneral10,
|
|
||||||
SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1)
|
|
||||||
} PossessionsSlots;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace consts {
|
// pre-declarations
|
||||||
static const size_t CHARACTER_CREATION_LIMIT = 12;
|
namespace invtype {
|
||||||
|
inline EQEmu::versions::ClientVersion InvTypeRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
static const uint16 TYPE_POSSESSIONS_SIZE = inventory::SlotCount;
|
enum : int { InvTypeInvalid = -1, InvTypeBegin };
|
||||||
static const uint16 TYPE_BANK_SIZE = 24;
|
|
||||||
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
|
|
||||||
static const uint16 TYPE_TRADE_SIZE = 8;
|
|
||||||
static const uint16 TYPE_WORLD_SIZE = 10;
|
|
||||||
static const uint16 TYPE_LIMBO_SIZE = 36;
|
|
||||||
static const uint16 TYPE_TRIBUTE_SIZE = 0; //?
|
|
||||||
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_MERCHANT_SIZE = 0;
|
|
||||||
static const uint16 TYPE_DELETED_SIZE = 0;
|
|
||||||
static const uint16 TYPE_CORPSE_SIZE = inventory::SlotCount;
|
|
||||||
static const uint16 TYPE_BAZAAR_SIZE = 200;
|
|
||||||
static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount;
|
|
||||||
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE;
|
|
||||||
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_ARCHIVED_SIZE = 0;
|
|
||||||
static const uint16 TYPE_MAIL_SIZE = 0;
|
|
||||||
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_KRONO_SIZE = NOT_USED;
|
|
||||||
static const uint16 TYPE_OTHER_SIZE = 0;
|
|
||||||
|
|
||||||
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
|
enum InventoryType : int {
|
||||||
// (bag slots and main slots beyond Possessions are assigned for compatibility with current server coding)
|
InvTypePossessions = InvTypeBegin,
|
||||||
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
|
InvTypeBank,
|
||||||
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
|
InvTypeSharedBank,
|
||||||
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
|
InvTypeTrade,
|
||||||
|
InvTypeWorld,
|
||||||
|
InvTypeLimbo,
|
||||||
|
InvTypeTribute,
|
||||||
|
InvTypeTrophyTribute,
|
||||||
|
InvTypeGuildTribute,
|
||||||
|
InvTypeMerchant,
|
||||||
|
InvTypeDeleted,
|
||||||
|
InvTypeCorpse,
|
||||||
|
InvTypeBazaar,
|
||||||
|
InvTypeInspect,
|
||||||
|
InvTypeRealEstate,
|
||||||
|
InvTypeViewMODPC,
|
||||||
|
InvTypeViewMODBank,
|
||||||
|
InvTypeViewMODSharedBank,
|
||||||
|
InvTypeViewMODLimbo,
|
||||||
|
InvTypeAltStorage,
|
||||||
|
InvTypeArchived,
|
||||||
|
InvTypeMail,
|
||||||
|
InvTypeGuildTrophyTribute,
|
||||||
|
InvTypeKrono,
|
||||||
|
InvTypeOther,
|
||||||
|
InvTypeCount
|
||||||
|
};
|
||||||
|
|
||||||
static const int16 GENERAL_BEGIN = inventory::SlotGeneral1;
|
} /*invtype*/
|
||||||
static const int16 GENERAL_END = inventory::SlotGeneral10;
|
|
||||||
static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount;
|
|
||||||
static const int16 GENERAL_BAGS_BEGIN = 251;
|
|
||||||
static const int16 GENERAL_BAGS_END_OFFSET = 99;
|
|
||||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 CURSOR = inventory::SlotCursor;
|
namespace invslot {
|
||||||
static const int16 CURSOR_BAG_BEGIN = 351;
|
inline EQEmu::versions::ClientVersion InvSlotRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
|
||||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 BANK_BEGIN = 2000;
|
enum : int { InvSlotInvalid = -1, InvSlotBegin };
|
||||||
static const int16 BANK_END = 2023;
|
|
||||||
static const int16 BANK_BAGS_BEGIN = 2031;
|
|
||||||
static const int16 BANK_BAGS_END_OFFSET = 239;
|
|
||||||
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 SHARED_BANK_BEGIN = 2500;
|
enum PossessionsSlot : int {
|
||||||
static const int16 SHARED_BANK_END = 2501;
|
PossessionsCharm = InvSlotBegin,
|
||||||
static const int16 SHARED_BANK_BAGS_BEGIN = 2531;
|
PossessionsEar1,
|
||||||
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
|
PossessionsHead,
|
||||||
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
|
PossessionsFace,
|
||||||
|
PossessionsEar2,
|
||||||
|
PossessionsNeck,
|
||||||
|
PossessionsShoulders,
|
||||||
|
PossessionsArms,
|
||||||
|
PossessionsBack,
|
||||||
|
PossessionsWrist1,
|
||||||
|
PossessionsWrist2,
|
||||||
|
PossessionsRange,
|
||||||
|
PossessionsHands,
|
||||||
|
PossessionsPrimary,
|
||||||
|
PossessionsSecondary,
|
||||||
|
PossessionsFinger1,
|
||||||
|
PossessionsFinger2,
|
||||||
|
PossessionsChest,
|
||||||
|
PossessionsLegs,
|
||||||
|
PossessionsFeet,
|
||||||
|
PossessionsWaist,
|
||||||
|
PossessionsPowerSource,
|
||||||
|
PossessionsAmmo,
|
||||||
|
PossessionsGeneral1,
|
||||||
|
PossessionsGeneral2,
|
||||||
|
PossessionsGeneral3,
|
||||||
|
PossessionsGeneral4,
|
||||||
|
PossessionsGeneral5,
|
||||||
|
PossessionsGeneral6,
|
||||||
|
PossessionsGeneral7,
|
||||||
|
PossessionsGeneral8,
|
||||||
|
PossessionsGeneral9,
|
||||||
|
PossessionsGeneral10,
|
||||||
|
PossessionsCursor,
|
||||||
|
PossessionsCount
|
||||||
|
};
|
||||||
|
|
||||||
static const int16 TRADE_BEGIN = 3000;
|
const int EquipmentBegin = PossessionsCharm;
|
||||||
static const int16 TRADE_END = 3007;
|
const int EquipmentEnd = PossessionsAmmo;
|
||||||
static const int16 TRADE_NPC_END = 3003;
|
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
|
||||||
static const int16 TRADE_BAGS_BEGIN = 3031;
|
|
||||||
static const int16 TRADE_BAGS_END_OFFSET = 79;
|
|
||||||
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 WORLD_BEGIN = 4000;
|
const int GeneralBegin = PossessionsGeneral1;
|
||||||
static const int16 WORLD_END = 4009;
|
const int GeneralEnd = PossessionsGeneral10;
|
||||||
|
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
|
||||||
|
|
||||||
static const int16 TRIBUTE_BEGIN = 400;
|
} /*invslot*/
|
||||||
static const int16 TRIBUTE_END = 404;
|
|
||||||
|
|
||||||
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
|
namespace invbag {
|
||||||
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
|
inline EQEmu::versions::ClientVersion InvBagRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
static const uint16 ITEM_COMMON_SIZE = 6;
|
enum : int { InvBagInvalid = -1, InvBagBegin };
|
||||||
static const uint16 ITEM_CONTAINER_SIZE = 255; // 255; (server max will be 255..unsure what actual client is - test)
|
|
||||||
|
|
||||||
static const size_t BANDOLIERS_SIZE = 20; // number of bandolier instances
|
} /*invbag*/
|
||||||
static const size_t BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
|
||||||
|
|
||||||
static const size_t POTION_BELT_ITEM_COUNT = 5;
|
namespace invaug {
|
||||||
|
inline EQEmu::versions::ClientVersion InvAugRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
static const size_t TEXT_LINK_BODY_LENGTH = 56;
|
enum : int { InvAugInvalid = -1, InvAugBegin };
|
||||||
|
|
||||||
static const size_t PLAYER_PROFILE_SKILL_MAX = Skill2HPiercing;
|
} /*invaug*/
|
||||||
}
|
|
||||||
|
|
||||||
namespace limits {
|
namespace item {
|
||||||
static const bool ALLOWS_EMPTY_BAG_IN_BAG = true;
|
inline EQEmu::versions::ClientVersion ItemRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||||
static const bool ALLOWS_CLICK_CAST_FROM_BAG = true;
|
|
||||||
static const bool COIN_HAS_WEIGHT = false;
|
//enum Unknown : int { // looks like item class..but, RoF has it too - nothing in UF-
|
||||||
}
|
// Unknown1 = 0,
|
||||||
|
// Unknown2 = 1,
|
||||||
|
// Unknown3 = 2,
|
||||||
|
// Unknown4 = 5 // krono?
|
||||||
|
//};
|
||||||
|
|
||||||
|
enum ItemPacketType : int {
|
||||||
|
ItemPacketMerchant = 100,
|
||||||
|
ItemPacketTradeView = 101,
|
||||||
|
ItemPacketLoot = 102,
|
||||||
|
ItemPacketTrade = 103,
|
||||||
|
ItemPacketCharInventory = 105,
|
||||||
|
ItemPacketLimbo = 106,
|
||||||
|
ItemPacketWorldContainer = 107,
|
||||||
|
ItemPacketTributeItem = 108,
|
||||||
|
ItemPacketGuildTribute = 109,
|
||||||
|
ItemPacket10 = 110,
|
||||||
|
ItemPacket11 = 111,
|
||||||
|
ItemPacket12 = 112,
|
||||||
|
ItemPacketRecovery = 113,
|
||||||
|
ItemPacket14 = 115
|
||||||
|
};
|
||||||
|
|
||||||
|
} /*item*/
|
||||||
|
|
||||||
|
namespace profile {
|
||||||
|
inline EQEmu::versions::ClientVersion ProfileRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
|
} /*profile*/
|
||||||
|
|
||||||
|
namespace constants {
|
||||||
|
inline EQEmu::versions::ClientVersion ConstantsRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
|
} /*constants*/
|
||||||
|
|
||||||
|
namespace behavior {
|
||||||
|
inline EQEmu::versions::ClientVersion BehaviorRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
|
} /*behavior*/
|
||||||
|
|
||||||
|
namespace skills {
|
||||||
|
inline EQEmu::versions::ClientVersion SkillsRef() { return EQEmu::versions::ClientVersion::RoF2; }
|
||||||
|
|
||||||
|
} /*skills*/
|
||||||
|
|
||||||
|
|
||||||
|
// declarations
|
||||||
|
namespace invtype {
|
||||||
|
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
|
||||||
|
const size_t InvTypeBankSize = 24;
|
||||||
|
const size_t InvTypeSharedBankSize = 2;
|
||||||
|
const size_t InvTypeTradeSize = 8;
|
||||||
|
const size_t InvTypeWorldSize = 10;
|
||||||
|
const size_t InvTypeLimboSize = 36;
|
||||||
|
const size_t InvTypeTributeSize = 5;
|
||||||
|
const size_t InvTypeTrophyTributeSize = 0;//unknown
|
||||||
|
const size_t InvTypeGuildTributeSize = 0;//unknown
|
||||||
|
const size_t InvTypeMerchantSize = 200;
|
||||||
|
const size_t InvTypeDeletedSize = 0;//unknown - "Recovery Tab"
|
||||||
|
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
|
||||||
|
const size_t InvTypeBazaarSize = 200;
|
||||||
|
const size_t InvTypeInspectSize = invslot::EquipmentCount;
|
||||||
|
const size_t InvTypeRealEstateSize = 0;//unknown
|
||||||
|
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
|
||||||
|
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
|
||||||
|
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
|
||||||
|
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
|
||||||
|
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
|
||||||
|
const size_t InvTypeArchivedSize = 0;//unknown
|
||||||
|
const size_t InvTypeMailSize = 0;//unknown
|
||||||
|
const size_t InvTypeGuildTrophyTributeSize = 0;//unknown
|
||||||
|
const size_t InvTypeKronoSize = 0;//unknown
|
||||||
|
const size_t InvTypeOtherSize = 0;//unknown
|
||||||
|
|
||||||
|
const size_t NPCTradeSize = 4;
|
||||||
|
|
||||||
|
extern size_t InvTypeSize(int inv_type);
|
||||||
|
extern const char* InvTypeName(int inv_type);
|
||||||
|
|
||||||
|
} /*invtype*/
|
||||||
|
|
||||||
|
namespace invslot {
|
||||||
|
extern const char* InvPossessionsSlotName(int inv_slot);
|
||||||
|
extern const char* InvSlotName(int inv_type, int inv_slot);
|
||||||
|
|
||||||
|
} /*invslot*/
|
||||||
|
|
||||||
|
namespace invbag {
|
||||||
|
const size_t ItemBagSize = 255; // server Size will be 255..unsure what actual client is (test)
|
||||||
|
|
||||||
|
extern const char* InvBagIndexName(int bag_index);
|
||||||
|
|
||||||
|
} /*invbag*/
|
||||||
|
|
||||||
|
namespace invaug {
|
||||||
|
const size_t ItemAugSize = 6;
|
||||||
|
|
||||||
|
extern const char* InvAugIndexName(int aug_index);
|
||||||
|
|
||||||
|
} /*invaug*/
|
||||||
|
|
||||||
|
namespace item {
|
||||||
|
|
||||||
|
} /*item*/
|
||||||
|
|
||||||
|
namespace profile {
|
||||||
|
const size_t TributeSize = invtype::InvTypeTributeSize;
|
||||||
|
|
||||||
|
const size_t BandoliersSize = 20; // number of bandolier instances
|
||||||
|
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
|
||||||
|
|
||||||
|
const size_t PotionBeltSize = 5;
|
||||||
|
|
||||||
|
const size_t SkillArraySize = 100;
|
||||||
|
|
||||||
|
} /*profile*/
|
||||||
|
|
||||||
|
namespace constants {
|
||||||
|
const size_t CharacterCreationLimit = 12;
|
||||||
|
|
||||||
|
const size_t SayLinkBodySize = 56;
|
||||||
|
|
||||||
|
} /*constants*/
|
||||||
|
|
||||||
|
namespace behavior {
|
||||||
|
const bool ConcatenateInvTypeLimbo = false;
|
||||||
|
|
||||||
|
const bool AllowOverLevelEquipment = true;
|
||||||
|
|
||||||
|
const bool AllowEmptyBagInBag = true;
|
||||||
|
const bool AllowClickCastFromBag = true;
|
||||||
|
|
||||||
|
const bool CoinHasWeight = false;
|
||||||
|
|
||||||
|
} /*behavior*/
|
||||||
|
|
||||||
|
namespace skills {
|
||||||
|
const size_t LastUsableSkill = EQEmu::skills::Skill2HPiercing;
|
||||||
|
|
||||||
|
} /*skills*/
|
||||||
|
|
||||||
}; /*RoF2*/
|
}; /*RoF2*/
|
||||||
|
|
||||||
#endif /*COMMON_ROF2_CONSTANTS_H*/
|
#endif /*COMMON_ROF2_LIMITS_H*/
|
||||||
|
|||||||
@ -948,13 +948,13 @@ struct BandolierItem_Struct_Old
|
|||||||
struct Bandolier_Struct
|
struct Bandolier_Struct
|
||||||
{
|
{
|
||||||
char Name[1]; // Variable Length
|
char Name[1]; // Variable Length
|
||||||
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
|
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Bandolier_Struct_Old
|
struct Bandolier_Struct_Old
|
||||||
{
|
{
|
||||||
char Name[32];
|
char Name[32];
|
||||||
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
|
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PotionBeltItem_Struct
|
struct PotionBeltItem_Struct
|
||||||
@ -974,12 +974,12 @@ struct PotionBeltItem_Struct_Old
|
|||||||
|
|
||||||
struct PotionBelt_Struct
|
struct PotionBelt_Struct
|
||||||
{
|
{
|
||||||
PotionBeltItem_Struct Items[consts::POTION_BELT_ITEM_COUNT];
|
PotionBeltItem_Struct Items[profile::PotionBeltSize];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PotionBelt_Struct_Old
|
struct PotionBelt_Struct_Old
|
||||||
{
|
{
|
||||||
PotionBeltItem_Struct_Old Items[consts::POTION_BELT_ITEM_COUNT];
|
PotionBeltItem_Struct_Old Items[profile::PotionBeltSize];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GroupLeadershipAA_Struct {
|
struct GroupLeadershipAA_Struct {
|
||||||
@ -1189,7 +1189,7 @@ union
|
|||||||
/*12949*/ uint32 aapoints; // Unspent AA points - Seen 1
|
/*12949*/ uint32 aapoints; // Unspent AA points - Seen 1
|
||||||
/*12953*/ uint16 unknown_rof20; //
|
/*12953*/ uint16 unknown_rof20; //
|
||||||
/*12955*/ uint32 bandolier_count; // Seen 20
|
/*12955*/ uint32 bandolier_count; // Seen 20
|
||||||
/*12959*/ Bandolier_Struct bandoliers[consts::BANDOLIERS_SIZE]; // [20] 740 bytes (Variable Name Sizes) - bandolier contents
|
/*12959*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // [20] 740 bytes (Variable Name Sizes) - bandolier contents
|
||||||
/*13699*/ uint32 potionbelt_count; // Seen 5
|
/*13699*/ uint32 potionbelt_count; // Seen 5
|
||||||
/*13703*/ PotionBelt_Struct potionbelt; // [5] 45 bytes potion belt - (Variable Name Sizes)
|
/*13703*/ PotionBelt_Struct potionbelt; // [5] 45 bytes potion belt - (Variable Name Sizes)
|
||||||
/*13748*/ int32 unknown_rof21; // Seen -1
|
/*13748*/ int32 unknown_rof21; // Seen -1
|
||||||
|
|||||||
@ -16,3 +16,247 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "rof_limits.h"
|
||||||
|
|
||||||
|
#include "../string_util.h"
|
||||||
|
|
||||||
|
|
||||||
|
size_t RoF::invtype::InvTypeSize(int inv_type)
|
||||||
|
{
|
||||||
|
switch (inv_type) {
|
||||||
|
case invtype::InvTypePossessions:
|
||||||
|
return invtype::InvTypePossessionsSize;
|
||||||
|
case invtype::InvTypeBank:
|
||||||
|
return invtype::InvTypeBankSize;
|
||||||
|
case invtype::InvTypeSharedBank:
|
||||||
|
return invtype::InvTypeSharedBankSize;
|
||||||
|
case invtype::InvTypeTrade:
|
||||||
|
return invtype::InvTypeTradeSize;
|
||||||
|
case invtype::InvTypeWorld:
|
||||||
|
return invtype::InvTypeWorldSize;
|
||||||
|
case invtype::InvTypeLimbo:
|
||||||
|
return invtype::InvTypeLimboSize;
|
||||||
|
case invtype::InvTypeTribute:
|
||||||
|
return invtype::InvTypeTributeSize;
|
||||||
|
case invtype::InvTypeTrophyTribute:
|
||||||
|
return invtype::InvTypeTrophyTributeSize;
|
||||||
|
case invtype::InvTypeGuildTribute:
|
||||||
|
return invtype::InvTypeGuildTributeSize;
|
||||||
|
case invtype::InvTypeMerchant:
|
||||||
|
return invtype::InvTypeMerchantSize;
|
||||||
|
case invtype::InvTypeDeleted:
|
||||||
|
return invtype::InvTypeDeletedSize;
|
||||||
|
case invtype::InvTypeCorpse:
|
||||||
|
return invtype::InvTypeCorpseSize;
|
||||||
|
case invtype::InvTypeBazaar:
|
||||||
|
return invtype::InvTypeBazaarSize;
|
||||||
|
case invtype::InvTypeInspect:
|
||||||
|
return invtype::InvTypeInspectSize;
|
||||||
|
case invtype::InvTypeRealEstate:
|
||||||
|
return invtype::InvTypeRealEstateSize;
|
||||||
|
case invtype::InvTypeViewMODPC:
|
||||||
|
return invtype::InvTypeViewMODPCSize;
|
||||||
|
case invtype::InvTypeViewMODBank:
|
||||||
|
return invtype::InvTypeViewMODBankSize;
|
||||||
|
case invtype::InvTypeViewMODSharedBank:
|
||||||
|
return invtype::InvTypeViewMODSharedBankSize;
|
||||||
|
case invtype::InvTypeViewMODLimbo:
|
||||||
|
return invtype::InvTypeViewMODLimboSize;
|
||||||
|
case invtype::InvTypeAltStorage:
|
||||||
|
return invtype::InvTypeAltStorageSize;
|
||||||
|
case invtype::InvTypeArchived:
|
||||||
|
return invtype::InvTypeArchivedSize;
|
||||||
|
case invtype::InvTypeMail:
|
||||||
|
return invtype::InvTypeMailSize;
|
||||||
|
case invtype::InvTypeGuildTrophyTribute:
|
||||||
|
return invtype::InvTypeGuildTrophyTributeSize;
|
||||||
|
case invtype::InvTypeOther:
|
||||||
|
return invtype::InvTypeOtherSize;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* RoF::invtype::InvTypeName(int inv_type)
|
||||||
|
{
|
||||||
|
switch (inv_type) {
|
||||||
|
case invtype::InvTypeInvalid:
|
||||||
|
return "Invalid Type";
|
||||||
|
case invtype::InvTypePossessions:
|
||||||
|
return "Possessions";
|
||||||
|
case invtype::InvTypeBank:
|
||||||
|
return "Bank";
|
||||||
|
case invtype::InvTypeSharedBank:
|
||||||
|
return "Shared Bank";
|
||||||
|
case invtype::InvTypeTrade:
|
||||||
|
return "Trade";
|
||||||
|
case invtype::InvTypeWorld:
|
||||||
|
return "World";
|
||||||
|
case invtype::InvTypeLimbo:
|
||||||
|
return "Limbo";
|
||||||
|
case invtype::InvTypeTribute:
|
||||||
|
return "Tribute";
|
||||||
|
case invtype::InvTypeTrophyTribute:
|
||||||
|
return "Trophy Tribute";
|
||||||
|
case invtype::InvTypeGuildTribute:
|
||||||
|
return "Guild Tribute";
|
||||||
|
case invtype::InvTypeMerchant:
|
||||||
|
return "Merchant";
|
||||||
|
case invtype::InvTypeDeleted:
|
||||||
|
return "Deleted";
|
||||||
|
case invtype::InvTypeCorpse:
|
||||||
|
return "Corpse";
|
||||||
|
case invtype::InvTypeBazaar:
|
||||||
|
return "Bazaar";
|
||||||
|
case invtype::InvTypeInspect:
|
||||||
|
return "Inspect";
|
||||||
|
case invtype::InvTypeRealEstate:
|
||||||
|
return "Real Estate";
|
||||||
|
case invtype::InvTypeViewMODPC:
|
||||||
|
return "View MOD PC";
|
||||||
|
case invtype::InvTypeViewMODBank:
|
||||||
|
return "View MOD Bank";
|
||||||
|
case invtype::InvTypeViewMODSharedBank:
|
||||||
|
return "View MOD Shared Bank";
|
||||||
|
case invtype::InvTypeViewMODLimbo:
|
||||||
|
return "View MOD Limbo";
|
||||||
|
case invtype::InvTypeAltStorage:
|
||||||
|
return "Alt Storage";
|
||||||
|
case invtype::InvTypeArchived:
|
||||||
|
return "Archived";
|
||||||
|
case invtype::InvTypeMail:
|
||||||
|
return "Mail";
|
||||||
|
case invtype::InvTypeGuildTrophyTribute:
|
||||||
|
return "Guild Trophy Tribute";
|
||||||
|
case invtype::InvTypeOther:
|
||||||
|
return "Other";
|
||||||
|
default:
|
||||||
|
return "Unknown Type";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* RoF::invslot::InvPossessionsSlotName(int inv_slot)
|
||||||
|
{
|
||||||
|
switch (inv_slot) {
|
||||||
|
case invslot::InvSlotInvalid:
|
||||||
|
return "Invalid Slot";
|
||||||
|
case invslot::PossessionsCharm:
|
||||||
|
return "Charm";
|
||||||
|
case invslot::PossessionsEar1:
|
||||||
|
return "Ear 1";
|
||||||
|
case invslot::PossessionsHead:
|
||||||
|
return "Head";
|
||||||
|
case invslot::PossessionsFace:
|
||||||
|
return "Face";
|
||||||
|
case invslot::PossessionsEar2:
|
||||||
|
return "Ear 2";
|
||||||
|
case invslot::PossessionsNeck:
|
||||||
|
return "Neck";
|
||||||
|
case invslot::PossessionsShoulders:
|
||||||
|
return "Shoulders";
|
||||||
|
case invslot::PossessionsArms:
|
||||||
|
return "Arms";
|
||||||
|
case invslot::PossessionsBack:
|
||||||
|
return "Back";
|
||||||
|
case invslot::PossessionsWrist1:
|
||||||
|
return "Wrist 1";
|
||||||
|
case invslot::PossessionsWrist2:
|
||||||
|
return "Wrist 2";
|
||||||
|
case invslot::PossessionsRange:
|
||||||
|
return "Range";
|
||||||
|
case invslot::PossessionsHands:
|
||||||
|
return "Hands";
|
||||||
|
case invslot::PossessionsPrimary:
|
||||||
|
return "Primary";
|
||||||
|
case invslot::PossessionsSecondary:
|
||||||
|
return "Secondary";
|
||||||
|
case invslot::PossessionsFinger1:
|
||||||
|
return "Finger 1";
|
||||||
|
case invslot::PossessionsFinger2:
|
||||||
|
return "Finger 2";
|
||||||
|
case invslot::PossessionsChest:
|
||||||
|
return "Chest";
|
||||||
|
case invslot::PossessionsLegs:
|
||||||
|
return "Legs";
|
||||||
|
case invslot::PossessionsFeet:
|
||||||
|
return "Feet";
|
||||||
|
case invslot::PossessionsWaist:
|
||||||
|
return "Waist";
|
||||||
|
case invslot::PossessionsPowerSource:
|
||||||
|
return "Power Source";
|
||||||
|
case invslot::PossessionsAmmo:
|
||||||
|
return "Ammo";
|
||||||
|
case invslot::PossessionsGeneral1:
|
||||||
|
return "General 1";
|
||||||
|
case invslot::PossessionsGeneral2:
|
||||||
|
return "General 2";
|
||||||
|
case invslot::PossessionsGeneral3:
|
||||||
|
return "General 3";
|
||||||
|
case invslot::PossessionsGeneral4:
|
||||||
|
return "General 4";
|
||||||
|
case invslot::PossessionsGeneral5:
|
||||||
|
return "General 5";
|
||||||
|
case invslot::PossessionsGeneral6:
|
||||||
|
return "General 6";
|
||||||
|
case invslot::PossessionsGeneral7:
|
||||||
|
return "General 7";
|
||||||
|
case invslot::PossessionsGeneral8:
|
||||||
|
return "General 8";
|
||||||
|
case invslot::PossessionsGeneral9:
|
||||||
|
return "General 9";
|
||||||
|
case invslot::PossessionsGeneral10:
|
||||||
|
return "General 10";
|
||||||
|
case invslot::PossessionsCursor:
|
||||||
|
return "Cursor";
|
||||||
|
default:
|
||||||
|
return "Unknown Slot";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* RoF::invslot::InvSlotName(int inv_type, int inv_slot)
|
||||||
|
{
|
||||||
|
if (inv_type == invtype::InvTypePossessions)
|
||||||
|
return invslot::InvPossessionsSlotName(inv_slot);
|
||||||
|
|
||||||
|
size_t type_size = invtype::InvTypeSize(inv_type);
|
||||||
|
|
||||||
|
if (!type_size || inv_slot == invslot::InvSlotInvalid)
|
||||||
|
return "Invalid Slot";
|
||||||
|
|
||||||
|
if ((size_t)(inv_slot + 1) >= type_size)
|
||||||
|
return "Unknown Slot";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Slot %i", (inv_slot + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* RoF::invbag::InvBagIndexName(int bag_index)
|
||||||
|
{
|
||||||
|
if (bag_index == invbag::InvBagInvalid)
|
||||||
|
return "Invalid Bag";
|
||||||
|
|
||||||
|
if ((size_t)bag_index >= invbag::ItemBagSize)
|
||||||
|
return "Unknown Bag";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Bag %i", (bag_index + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* RoF::invaug::InvAugIndexName(int aug_index)
|
||||||
|
{
|
||||||
|
if (aug_index == invaug::InvAugInvalid)
|
||||||
|
return "Invalid Augment";
|
||||||
|
|
||||||
|
if ((size_t)aug_index >= invaug::ItemAugSize)
|
||||||
|
return "Unknown Augment";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Augment %i", (aug_index + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|||||||
@ -17,182 +17,260 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef COMMON_ROF_CONSTANTS_H
|
#ifndef COMMON_ROF_LIMITS_H
|
||||||
#define COMMON_ROF_CONSTANTS_H
|
#define COMMON_ROF_LIMITS_H
|
||||||
|
|
||||||
#include "../types.h"
|
#include "../types.h"
|
||||||
|
#include "../client_version.h"
|
||||||
|
#include "../skills.h"
|
||||||
|
|
||||||
|
|
||||||
namespace RoF
|
namespace RoF
|
||||||
{
|
{
|
||||||
namespace inventory {
|
enum : int { Invalid = -1, Null, Safety };
|
||||||
typedef enum : int16 {
|
|
||||||
TypePossessions = 0,
|
|
||||||
TypeBank,
|
|
||||||
TypeSharedBank,
|
|
||||||
TypeTrade,
|
|
||||||
TypeWorld,
|
|
||||||
TypeLimbo,
|
|
||||||
TypeTribute,
|
|
||||||
TypeTrophyTribute,
|
|
||||||
TypeGuildTribute,
|
|
||||||
TypeMerchant,
|
|
||||||
TypeDeleted,
|
|
||||||
TypeCorpse,
|
|
||||||
TypeBazaar,
|
|
||||||
TypeInspect,
|
|
||||||
TypeRealEstate,
|
|
||||||
TypeViewMODPC,
|
|
||||||
TypeViewMODBank,
|
|
||||||
TypeViewMODSharedBank,
|
|
||||||
TypeViewMODLimbo,
|
|
||||||
TypeAltStorage,
|
|
||||||
TypeArchived,
|
|
||||||
TypeMail,
|
|
||||||
TypeGuildTrophyTribute,
|
|
||||||
TypeOther,
|
|
||||||
TypeCount
|
|
||||||
} InventoryTypes;
|
|
||||||
|
|
||||||
typedef enum : int16 {
|
enum : bool { False = false, True = true };
|
||||||
SlotCharm = 0,
|
|
||||||
SlotEar1,
|
|
||||||
SlotHead,
|
|
||||||
SlotFace,
|
|
||||||
SlotEar2,
|
|
||||||
SlotNeck,
|
|
||||||
SlotShoulders,
|
|
||||||
SlotArms,
|
|
||||||
SlotBack,
|
|
||||||
SlotWrist1,
|
|
||||||
SlotWrist2,
|
|
||||||
SlotRange,
|
|
||||||
SlotHands,
|
|
||||||
SlotPrimary,
|
|
||||||
SlotSecondary,
|
|
||||||
SlotFinger1,
|
|
||||||
SlotFinger2,
|
|
||||||
SlotChest,
|
|
||||||
SlotLegs,
|
|
||||||
SlotFeet,
|
|
||||||
SlotWaist,
|
|
||||||
SlotPowerSource,
|
|
||||||
SlotAmmo,
|
|
||||||
SlotGeneral1,
|
|
||||||
SlotGeneral2,
|
|
||||||
SlotGeneral3,
|
|
||||||
SlotGeneral4,
|
|
||||||
SlotGeneral5,
|
|
||||||
SlotGeneral6,
|
|
||||||
SlotGeneral7,
|
|
||||||
SlotGeneral8,
|
|
||||||
SlotGeneral9,
|
|
||||||
SlotGeneral10,
|
|
||||||
SlotCursor,
|
|
||||||
SlotCount,
|
|
||||||
SlotEquipmentBegin = SlotCharm,
|
|
||||||
SlotEquipmentEnd = SlotAmmo,
|
|
||||||
SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1),
|
|
||||||
SlotGeneralBegin = SlotGeneral1,
|
|
||||||
SlotGeneralEnd = SlotGeneral10,
|
|
||||||
SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1)
|
|
||||||
} PossessionsSlots;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace consts {
|
// pre-declarations
|
||||||
static const size_t CHARACTER_CREATION_LIMIT = 12;
|
namespace invtype {
|
||||||
|
inline EQEmu::versions::ClientVersion InvTypeRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
static const uint16 TYPE_POSSESSIONS_SIZE = inventory::SlotCount;
|
enum : int { InvTypeInvalid = -1, InvTypeBegin };
|
||||||
static const uint16 TYPE_BANK_SIZE = 24;
|
|
||||||
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
|
|
||||||
static const uint16 TYPE_TRADE_SIZE = 8;
|
|
||||||
static const uint16 TYPE_WORLD_SIZE = 10;
|
|
||||||
static const uint16 TYPE_LIMBO_SIZE = 36;
|
|
||||||
static const uint16 TYPE_TRIBUTE_SIZE = 0; //?
|
|
||||||
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_MERCHANT_SIZE = 0;
|
|
||||||
static const uint16 TYPE_DELETED_SIZE = 0;
|
|
||||||
static const uint16 TYPE_CORPSE_SIZE = inventory::SlotCount;
|
|
||||||
static const uint16 TYPE_BAZAAR_SIZE = 200;
|
|
||||||
static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount;
|
|
||||||
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE;
|
|
||||||
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_ARCHIVED_SIZE = 0;
|
|
||||||
static const uint16 TYPE_MAIL_SIZE = 0;
|
|
||||||
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_KRONO_SIZE = NOT_USED;
|
|
||||||
static const uint16 TYPE_OTHER_SIZE = 0;
|
|
||||||
|
|
||||||
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
|
enum InventoryType : int {
|
||||||
// (bag slots and main slots beyond Possessions are assigned for compatibility with current server coding)
|
InvTypePossessions = InvTypeBegin,
|
||||||
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
|
InvTypeBank,
|
||||||
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
|
InvTypeSharedBank,
|
||||||
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
|
InvTypeTrade,
|
||||||
|
InvTypeWorld,
|
||||||
|
InvTypeLimbo,
|
||||||
|
InvTypeTribute,
|
||||||
|
InvTypeTrophyTribute,
|
||||||
|
InvTypeGuildTribute,
|
||||||
|
InvTypeMerchant,
|
||||||
|
InvTypeDeleted,
|
||||||
|
InvTypeCorpse,
|
||||||
|
InvTypeBazaar,
|
||||||
|
InvTypeInspect,
|
||||||
|
InvTypeRealEstate,
|
||||||
|
InvTypeViewMODPC,
|
||||||
|
InvTypeViewMODBank,
|
||||||
|
InvTypeViewMODSharedBank,
|
||||||
|
InvTypeViewMODLimbo,
|
||||||
|
InvTypeAltStorage,
|
||||||
|
InvTypeArchived,
|
||||||
|
InvTypeMail,
|
||||||
|
InvTypeGuildTrophyTribute,
|
||||||
|
InvTypeOther,
|
||||||
|
InvTypeCount
|
||||||
|
};
|
||||||
|
|
||||||
static const int16 GENERAL_BEGIN = inventory::SlotGeneral1;
|
} /*invtype*/
|
||||||
static const int16 GENERAL_END = inventory::SlotGeneral10;
|
|
||||||
static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount;
|
|
||||||
static const int16 GENERAL_BAGS_BEGIN = 251;
|
|
||||||
static const int16 GENERAL_BAGS_END_OFFSET = 99;
|
|
||||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 CURSOR = inventory::SlotCursor;
|
namespace invslot {
|
||||||
static const int16 CURSOR_BAG_BEGIN = 351;
|
inline EQEmu::versions::ClientVersion InvSlotRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
|
||||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 BANK_BEGIN = 2000;
|
enum : int { InvSlotInvalid = -1, InvSlotBegin };
|
||||||
static const int16 BANK_END = 2023;
|
|
||||||
static const int16 BANK_BAGS_BEGIN = 2031;
|
|
||||||
static const int16 BANK_BAGS_END_OFFSET = 239;
|
|
||||||
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 SHARED_BANK_BEGIN = 2500;
|
enum PossessionsSlot : int {
|
||||||
static const int16 SHARED_BANK_END = 2501;
|
PossessionsCharm = InvSlotBegin,
|
||||||
static const int16 SHARED_BANK_BAGS_BEGIN = 2531;
|
PossessionsEar1,
|
||||||
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
|
PossessionsHead,
|
||||||
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
|
PossessionsFace,
|
||||||
|
PossessionsEar2,
|
||||||
|
PossessionsNeck,
|
||||||
|
PossessionsShoulders,
|
||||||
|
PossessionsArms,
|
||||||
|
PossessionsBack,
|
||||||
|
PossessionsWrist1,
|
||||||
|
PossessionsWrist2,
|
||||||
|
PossessionsRange,
|
||||||
|
PossessionsHands,
|
||||||
|
PossessionsPrimary,
|
||||||
|
PossessionsSecondary,
|
||||||
|
PossessionsFinger1,
|
||||||
|
PossessionsFinger2,
|
||||||
|
PossessionsChest,
|
||||||
|
PossessionsLegs,
|
||||||
|
PossessionsFeet,
|
||||||
|
PossessionsWaist,
|
||||||
|
PossessionsPowerSource,
|
||||||
|
PossessionsAmmo,
|
||||||
|
PossessionsGeneral1,
|
||||||
|
PossessionsGeneral2,
|
||||||
|
PossessionsGeneral3,
|
||||||
|
PossessionsGeneral4,
|
||||||
|
PossessionsGeneral5,
|
||||||
|
PossessionsGeneral6,
|
||||||
|
PossessionsGeneral7,
|
||||||
|
PossessionsGeneral8,
|
||||||
|
PossessionsGeneral9,
|
||||||
|
PossessionsGeneral10,
|
||||||
|
PossessionsCursor,
|
||||||
|
PossessionsCount
|
||||||
|
};
|
||||||
|
|
||||||
static const int16 TRADE_BEGIN = 3000;
|
const int EquipmentBegin = PossessionsCharm;
|
||||||
static const int16 TRADE_END = 3007;
|
const int EquipmentEnd = PossessionsAmmo;
|
||||||
static const int16 TRADE_NPC_END = 3003;
|
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
|
||||||
static const int16 TRADE_BAGS_BEGIN = 3031;
|
|
||||||
static const int16 TRADE_BAGS_END_OFFSET = 79;
|
|
||||||
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 WORLD_BEGIN = 4000;
|
const int GeneralBegin = PossessionsGeneral1;
|
||||||
static const int16 WORLD_END = 4009;
|
const int GeneralEnd = PossessionsGeneral10;
|
||||||
|
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
|
||||||
|
|
||||||
static const int16 TRIBUTE_BEGIN = 400;
|
} /*invslot*/
|
||||||
static const int16 TRIBUTE_END = 404;
|
|
||||||
|
|
||||||
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
|
namespace invbag {
|
||||||
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
|
inline EQEmu::versions::ClientVersion InvBagRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
static const uint16 ITEM_COMMON_SIZE = 6;
|
enum : int { InvBagInvalid = -1, InvBagBegin };
|
||||||
static const uint16 ITEM_CONTAINER_SIZE = 255; // 255; (server max will be 255..unsure what actual client is - test)
|
|
||||||
|
|
||||||
static const size_t BANDOLIERS_SIZE = 20; // number of bandolier instances
|
} /*invbag*/
|
||||||
static const size_t BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
|
||||||
|
|
||||||
static const size_t POTION_BELT_ITEM_COUNT = 5;
|
namespace invaug {
|
||||||
|
inline EQEmu::versions::ClientVersion InvAugRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
static const size_t TEXT_LINK_BODY_LENGTH = 55;
|
enum : int { InvAugInvalid = -1, InvAugBegin };
|
||||||
|
|
||||||
static const size_t PLAYER_PROFILE_SKILL_MAX = SkillTripleAttack;
|
} /*invaug*/
|
||||||
}
|
|
||||||
|
|
||||||
namespace limits {
|
namespace item {
|
||||||
static const bool ALLOWS_EMPTY_BAG_IN_BAG = true;
|
inline EQEmu::versions::ClientVersion ItemRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||||
static const bool ALLOWS_CLICK_CAST_FROM_BAG = true;
|
|
||||||
static const bool COIN_HAS_WEIGHT = false;
|
enum ItemPacketType : int {
|
||||||
}
|
ItemPacketMerchant = 100,
|
||||||
|
ItemPacketTradeView = 101,
|
||||||
|
ItemPacketLoot = 102,
|
||||||
|
ItemPacketTrade = 103,
|
||||||
|
ItemPacketCharInventory = 105,
|
||||||
|
ItemPacketLimbo = 106,
|
||||||
|
ItemPacketWorldContainer = 107,
|
||||||
|
ItemPacketTributeItem = 108,
|
||||||
|
ItemPacketGuildTribute = 109,
|
||||||
|
ItemPacket10 = 110,
|
||||||
|
ItemPacket11 = 111,
|
||||||
|
ItemPacket12 = 112,
|
||||||
|
ItemPacketRecovery = 113,
|
||||||
|
ItemPacket14 = 115
|
||||||
|
};
|
||||||
|
|
||||||
|
} /*item*/
|
||||||
|
|
||||||
|
namespace profile {
|
||||||
|
inline EQEmu::versions::ClientVersion ProfileRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
|
} /*profile*/
|
||||||
|
|
||||||
|
namespace constants {
|
||||||
|
inline EQEmu::versions::ClientVersion ConstantsRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
|
} /*constants*/
|
||||||
|
|
||||||
|
namespace behavior {
|
||||||
|
inline EQEmu::versions::ClientVersion BehaviorRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
|
} /*behavior*/
|
||||||
|
|
||||||
|
namespace skills {
|
||||||
|
inline EQEmu::versions::ClientVersion SkillsRef() { return EQEmu::versions::ClientVersion::RoF; }
|
||||||
|
|
||||||
|
} /*skills*/
|
||||||
|
|
||||||
|
|
||||||
|
// declarations
|
||||||
|
namespace invtype {
|
||||||
|
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
|
||||||
|
const size_t InvTypeBankSize = 24;
|
||||||
|
const size_t InvTypeSharedBankSize = 2;
|
||||||
|
const size_t InvTypeTradeSize = 8;
|
||||||
|
const size_t InvTypeWorldSize = 10;
|
||||||
|
const size_t InvTypeLimboSize = 36;
|
||||||
|
const size_t InvTypeTributeSize = 5;
|
||||||
|
const size_t InvTypeTrophyTributeSize = 0;//unknown
|
||||||
|
const size_t InvTypeGuildTributeSize = 0;//unknown
|
||||||
|
const size_t InvTypeMerchantSize = 200;
|
||||||
|
const size_t InvTypeDeletedSize = 0;//unknown - "Recovery Tab"
|
||||||
|
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
|
||||||
|
const size_t InvTypeBazaarSize = 200;
|
||||||
|
const size_t InvTypeInspectSize = invslot::EquipmentCount;
|
||||||
|
const size_t InvTypeRealEstateSize = 0;//unknown
|
||||||
|
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
|
||||||
|
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
|
||||||
|
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
|
||||||
|
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
|
||||||
|
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
|
||||||
|
const size_t InvTypeArchivedSize = 0;//unknown
|
||||||
|
const size_t InvTypeMailSize = 0;//unknown
|
||||||
|
const size_t InvTypeGuildTrophyTributeSize = 0;//unknown
|
||||||
|
const size_t InvTypeOtherSize = 0;//unknown
|
||||||
|
|
||||||
|
const size_t NPCTradeSize = 4;
|
||||||
|
|
||||||
|
extern size_t InvTypeSize(int inv_type);
|
||||||
|
extern const char* InvTypeName(int inv_type);
|
||||||
|
|
||||||
|
} /*invtype*/
|
||||||
|
|
||||||
|
namespace invslot {
|
||||||
|
extern const char* InvPossessionsSlotName(int inv_slot);
|
||||||
|
extern const char* InvSlotName(int inv_type, int inv_slot);
|
||||||
|
|
||||||
|
} /*invslot*/
|
||||||
|
|
||||||
|
namespace invbag {
|
||||||
|
const size_t ItemBagSize = 255; // server Size will be 255..unsure what actual client is (test)
|
||||||
|
|
||||||
|
extern const char* InvBagIndexName(int bag_index);
|
||||||
|
|
||||||
|
} /*invbag*/
|
||||||
|
|
||||||
|
namespace invaug {
|
||||||
|
const size_t ItemAugSize = 6;
|
||||||
|
|
||||||
|
extern const char* InvAugIndexName(int aug_index);
|
||||||
|
|
||||||
|
} /*invaug*/
|
||||||
|
|
||||||
|
namespace item {
|
||||||
|
|
||||||
|
} /*item*/
|
||||||
|
|
||||||
|
namespace profile {
|
||||||
|
const size_t TributeSize = invtype::InvTypeTributeSize;
|
||||||
|
|
||||||
|
const size_t BandoliersSize = 20; // number of bandolier instances
|
||||||
|
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
|
||||||
|
|
||||||
|
const size_t PotionBeltSize = 5;
|
||||||
|
|
||||||
|
const size_t SkillArraySize = 100;
|
||||||
|
|
||||||
|
} /*profile*/
|
||||||
|
|
||||||
|
namespace constants {
|
||||||
|
const size_t CharacterCreationLimit = 12;
|
||||||
|
|
||||||
|
const size_t SayLinkBodySize = 55;
|
||||||
|
|
||||||
|
} /*constants*/
|
||||||
|
|
||||||
|
namespace behavior {
|
||||||
|
const bool ConcatenateInvTypeLimbo = false;
|
||||||
|
|
||||||
|
const bool AllowOverLevelEquipment = true;
|
||||||
|
|
||||||
|
const bool AllowEmptyBagInBag = true;
|
||||||
|
const bool AllowClickCastFromBag = true;
|
||||||
|
|
||||||
|
const bool CoinHasWeight = false;
|
||||||
|
|
||||||
|
} /*behavior*/
|
||||||
|
|
||||||
|
namespace skills {
|
||||||
|
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
|
||||||
|
|
||||||
|
} /*skills*/
|
||||||
|
|
||||||
}; /*RoF*/
|
}; /*RoF*/
|
||||||
|
|
||||||
#endif /*COMMON_ROF_CONSTANTS_H*/
|
#endif /*COMMON_ROF_LIMITS_H*/
|
||||||
|
|||||||
@ -931,13 +931,13 @@ struct BandolierItem_Struct_Old
|
|||||||
struct Bandolier_Struct
|
struct Bandolier_Struct
|
||||||
{
|
{
|
||||||
char Name[1]; // Variable Length
|
char Name[1]; // Variable Length
|
||||||
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
|
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Bandolier_Struct_Old
|
struct Bandolier_Struct_Old
|
||||||
{
|
{
|
||||||
char Name[32];
|
char Name[32];
|
||||||
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
|
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PotionBeltItem_Struct
|
struct PotionBeltItem_Struct
|
||||||
@ -957,12 +957,12 @@ struct PotionBeltItem_Struct_Old
|
|||||||
|
|
||||||
struct PotionBelt_Struct
|
struct PotionBelt_Struct
|
||||||
{
|
{
|
||||||
PotionBeltItem_Struct Items[consts::POTION_BELT_ITEM_COUNT];
|
PotionBeltItem_Struct Items[profile::PotionBeltSize];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PotionBelt_Struct_Old
|
struct PotionBelt_Struct_Old
|
||||||
{
|
{
|
||||||
PotionBeltItem_Struct_Old Items[consts::POTION_BELT_ITEM_COUNT];
|
PotionBeltItem_Struct_Old Items[profile::PotionBeltSize];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GroupLeadershipAA_Struct {
|
struct GroupLeadershipAA_Struct {
|
||||||
@ -1172,7 +1172,7 @@ union
|
|||||||
/*12949*/ uint32 aapoints; // Unspent AA points - Seen 1
|
/*12949*/ uint32 aapoints; // Unspent AA points - Seen 1
|
||||||
/*12953*/ uint16 unknown_rof20; //
|
/*12953*/ uint16 unknown_rof20; //
|
||||||
/*12955*/ uint32 bandolier_count; // Seen 20
|
/*12955*/ uint32 bandolier_count; // Seen 20
|
||||||
/*12959*/ Bandolier_Struct bandoliers[consts::BANDOLIERS_SIZE]; // [20] 740 bytes (Variable Name Sizes) - bandolier contents
|
/*12959*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // [20] 740 bytes (Variable Name Sizes) - bandolier contents
|
||||||
/*13699*/ uint32 potionbelt_count; // Seen 5
|
/*13699*/ uint32 potionbelt_count; // Seen 5
|
||||||
/*13703*/ PotionBelt_Struct potionbelt; // [5] 45 bytes potion belt - (Variable Name Sizes)
|
/*13703*/ PotionBelt_Struct potionbelt; // [5] 45 bytes potion belt - (Variable Name Sizes)
|
||||||
/*13748*/ int32 unknown_rof21; // Seen -1
|
/*13748*/ int32 unknown_rof21; // Seen -1
|
||||||
|
|||||||
@ -1623,18 +1623,18 @@ namespace SoD
|
|||||||
// OUT(unknown06160[4]);
|
// OUT(unknown06160[4]);
|
||||||
|
|
||||||
// Copy bandoliers where server and client indexes converge
|
// Copy bandoliers where server and client indexes converge
|
||||||
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++r) {
|
||||||
OUT_str(bandoliers[r].Name);
|
OUT_str(bandoliers[r].Name);
|
||||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||||
OUT(bandoliers[r].Items[k].ID);
|
OUT(bandoliers[r].Items[k].ID);
|
||||||
OUT(bandoliers[r].Items[k].Icon);
|
OUT(bandoliers[r].Items[k].Icon);
|
||||||
OUT_str(bandoliers[r].Items[k].Name);
|
OUT_str(bandoliers[r].Items[k].Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||||
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++r) {
|
||||||
eq->bandoliers[r].Name[0] = '\0';
|
eq->bandoliers[r].Name[0] = '\0';
|
||||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||||
eq->bandoliers[r].Items[k].ID = 0;
|
eq->bandoliers[r].Items[k].ID = 0;
|
||||||
eq->bandoliers[r].Items[k].Icon = 0;
|
eq->bandoliers[r].Items[k].Icon = 0;
|
||||||
eq->bandoliers[r].Items[k].Name[0] = '\0';
|
eq->bandoliers[r].Items[k].Name[0] = '\0';
|
||||||
@ -1644,13 +1644,13 @@ namespace SoD
|
|||||||
// OUT(unknown07444[5120]);
|
// OUT(unknown07444[5120]);
|
||||||
|
|
||||||
// Copy potion belt where server and client indexes converge
|
// Copy potion belt where server and client indexes converge
|
||||||
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
|
||||||
OUT(potionbelt.Items[r].ID);
|
OUT(potionbelt.Items[r].ID);
|
||||||
OUT(potionbelt.Items[r].Icon);
|
OUT(potionbelt.Items[r].Icon);
|
||||||
OUT_str(potionbelt.Items[r].Name);
|
OUT_str(potionbelt.Items[r].Name);
|
||||||
}
|
}
|
||||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||||
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
|
||||||
eq->potionbelt.Items[r].ID = 0;
|
eq->potionbelt.Items[r].ID = 0;
|
||||||
eq->potionbelt.Items[r].Icon = 0;
|
eq->potionbelt.Items[r].Icon = 0;
|
||||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||||
@ -1938,8 +1938,8 @@ namespace SoD
|
|||||||
eq->CharCount = emu->CharCount;
|
eq->CharCount = emu->CharCount;
|
||||||
eq->TotalChars = emu->TotalChars;
|
eq->TotalChars = emu->TotalChars;
|
||||||
|
|
||||||
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
|
if (eq->TotalChars > constants::CharacterCreationLimit)
|
||||||
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
|
eq->TotalChars = constants::CharacterCreationLimit;
|
||||||
|
|
||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
return;
|
return;
|
||||||
@ -1951,7 +1951,7 @@ namespace SoD
|
|||||||
|
|
||||||
size_t names_length = 0;
|
size_t names_length = 0;
|
||||||
size_t character_count = 0;
|
size_t character_count = 0;
|
||||||
for (; character_count < emu->CharCount && character_count < consts::CHARACTER_CREATION_LIMIT; ++character_count) {
|
for (; character_count < emu->CharCount && character_count < constants::CharacterCreationLimit; ++character_count) {
|
||||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||||
names_length += strlen(emu_cse->Name);
|
names_length += strlen(emu_cse->Name);
|
||||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||||
@ -1967,8 +1967,8 @@ namespace SoD
|
|||||||
eq->CharCount = character_count;
|
eq->CharCount = character_count;
|
||||||
eq->TotalChars = emu->TotalChars;
|
eq->TotalChars = emu->TotalChars;
|
||||||
|
|
||||||
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
|
if (eq->TotalChars > constants::CharacterCreationLimit)
|
||||||
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
|
eq->TotalChars = constants::CharacterCreationLimit;
|
||||||
|
|
||||||
emu_ptr = __emu_buffer;
|
emu_ptr = __emu_buffer;
|
||||||
emu_ptr += sizeof(CharacterSelect_Struct);
|
emu_ptr += sizeof(CharacterSelect_Struct);
|
||||||
@ -3706,7 +3706,7 @@ namespace SoD
|
|||||||
isbs.augtype = item->AugType;
|
isbs.augtype = item->AugType;
|
||||||
isbs.augrestrict = item->AugRestrict;
|
isbs.augrestrict = item->AugRestrict;
|
||||||
|
|
||||||
for (int index = 0; index < consts::ITEM_COMMON_SIZE; ++index) {
|
for (int index = 0; index < invaug::ItemAugSize; ++index) {
|
||||||
isbs.augslots[index].type = item->AugSlotType[index];
|
isbs.augslots[index].type = item->AugSlotType[index];
|
||||||
isbs.augslots[index].visible = item->AugSlotVisible[index];
|
isbs.augslots[index].visible = item->AugSlotVisible[index];
|
||||||
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
|
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
|
||||||
@ -3917,7 +3917,7 @@ namespace SoD
|
|||||||
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
|
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
|
||||||
SoDSlot = serverSlot + 1;
|
SoDSlot = serverSlot + 1;
|
||||||
else if (serverSlot == EQEmu::legacy::SlotPowerSource)
|
else if (serverSlot == EQEmu::legacy::SlotPowerSource)
|
||||||
SoDSlot = inventory::SlotPowerSource;
|
SoDSlot = invslot::PossessionsPowerSource;
|
||||||
else
|
else
|
||||||
SoDSlot = serverSlot;
|
SoDSlot = serverSlot;
|
||||||
return SoDSlot;
|
return SoDSlot;
|
||||||
@ -3933,15 +3933,15 @@ namespace SoD
|
|||||||
{
|
{
|
||||||
uint32 ServerSlot = 0;
|
uint32 ServerSlot = 0;
|
||||||
|
|
||||||
if (sodSlot >= inventory::SlotAmmo && sodSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
if (sodSlot >= invslot::PossessionsAmmo && sodSlot <= invslot::CorpseEnd) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||||
ServerSlot = sodSlot - 1;
|
ServerSlot = sodSlot - 1;
|
||||||
else if (sodSlot >= consts::GENERAL_BAGS_BEGIN && sodSlot <= consts::CURSOR_BAG_END)
|
else if (sodSlot >= invbag::GeneralBagsBegin && sodSlot <= invbag::CursorBagEnd)
|
||||||
ServerSlot = sodSlot - 11;
|
ServerSlot = sodSlot - 11;
|
||||||
else if (sodSlot >= consts::BANK_BAGS_BEGIN && sodSlot <= consts::BANK_BAGS_END)
|
else if (sodSlot >= invbag::BankBagsBegin && sodSlot <= invbag::BankBagsEnd)
|
||||||
ServerSlot = sodSlot - 1;
|
ServerSlot = sodSlot - 1;
|
||||||
else if (sodSlot >= consts::SHARED_BANK_BAGS_BEGIN && sodSlot <= consts::SHARED_BANK_BAGS_END)
|
else if (sodSlot >= invbag::SharedBankBagsBegin && sodSlot <= invbag::SharedBankBagsEnd)
|
||||||
ServerSlot = sodSlot - 1;
|
ServerSlot = sodSlot - 1;
|
||||||
else if (sodSlot == inventory::SlotPowerSource)
|
else if (sodSlot == invslot::PossessionsPowerSource)
|
||||||
ServerSlot = EQEmu::legacy::SlotPowerSource;
|
ServerSlot = EQEmu::legacy::SlotPowerSource;
|
||||||
else
|
else
|
||||||
ServerSlot = sodSlot;
|
ServerSlot = sodSlot;
|
||||||
@ -3956,7 +3956,7 @@ namespace SoD
|
|||||||
|
|
||||||
static inline void ServerToSoDTextLink(std::string& sodTextLink, const std::string& serverTextLink)
|
static inline void ServerToSoDTextLink(std::string& sodTextLink, const std::string& serverTextLink)
|
||||||
{
|
{
|
||||||
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||||
sodTextLink = serverTextLink;
|
sodTextLink = serverTextLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3996,7 +3996,7 @@ namespace SoD
|
|||||||
|
|
||||||
static inline void SoDToServerTextLink(std::string& serverTextLink, const std::string& sodTextLink)
|
static inline void SoDToServerTextLink(std::string& serverTextLink, const std::string& sodTextLink)
|
||||||
{
|
{
|
||||||
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sodTextLink.find('\x12') == std::string::npos)) {
|
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (sodTextLink.find('\x12') == std::string::npos)) {
|
||||||
serverTextLink = sodTextLink;
|
serverTextLink = sodTextLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4005,7 +4005,7 @@ namespace SoD
|
|||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
if (segments[segment_iter].length() <= consts::TEXT_LINK_BODY_LENGTH) {
|
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
|
||||||
serverTextLink.append(segments[segment_iter]);
|
serverTextLink.append(segments[segment_iter]);
|
||||||
// TODO: log size mismatch error
|
// TODO: log size mismatch error
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -16,3 +16,240 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "sod_limits.h"
|
||||||
|
|
||||||
|
#include "../string_util.h"
|
||||||
|
|
||||||
|
|
||||||
|
size_t SoD::invtype::InvTypeSize(int inv_type)
|
||||||
|
{
|
||||||
|
switch (inv_type) {
|
||||||
|
case invtype::InvTypePossessions:
|
||||||
|
return invtype::InvTypePossessionsSize;
|
||||||
|
case invtype::InvTypeBank:
|
||||||
|
return invtype::InvTypeBankSize;
|
||||||
|
case invtype::InvTypeSharedBank:
|
||||||
|
return invtype::InvTypeSharedBankSize;
|
||||||
|
case invtype::InvTypeTrade:
|
||||||
|
return invtype::InvTypeTradeSize;
|
||||||
|
case invtype::InvTypeWorld:
|
||||||
|
return invtype::InvTypeWorldSize;
|
||||||
|
case invtype::InvTypeLimbo:
|
||||||
|
return invtype::InvTypeLimboSize;
|
||||||
|
case invtype::InvTypeTribute:
|
||||||
|
return invtype::InvTypeTributeSize;
|
||||||
|
case invtype::InvTypeGuildTribute:
|
||||||
|
return invtype::InvTypeGuildTributeSize;
|
||||||
|
case invtype::InvTypeMerchant:
|
||||||
|
return invtype::InvTypeMerchantSize;
|
||||||
|
case invtype::InvTypeCorpse:
|
||||||
|
return invtype::InvTypeCorpseSize;
|
||||||
|
case invtype::InvTypeBazaar:
|
||||||
|
return invtype::InvTypeBazaarSize;
|
||||||
|
case invtype::InvTypeInspect:
|
||||||
|
return invtype::InvTypeInspectSize;
|
||||||
|
case invtype::InvTypeViewMODPC:
|
||||||
|
return invtype::InvTypeViewMODPCSize;
|
||||||
|
case invtype::InvTypeViewMODBank:
|
||||||
|
return invtype::InvTypeViewMODBankSize;
|
||||||
|
case invtype::InvTypeViewMODSharedBank:
|
||||||
|
return invtype::InvTypeViewMODSharedBankSize;
|
||||||
|
case invtype::InvTypeViewMODLimbo:
|
||||||
|
return invtype::InvTypeViewMODLimboSize;
|
||||||
|
case invtype::InvTypeAltStorage:
|
||||||
|
return invtype::InvTypeAltStorageSize;
|
||||||
|
case invtype::InvTypeArchived:
|
||||||
|
return invtype::InvTypeArchivedSize;
|
||||||
|
case invtype::InvTypeOther:
|
||||||
|
return invtype::InvTypeOtherSize;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* SoD::invtype::InvTypeName(int inv_type)
|
||||||
|
{
|
||||||
|
switch (inv_type) {
|
||||||
|
case invtype::InvTypeInvalid:
|
||||||
|
return "Invalid Type";
|
||||||
|
case invtype::InvTypePossessions:
|
||||||
|
return "Possessions";
|
||||||
|
case invtype::InvTypeBank:
|
||||||
|
return "Bank";
|
||||||
|
case invtype::InvTypeSharedBank:
|
||||||
|
return "Shared Bank";
|
||||||
|
case invtype::InvTypeTrade:
|
||||||
|
return "Trade";
|
||||||
|
case invtype::InvTypeWorld:
|
||||||
|
return "World";
|
||||||
|
case invtype::InvTypeLimbo:
|
||||||
|
return "Limbo";
|
||||||
|
case invtype::InvTypeTribute:
|
||||||
|
return "Tribute";
|
||||||
|
case invtype::InvTypeGuildTribute:
|
||||||
|
return "Guild Tribute";
|
||||||
|
case invtype::InvTypeMerchant:
|
||||||
|
return "Merchant";
|
||||||
|
case invtype::InvTypeCorpse:
|
||||||
|
return "Corpse";
|
||||||
|
case invtype::InvTypeBazaar:
|
||||||
|
return "Bazaar";
|
||||||
|
case invtype::InvTypeInspect:
|
||||||
|
return "Inspect";
|
||||||
|
case invtype::InvTypeViewMODPC:
|
||||||
|
return "View MOD PC";
|
||||||
|
case invtype::InvTypeViewMODBank:
|
||||||
|
return "View MOD Bank";
|
||||||
|
case invtype::InvTypeViewMODSharedBank:
|
||||||
|
return "View MOD Shared Bank";
|
||||||
|
case invtype::InvTypeViewMODLimbo:
|
||||||
|
return "View MOD Limbo";
|
||||||
|
case invtype::InvTypeAltStorage:
|
||||||
|
return "Alt Storage";
|
||||||
|
case invtype::InvTypeArchived:
|
||||||
|
return "Archived";
|
||||||
|
case invtype::InvTypeOther:
|
||||||
|
return "Other";
|
||||||
|
default:
|
||||||
|
return "Unknown Type";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* SoD::invslot::InvPossessionsSlotName(int inv_slot)
|
||||||
|
{
|
||||||
|
switch (inv_slot) {
|
||||||
|
case invslot::InvSlotInvalid:
|
||||||
|
return "Invalid Slot";
|
||||||
|
case invslot::PossessionsCharm:
|
||||||
|
return "Charm";
|
||||||
|
case invslot::PossessionsEar1:
|
||||||
|
return "Ear 1";
|
||||||
|
case invslot::PossessionsHead:
|
||||||
|
return "Head";
|
||||||
|
case invslot::PossessionsFace:
|
||||||
|
return "Face";
|
||||||
|
case invslot::PossessionsEar2:
|
||||||
|
return "Ear 2";
|
||||||
|
case invslot::PossessionsNeck:
|
||||||
|
return "Neck";
|
||||||
|
case invslot::PossessionsShoulders:
|
||||||
|
return "Shoulders";
|
||||||
|
case invslot::PossessionsArms:
|
||||||
|
return "Arms";
|
||||||
|
case invslot::PossessionsBack:
|
||||||
|
return "Back";
|
||||||
|
case invslot::PossessionsWrist1:
|
||||||
|
return "Wrist 1";
|
||||||
|
case invslot::PossessionsWrist2:
|
||||||
|
return "Wrist 2";
|
||||||
|
case invslot::PossessionsRange:
|
||||||
|
return "Range";
|
||||||
|
case invslot::PossessionsHands:
|
||||||
|
return "Hands";
|
||||||
|
case invslot::PossessionsPrimary:
|
||||||
|
return "Primary";
|
||||||
|
case invslot::PossessionsSecondary:
|
||||||
|
return "Secondary";
|
||||||
|
case invslot::PossessionsFinger1:
|
||||||
|
return "Finger 1";
|
||||||
|
case invslot::PossessionsFinger2:
|
||||||
|
return "Finger 2";
|
||||||
|
case invslot::PossessionsChest:
|
||||||
|
return "Chest";
|
||||||
|
case invslot::PossessionsLegs:
|
||||||
|
return "Legs";
|
||||||
|
case invslot::PossessionsFeet:
|
||||||
|
return "Feet";
|
||||||
|
case invslot::PossessionsWaist:
|
||||||
|
return "Waist";
|
||||||
|
case invslot::PossessionsPowerSource:
|
||||||
|
return "Power Source";
|
||||||
|
case invslot::PossessionsAmmo:
|
||||||
|
return "Ammo";
|
||||||
|
case invslot::PossessionsGeneral1:
|
||||||
|
return "General 1";
|
||||||
|
case invslot::PossessionsGeneral2:
|
||||||
|
return "General 2";
|
||||||
|
case invslot::PossessionsGeneral3:
|
||||||
|
return "General 3";
|
||||||
|
case invslot::PossessionsGeneral4:
|
||||||
|
return "General 4";
|
||||||
|
case invslot::PossessionsGeneral5:
|
||||||
|
return "General 5";
|
||||||
|
case invslot::PossessionsGeneral6:
|
||||||
|
return "General 6";
|
||||||
|
case invslot::PossessionsGeneral7:
|
||||||
|
return "General 7";
|
||||||
|
case invslot::PossessionsGeneral8:
|
||||||
|
return "General 8";
|
||||||
|
case invslot::PossessionsCursor:
|
||||||
|
return "Cursor";
|
||||||
|
default:
|
||||||
|
return "Unknown Slot";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* SoD::invslot::InvCorpseSlotName(int inv_slot)
|
||||||
|
{
|
||||||
|
if (!invtype::InvTypeSize(invtype::InvTypeCorpse) || inv_slot == invslot::InvSlotInvalid)
|
||||||
|
return "Invalid Slot";
|
||||||
|
|
||||||
|
// needs work
|
||||||
|
if ((size_t)(inv_slot + 1) < invslot::CorpseBegin || (size_t)(inv_slot + 1) >= invslot::CorpseEnd)
|
||||||
|
return "Unknown Slot";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Slot %i", (inv_slot + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* SoD::invslot::InvSlotName(int inv_type, int inv_slot)
|
||||||
|
{
|
||||||
|
if (inv_type == invtype::InvTypePossessions)
|
||||||
|
return invslot::InvPossessionsSlotName(inv_slot);
|
||||||
|
else if (inv_type == invtype::InvTypeCorpse)
|
||||||
|
return invslot::InvCorpseSlotName(inv_slot);
|
||||||
|
|
||||||
|
size_t type_size = invtype::InvTypeSize(inv_type);
|
||||||
|
|
||||||
|
if (!type_size || inv_slot == invslot::InvSlotInvalid)
|
||||||
|
return "Invalid Slot";
|
||||||
|
|
||||||
|
if ((size_t)(inv_slot + 1) >= type_size)
|
||||||
|
return "Unknown Slot";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Slot %i", (inv_slot + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* SoD::invbag::InvBagIndexName(int bag_index)
|
||||||
|
{
|
||||||
|
if (bag_index == invbag::InvBagInvalid)
|
||||||
|
return "Invalid Bag";
|
||||||
|
|
||||||
|
if ((size_t)bag_index >= invbag::ItemBagSize)
|
||||||
|
return "Unknown Bag";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Bag %i", (bag_index + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* SoD::invaug::InvAugIndexName(int aug_index)
|
||||||
|
{
|
||||||
|
if (aug_index == invaug::InvAugInvalid)
|
||||||
|
return "Invalid Augment";
|
||||||
|
|
||||||
|
if ((size_t)aug_index >= invaug::ItemAugSize)
|
||||||
|
return "Unknown Augment";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Augment %i", (aug_index + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|||||||
@ -17,178 +17,284 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef COMMON_SOD_CONSTANTS_H
|
#ifndef COMMON_SOD_LIMITS_H
|
||||||
#define COMMON_SOD_CONSTANTS_H
|
#define COMMON_SOD_LIMITS_H
|
||||||
|
|
||||||
#include "../types.h"
|
#include "../types.h"
|
||||||
|
#include "../client_version.h"
|
||||||
|
#include "../skills.h"
|
||||||
|
|
||||||
|
|
||||||
namespace SoD
|
namespace SoD
|
||||||
{
|
{
|
||||||
namespace inventory {
|
enum : int { Invalid = -1, Null, Safety };
|
||||||
typedef enum : int16 {
|
|
||||||
TypePossessions = 0,
|
|
||||||
TypeBank,
|
|
||||||
TypeSharedBank,
|
|
||||||
TypeTrade,
|
|
||||||
TypeWorld,
|
|
||||||
TypeLimbo,
|
|
||||||
TypeTribute,
|
|
||||||
TypeTrophyTribute,
|
|
||||||
TypeGuildTribute,
|
|
||||||
TypeMerchant,
|
|
||||||
TypeDeleted,
|
|
||||||
TypeCorpse,
|
|
||||||
TypeBazaar,
|
|
||||||
TypeInspect,
|
|
||||||
TypeRealEstate,
|
|
||||||
TypeViewMODPC,
|
|
||||||
TypeViewMODBank,
|
|
||||||
TypeViewMODSharedBank,
|
|
||||||
TypeViewMODLimbo,
|
|
||||||
TypeAltStorage,
|
|
||||||
TypeArchived,
|
|
||||||
TypeMail,
|
|
||||||
TypeGuildTrophyTribute,
|
|
||||||
TypeOther,
|
|
||||||
TypeCount
|
|
||||||
} InventoryTypes;
|
|
||||||
|
|
||||||
typedef enum : int16 {
|
enum : bool { False = false, True = true };
|
||||||
SlotCharm = 0,
|
|
||||||
SlotEar1,
|
|
||||||
SlotHead,
|
|
||||||
SlotFace,
|
|
||||||
SlotEar2,
|
|
||||||
SlotNeck,
|
|
||||||
SlotShoulders,
|
|
||||||
SlotArms,
|
|
||||||
SlotBack,
|
|
||||||
SlotWrist1,
|
|
||||||
SlotWrist2,
|
|
||||||
SlotRange,
|
|
||||||
SlotHands,
|
|
||||||
SlotPrimary,
|
|
||||||
SlotSecondary,
|
|
||||||
SlotFinger1,
|
|
||||||
SlotFinger2,
|
|
||||||
SlotChest,
|
|
||||||
SlotLegs,
|
|
||||||
SlotFeet,
|
|
||||||
SlotWaist,
|
|
||||||
SlotPowerSource,
|
|
||||||
SlotAmmo,
|
|
||||||
SlotGeneral1,
|
|
||||||
SlotGeneral2,
|
|
||||||
SlotGeneral3,
|
|
||||||
SlotGeneral4,
|
|
||||||
SlotGeneral5,
|
|
||||||
SlotGeneral6,
|
|
||||||
SlotGeneral7,
|
|
||||||
SlotGeneral8,
|
|
||||||
SlotCursor,
|
|
||||||
SlotCount,
|
|
||||||
SlotEquipmentBegin = SlotCharm,
|
|
||||||
SlotEquipmentEnd = SlotAmmo,
|
|
||||||
SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1),
|
|
||||||
SlotGeneralBegin = SlotGeneral1,
|
|
||||||
SlotGeneralEnd = SlotGeneral8,
|
|
||||||
SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1)
|
|
||||||
} PossessionsSlots;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace consts {
|
// pre-declarations
|
||||||
static const size_t CHARACTER_CREATION_LIMIT = 12;
|
namespace invtype {
|
||||||
|
inline EQEmu::versions::ClientVersion InvTypeRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
static const uint16 TYPE_POSSESSIONS_SIZE = inventory::SlotCount;
|
enum : int { InvTypeInvalid = -1, InvTypeBegin };
|
||||||
static const uint16 TYPE_BANK_SIZE = 24;
|
|
||||||
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
|
|
||||||
static const uint16 TYPE_TRADE_SIZE = 8;
|
|
||||||
static const uint16 TYPE_WORLD_SIZE = 10;
|
|
||||||
static const uint16 TYPE_LIMBO_SIZE = 36;
|
|
||||||
static const uint16 TYPE_TRIBUTE_SIZE = 0; //?
|
|
||||||
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_MERCHANT_SIZE = 0;
|
|
||||||
static const uint16 TYPE_DELETED_SIZE = 0;
|
|
||||||
static const uint16 TYPE_CORPSE_SIZE = inventory::SlotCount;
|
|
||||||
static const uint16 TYPE_BAZAAR_SIZE = 80;
|
|
||||||
static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount;
|
|
||||||
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE;
|
|
||||||
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_ARCHIVED_SIZE = 0;
|
|
||||||
static const uint16 TYPE_MAIL_SIZE = 0;
|
|
||||||
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_KRONO_SIZE = NOT_USED;
|
|
||||||
static const uint16 TYPE_OTHER_SIZE = 0;
|
|
||||||
|
|
||||||
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
|
enum InventoryType : int {
|
||||||
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
|
InvTypePossessions = InvTypeBegin,
|
||||||
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
|
InvTypeBank,
|
||||||
|
InvTypeSharedBank,
|
||||||
|
InvTypeTrade,
|
||||||
|
InvTypeWorld,
|
||||||
|
InvTypeLimbo,
|
||||||
|
InvTypeTribute,
|
||||||
|
InvTypeGuildTribute,
|
||||||
|
InvTypeMerchant,
|
||||||
|
InvTypeCorpse,
|
||||||
|
InvTypeBazaar,
|
||||||
|
InvTypeInspect,
|
||||||
|
InvTypeViewMODPC,
|
||||||
|
InvTypeViewMODBank,
|
||||||
|
InvTypeViewMODSharedBank,
|
||||||
|
InvTypeViewMODLimbo,
|
||||||
|
InvTypeAltStorage,
|
||||||
|
InvTypeArchived,
|
||||||
|
InvTypeOther,
|
||||||
|
InvTypeCount
|
||||||
|
};
|
||||||
|
|
||||||
static const int16 GENERAL_BEGIN = inventory::SlotGeneral1;
|
} /*invtype*/
|
||||||
static const int16 GENERAL_END = inventory::SlotGeneral8;
|
|
||||||
static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount;
|
|
||||||
static const int16 GENERAL_BAGS_BEGIN = 262;
|
|
||||||
static const int16 GENERAL_BAGS_END_OFFSET = 79;
|
|
||||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 CURSOR = inventory::SlotCursor;
|
namespace invslot {
|
||||||
static const int16 CURSOR_BAG_BEGIN = 342;
|
inline EQEmu::versions::ClientVersion InvSlotRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
|
||||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 BANK_BEGIN = 2000;
|
enum : int { InvSlotInvalid = -1, InvSlotBegin };
|
||||||
static const int16 BANK_END = 2023;
|
|
||||||
static const int16 BANK_BAGS_BEGIN = 2032;
|
|
||||||
static const int16 BANK_BAGS_END_OFFSET = 239;
|
|
||||||
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 SHARED_BANK_BEGIN = 2500;
|
enum PossessionsSlot : int {
|
||||||
static const int16 SHARED_BANK_END = 2501;
|
PossessionsCharm = InvSlotBegin,
|
||||||
static const int16 SHARED_BANK_BAGS_BEGIN = 2532;
|
PossessionsEar1,
|
||||||
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
|
PossessionsHead,
|
||||||
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
|
PossessionsFace,
|
||||||
|
PossessionsEar2,
|
||||||
|
PossessionsNeck,
|
||||||
|
PossessionsShoulders,
|
||||||
|
PossessionsArms,
|
||||||
|
PossessionsBack,
|
||||||
|
PossessionsWrist1,
|
||||||
|
PossessionsWrist2,
|
||||||
|
PossessionsRange,
|
||||||
|
PossessionsHands,
|
||||||
|
PossessionsPrimary,
|
||||||
|
PossessionsSecondary,
|
||||||
|
PossessionsFinger1,
|
||||||
|
PossessionsFinger2,
|
||||||
|
PossessionsChest,
|
||||||
|
PossessionsLegs,
|
||||||
|
PossessionsFeet,
|
||||||
|
PossessionsWaist,
|
||||||
|
PossessionsPowerSource,
|
||||||
|
PossessionsAmmo,
|
||||||
|
PossessionsGeneral1,
|
||||||
|
PossessionsGeneral2,
|
||||||
|
PossessionsGeneral3,
|
||||||
|
PossessionsGeneral4,
|
||||||
|
PossessionsGeneral5,
|
||||||
|
PossessionsGeneral6,
|
||||||
|
PossessionsGeneral7,
|
||||||
|
PossessionsGeneral8,
|
||||||
|
PossessionsCursor,
|
||||||
|
PossessionsCount
|
||||||
|
};
|
||||||
|
|
||||||
static const int16 TRADE_BEGIN = 3000;
|
const int EquipmentBegin = PossessionsCharm;
|
||||||
static const int16 TRADE_END = 3007;
|
const int EquipmentEnd = PossessionsAmmo;
|
||||||
static const int16 TRADE_NPC_END = 3003;
|
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
|
||||||
static const int16 TRADE_BAGS_BEGIN = 3031;
|
|
||||||
static const int16 TRADE_BAGS_END_OFFSET = 79;
|
|
||||||
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 WORLD_BEGIN = 4000;
|
const int GeneralBegin = PossessionsGeneral1;
|
||||||
static const int16 WORLD_END = 4009;
|
const int GeneralEnd = PossessionsGeneral8;
|
||||||
|
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
|
||||||
|
|
||||||
static const int16 TRIBUTE_BEGIN = 400;
|
} /*invslot*/
|
||||||
static const int16 TRIBUTE_END = 404;
|
|
||||||
|
|
||||||
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
|
namespace invbag {
|
||||||
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
|
inline EQEmu::versions::ClientVersion InvBagRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
static const uint16 ITEM_COMMON_SIZE = 5;
|
enum : int { InvBagInvalid = -1, InvBagBegin };
|
||||||
static const uint16 ITEM_CONTAINER_SIZE = 10;
|
|
||||||
|
|
||||||
static const size_t BANDOLIERS_SIZE = 20; // number of bandolier instances
|
} /*invbag*/
|
||||||
static const size_t BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
|
||||||
|
|
||||||
static const size_t POTION_BELT_ITEM_COUNT = 5;
|
namespace invaug {
|
||||||
|
inline EQEmu::versions::ClientVersion InvAugRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
static const size_t TEXT_LINK_BODY_LENGTH = 50;
|
enum : int { InvAugInvalid = -1, InvAugBegin };
|
||||||
|
|
||||||
static const size_t PLAYER_PROFILE_SKILL_MAX = SkillTripleAttack;
|
} /*invaug*/
|
||||||
}
|
|
||||||
|
|
||||||
namespace limits {
|
namespace item {
|
||||||
static const bool ALLOWS_EMPTY_BAG_IN_BAG = false;
|
inline EQEmu::versions::ClientVersion ItemRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||||
static const bool ALLOWS_CLICK_CAST_FROM_BAG = false;
|
|
||||||
static const bool COIN_HAS_WEIGHT = false;
|
enum ItemPacketType : int {
|
||||||
}
|
ItemPacketMerchant = 100,
|
||||||
|
ItemPacketTradeView = 101,
|
||||||
|
ItemPacketLoot = 102,
|
||||||
|
ItemPacketTrade = 103,
|
||||||
|
ItemPacketCharInventory = 105,
|
||||||
|
ItemPacketLimbo = 106,
|
||||||
|
ItemPacketWorldContainer = 107,
|
||||||
|
ItemPacketTributeItem = 108,
|
||||||
|
ItemPacketGuildTribute = 109,
|
||||||
|
ItemPacketCharmUpdate = 110
|
||||||
|
};
|
||||||
|
|
||||||
|
} /*item*/
|
||||||
|
|
||||||
|
namespace profile {
|
||||||
|
inline EQEmu::versions::ClientVersion ProfileRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
|
} /*profile*/
|
||||||
|
|
||||||
|
namespace constants {
|
||||||
|
inline EQEmu::versions::ClientVersion ConstantsRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
|
} /*constants*/
|
||||||
|
|
||||||
|
namespace behavior {
|
||||||
|
inline EQEmu::versions::ClientVersion BehaviorRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
|
} /*behavior*/
|
||||||
|
|
||||||
|
namespace skills {
|
||||||
|
inline EQEmu::versions::ClientVersion SkillsRef() { return EQEmu::versions::ClientVersion::SoD; }
|
||||||
|
|
||||||
|
} /*skills*/
|
||||||
|
|
||||||
|
|
||||||
|
// declarations
|
||||||
|
namespace invtype {
|
||||||
|
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
|
||||||
|
const size_t InvTypeBankSize = 24;
|
||||||
|
const size_t InvTypeSharedBankSize = 2;
|
||||||
|
const size_t InvTypeTradeSize = 8;
|
||||||
|
const size_t InvTypeWorldSize = 10;
|
||||||
|
const size_t InvTypeLimboSize = 36;
|
||||||
|
const size_t InvTypeTributeSize = 5;
|
||||||
|
const size_t InvTypeGuildTributeSize = 0;//unknown
|
||||||
|
const size_t InvTypeMerchantSize = 80;
|
||||||
|
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
|
||||||
|
const size_t InvTypeBazaarSize = 80;
|
||||||
|
const size_t InvTypeInspectSize = invslot::EquipmentCount;
|
||||||
|
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
|
||||||
|
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
|
||||||
|
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
|
||||||
|
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
|
||||||
|
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
|
||||||
|
const size_t InvTypeArchivedSize = 0;//unknown
|
||||||
|
const size_t InvTypeOtherSize = 0;//unknown
|
||||||
|
|
||||||
|
const size_t NPCTradeSize = 4;
|
||||||
|
|
||||||
|
extern size_t InvTypeSize(int inv_type);
|
||||||
|
extern const char* InvTypeName(int inv_type);
|
||||||
|
|
||||||
|
} /*invtype*/
|
||||||
|
|
||||||
|
namespace invslot {
|
||||||
|
const int BankBegin = 2000;
|
||||||
|
const int BankEnd = (BankBegin + invtype::InvTypeBankSize) - 1;
|
||||||
|
|
||||||
|
const int SharedBankBegin = 2500;
|
||||||
|
const int SharedBankEnd = (SharedBankBegin + invtype::InvTypeSharedBankSize) - 1;
|
||||||
|
|
||||||
|
const int TradeBegin = 3000;
|
||||||
|
const int TradeEnd = (TradeBegin + invtype::InvTypeTradeSize) - 1;
|
||||||
|
const int TradeNPCEnd = 3003;
|
||||||
|
|
||||||
|
const int WorldBegin = 4000;
|
||||||
|
const int WorldEnd = (WorldBegin + invtype::InvTypeWorldSize) - 1;
|
||||||
|
|
||||||
|
const int TributeBegin = 400;
|
||||||
|
const int TributeEnd = 404;
|
||||||
|
|
||||||
|
const int CorpseBegin = invslot::PossessionsGeneral1;
|
||||||
|
const int CorpseEnd = invslot::PossessionsGeneral1 + invslot::PossessionsCursor;
|
||||||
|
|
||||||
|
extern const char* InvPossessionsSlotName(int inv_slot);
|
||||||
|
extern const char* InvCorpseSlotName(int inv_slot);
|
||||||
|
extern const char* InvSlotName(int inv_type, int inv_slot);
|
||||||
|
|
||||||
|
} /*invslot*/
|
||||||
|
|
||||||
|
namespace invbag {
|
||||||
|
const size_t ItemBagSize = 10;
|
||||||
|
|
||||||
|
const int GeneralBagsBegin = 262;
|
||||||
|
const int GeneralBagsSize = invslot::GeneralCount * ItemBagSize;
|
||||||
|
const int GeneralBagsEnd = (GeneralBagsBegin + GeneralBagsSize) - 1;
|
||||||
|
|
||||||
|
const int CursorBagBegin = 342;
|
||||||
|
const int CursorBagSize = ItemBagSize;
|
||||||
|
const int CursorBagEnd = (CursorBagBegin + CursorBagSize) - 1;
|
||||||
|
|
||||||
|
const int BankBagsBegin = 2032;
|
||||||
|
const int BankBagsSize = (invtype::InvTypeBankSize * ItemBagSize);
|
||||||
|
const int BankBagsEnd = (BankBagsBegin + BankBagsSize) - 1;
|
||||||
|
|
||||||
|
const int SharedBankBagsBegin = 2532;
|
||||||
|
const int SharedBankBagsSize = invtype::InvTypeSharedBankSize * ItemBagSize;
|
||||||
|
const int SharedBankBagsEnd = (SharedBankBagsBegin + SharedBankBagsSize) - 1;
|
||||||
|
|
||||||
|
const int TradeBagsBegin = 3031;
|
||||||
|
const int TradeBagsSize = invtype::InvTypeTradeSize * ItemBagSize;
|
||||||
|
const int TradeBagsEnd = (TradeBagsBegin + TradeBagsSize) - 1;
|
||||||
|
|
||||||
|
extern const char* InvBagIndexName(int bag_index);
|
||||||
|
|
||||||
|
} /*invbag*/
|
||||||
|
|
||||||
|
namespace invaug {
|
||||||
|
const size_t ItemAugSize = 5;
|
||||||
|
|
||||||
|
extern const char* InvAugIndexName(int aug_index);
|
||||||
|
|
||||||
|
} /*invaug*/
|
||||||
|
|
||||||
|
namespace item {
|
||||||
|
|
||||||
|
} /*item*/
|
||||||
|
|
||||||
|
namespace profile {
|
||||||
|
const size_t TributeSize = invtype::InvTypeTributeSize;
|
||||||
|
|
||||||
|
const size_t BandoliersSize = 20; // number of bandolier instances
|
||||||
|
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
|
||||||
|
|
||||||
|
const size_t PotionBeltSize = 5;
|
||||||
|
|
||||||
|
const size_t SkillArraySize = 100;
|
||||||
|
|
||||||
|
} /*profile*/
|
||||||
|
|
||||||
|
namespace constants {
|
||||||
|
const size_t CharacterCreationLimit = 12;
|
||||||
|
|
||||||
|
const size_t SayLinkBodySize = 50;
|
||||||
|
|
||||||
|
} /*constants*/
|
||||||
|
|
||||||
|
namespace behavior {
|
||||||
|
const bool ConcatenateInvTypeLimbo = true;
|
||||||
|
|
||||||
|
const bool AllowOverLevelEquipment = false;
|
||||||
|
|
||||||
|
const bool AllowEmptyBagInBag = false;
|
||||||
|
const bool AllowClickCastFromBag = false;
|
||||||
|
|
||||||
|
const bool CoinHasWeight = false;
|
||||||
|
|
||||||
|
} /*behavior*/
|
||||||
|
|
||||||
|
namespace skills {
|
||||||
|
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
|
||||||
|
|
||||||
|
} /*skills*/
|
||||||
|
|
||||||
}; /*SoD*/
|
}; /*SoD*/
|
||||||
|
|
||||||
#endif /*COMMON_SOD_CONSTANTS_H*/
|
#endif /*COMMON_SOD_LIMITS_H*/
|
||||||
|
|||||||
@ -726,7 +726,7 @@ struct BandolierItem_Struct
|
|||||||
struct Bandolier_Struct
|
struct Bandolier_Struct
|
||||||
{
|
{
|
||||||
char Name[32];
|
char Name[32];
|
||||||
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
|
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||||
};
|
};
|
||||||
|
|
||||||
//len = 72
|
//len = 72
|
||||||
@ -740,7 +740,7 @@ struct PotionBeltItem_Struct
|
|||||||
//len = 288
|
//len = 288
|
||||||
struct PotionBelt_Struct
|
struct PotionBelt_Struct
|
||||||
{
|
{
|
||||||
PotionBeltItem_Struct Items[consts::POTION_BELT_ITEM_COUNT];
|
PotionBeltItem_Struct Items[profile::PotionBeltSize];
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
|
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
|
||||||
@ -960,7 +960,7 @@ struct PlayerProfile_Struct
|
|||||||
/*08288*/ uint32 aapoints_spent; // Number of spent AA points
|
/*08288*/ uint32 aapoints_spent; // Number of spent AA points
|
||||||
/*08292*/ uint32 aapoints; // Unspent AA points
|
/*08292*/ uint32 aapoints; // Unspent AA points
|
||||||
/*08296*/ uint8 unknown06160[4];
|
/*08296*/ uint8 unknown06160[4];
|
||||||
/*08300*/ Bandolier_Struct bandoliers[consts::BANDOLIERS_SIZE]; // [6400] bandolier contents
|
/*08300*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // [6400] bandolier contents
|
||||||
/*14700*/ PotionBelt_Struct potionbelt; // [360] potion belt 72 extra octets by adding 1 more belt slot
|
/*14700*/ PotionBelt_Struct potionbelt; // [360] potion belt 72 extra octets by adding 1 more belt slot
|
||||||
/*15060*/ uint8 unknown12852[8];
|
/*15060*/ uint8 unknown12852[8];
|
||||||
/*15068*/ uint32 available_slots;
|
/*15068*/ uint32 available_slots;
|
||||||
|
|||||||
@ -1279,18 +1279,18 @@ namespace SoF
|
|||||||
// OUT(unknown06160[4]);
|
// OUT(unknown06160[4]);
|
||||||
|
|
||||||
// Copy bandoliers where server and client indexes converge
|
// Copy bandoliers where server and client indexes converge
|
||||||
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++r) {
|
||||||
OUT_str(bandoliers[r].Name);
|
OUT_str(bandoliers[r].Name);
|
||||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||||
OUT(bandoliers[r].Items[k].ID);
|
OUT(bandoliers[r].Items[k].ID);
|
||||||
OUT(bandoliers[r].Items[k].Icon);
|
OUT(bandoliers[r].Items[k].Icon);
|
||||||
OUT_str(bandoliers[r].Items[k].Name);
|
OUT_str(bandoliers[r].Items[k].Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||||
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++r) {
|
||||||
eq->bandoliers[r].Name[0] = '\0';
|
eq->bandoliers[r].Name[0] = '\0';
|
||||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||||
eq->bandoliers[r].Items[k].ID = 0;
|
eq->bandoliers[r].Items[k].ID = 0;
|
||||||
eq->bandoliers[r].Items[k].Icon = 0;
|
eq->bandoliers[r].Items[k].Icon = 0;
|
||||||
eq->bandoliers[r].Items[k].Name[0] = '\0';
|
eq->bandoliers[r].Items[k].Name[0] = '\0';
|
||||||
@ -1300,13 +1300,13 @@ namespace SoF
|
|||||||
// OUT(unknown07444[5120]);
|
// OUT(unknown07444[5120]);
|
||||||
|
|
||||||
// Copy potion belt where server and client indexes converge
|
// Copy potion belt where server and client indexes converge
|
||||||
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
|
||||||
OUT(potionbelt.Items[r].ID);
|
OUT(potionbelt.Items[r].ID);
|
||||||
OUT(potionbelt.Items[r].Icon);
|
OUT(potionbelt.Items[r].Icon);
|
||||||
OUT_str(potionbelt.Items[r].Name);
|
OUT_str(potionbelt.Items[r].Name);
|
||||||
}
|
}
|
||||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||||
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
|
||||||
eq->potionbelt.Items[r].ID = 0;
|
eq->potionbelt.Items[r].ID = 0;
|
||||||
eq->potionbelt.Items[r].Icon = 0;
|
eq->potionbelt.Items[r].Icon = 0;
|
||||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||||
@ -1594,8 +1594,8 @@ namespace SoF
|
|||||||
eq->CharCount = emu->CharCount;
|
eq->CharCount = emu->CharCount;
|
||||||
eq->TotalChars = emu->TotalChars;
|
eq->TotalChars = emu->TotalChars;
|
||||||
|
|
||||||
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
|
if (eq->TotalChars > constants::CharacterCreationLimit)
|
||||||
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
|
eq->TotalChars = constants::CharacterCreationLimit;
|
||||||
|
|
||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
return;
|
return;
|
||||||
@ -1607,7 +1607,7 @@ namespace SoF
|
|||||||
|
|
||||||
size_t names_length = 0;
|
size_t names_length = 0;
|
||||||
size_t character_count = 0;
|
size_t character_count = 0;
|
||||||
for (; character_count < emu->CharCount && character_count < consts::CHARACTER_CREATION_LIMIT; ++character_count) {
|
for (; character_count < emu->CharCount && character_count < constants::CharacterCreationLimit; ++character_count) {
|
||||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||||
names_length += strlen(emu_cse->Name);
|
names_length += strlen(emu_cse->Name);
|
||||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||||
@ -1623,8 +1623,8 @@ namespace SoF
|
|||||||
eq->CharCount = character_count;
|
eq->CharCount = character_count;
|
||||||
eq->TotalChars = emu->TotalChars;
|
eq->TotalChars = emu->TotalChars;
|
||||||
|
|
||||||
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
|
if (eq->TotalChars > constants::CharacterCreationLimit)
|
||||||
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
|
eq->TotalChars = constants::CharacterCreationLimit;
|
||||||
|
|
||||||
emu_ptr = __emu_buffer;
|
emu_ptr = __emu_buffer;
|
||||||
emu_ptr += sizeof(CharacterSelect_Struct);
|
emu_ptr += sizeof(CharacterSelect_Struct);
|
||||||
@ -3027,7 +3027,7 @@ namespace SoF
|
|||||||
isbs.augtype = item->AugType;
|
isbs.augtype = item->AugType;
|
||||||
isbs.augrestrict = item->AugRestrict;
|
isbs.augrestrict = item->AugRestrict;
|
||||||
|
|
||||||
for (int index = 0; index < consts::ITEM_COMMON_SIZE; ++index) {
|
for (int index = 0; index < invaug::ItemAugSize; ++index) {
|
||||||
isbs.augslots[index].type = item->AugSlotType[index];
|
isbs.augslots[index].type = item->AugSlotType[index];
|
||||||
isbs.augslots[index].visible = item->AugSlotVisible[index];
|
isbs.augslots[index].visible = item->AugSlotVisible[index];
|
||||||
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
|
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
|
||||||
@ -3237,7 +3237,7 @@ namespace SoF
|
|||||||
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
|
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
|
||||||
SoFSlot = serverSlot + 1;
|
SoFSlot = serverSlot + 1;
|
||||||
else if (serverSlot == EQEmu::legacy::SlotPowerSource)
|
else if (serverSlot == EQEmu::legacy::SlotPowerSource)
|
||||||
SoFSlot = inventory::SlotPowerSource;
|
SoFSlot = invslot::PossessionsPowerSource;
|
||||||
else
|
else
|
||||||
SoFSlot = serverSlot;
|
SoFSlot = serverSlot;
|
||||||
|
|
||||||
@ -3254,15 +3254,15 @@ namespace SoF
|
|||||||
{
|
{
|
||||||
uint32 ServerSlot = 0;
|
uint32 ServerSlot = 0;
|
||||||
|
|
||||||
if (sofSlot >= inventory::SlotAmmo && sofSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
if (sofSlot >= invslot::PossessionsAmmo && sofSlot <= invslot::CorpseEnd) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||||
ServerSlot = sofSlot - 1;
|
ServerSlot = sofSlot - 1;
|
||||||
else if (sofSlot >= consts::GENERAL_BAGS_BEGIN && sofSlot <= consts::CURSOR_BAG_END)
|
else if (sofSlot >= invbag::GeneralBagsBegin && sofSlot <= invbag::CursorBagEnd)
|
||||||
ServerSlot = sofSlot - 11;
|
ServerSlot = sofSlot - 11;
|
||||||
else if (sofSlot >= consts::BANK_BAGS_BEGIN && sofSlot <= consts::BANK_BAGS_END)
|
else if (sofSlot >= invbag::BankBagsBegin && sofSlot <= invbag::BankBagsEnd)
|
||||||
ServerSlot = sofSlot - 1;
|
ServerSlot = sofSlot - 1;
|
||||||
else if (sofSlot >= consts::SHARED_BANK_BAGS_BEGIN && sofSlot <= consts::SHARED_BANK_BAGS_END)
|
else if (sofSlot >= invbag::SharedBankBagsBegin && sofSlot <= invbag::SharedBankBagsEnd)
|
||||||
ServerSlot = sofSlot - 1;
|
ServerSlot = sofSlot - 1;
|
||||||
else if (sofSlot == inventory::SlotPowerSource)
|
else if (sofSlot == invslot::PossessionsPowerSource)
|
||||||
ServerSlot = EQEmu::legacy::SlotPowerSource;
|
ServerSlot = EQEmu::legacy::SlotPowerSource;
|
||||||
else
|
else
|
||||||
ServerSlot = sofSlot;
|
ServerSlot = sofSlot;
|
||||||
@ -3278,7 +3278,7 @@ namespace SoF
|
|||||||
|
|
||||||
static inline void ServerToSoFTextLink(std::string& sofTextLink, const std::string& serverTextLink)
|
static inline void ServerToSoFTextLink(std::string& sofTextLink, const std::string& serverTextLink)
|
||||||
{
|
{
|
||||||
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||||
sofTextLink = serverTextLink;
|
sofTextLink = serverTextLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3318,7 +3318,7 @@ namespace SoF
|
|||||||
|
|
||||||
static inline void SoFToServerTextLink(std::string& serverTextLink, const std::string& sofTextLink)
|
static inline void SoFToServerTextLink(std::string& serverTextLink, const std::string& sofTextLink)
|
||||||
{
|
{
|
||||||
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (sofTextLink.find('\x12') == std::string::npos)) {
|
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (sofTextLink.find('\x12') == std::string::npos)) {
|
||||||
serverTextLink = sofTextLink;
|
serverTextLink = sofTextLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3327,7 +3327,7 @@ namespace SoF
|
|||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
if (segments[segment_iter].length() <= consts::TEXT_LINK_BODY_LENGTH) {
|
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
|
||||||
serverTextLink.append(segments[segment_iter]);
|
serverTextLink.append(segments[segment_iter]);
|
||||||
// TODO: log size mismatch error
|
// TODO: log size mismatch error
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -16,3 +16,240 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "sof_limits.h"
|
||||||
|
|
||||||
|
#include "../string_util.h"
|
||||||
|
|
||||||
|
|
||||||
|
size_t SoF::invtype::InvTypeSize(int inv_type)
|
||||||
|
{
|
||||||
|
switch (inv_type) {
|
||||||
|
case invtype::InvTypePossessions:
|
||||||
|
return invtype::InvTypePossessionsSize;
|
||||||
|
case invtype::InvTypeBank:
|
||||||
|
return invtype::InvTypeBankSize;
|
||||||
|
case invtype::InvTypeSharedBank:
|
||||||
|
return invtype::InvTypeSharedBankSize;
|
||||||
|
case invtype::InvTypeTrade:
|
||||||
|
return invtype::InvTypeTradeSize;
|
||||||
|
case invtype::InvTypeWorld:
|
||||||
|
return invtype::InvTypeWorldSize;
|
||||||
|
case invtype::InvTypeLimbo:
|
||||||
|
return invtype::InvTypeLimboSize;
|
||||||
|
case invtype::InvTypeTribute:
|
||||||
|
return invtype::InvTypeTributeSize;
|
||||||
|
case invtype::InvTypeGuildTribute:
|
||||||
|
return invtype::InvTypeGuildTributeSize;
|
||||||
|
case invtype::InvTypeMerchant:
|
||||||
|
return invtype::InvTypeMerchantSize;
|
||||||
|
case invtype::InvTypeCorpse:
|
||||||
|
return invtype::InvTypeCorpseSize;
|
||||||
|
case invtype::InvTypeBazaar:
|
||||||
|
return invtype::InvTypeBazaarSize;
|
||||||
|
case invtype::InvTypeInspect:
|
||||||
|
return invtype::InvTypeInspectSize;
|
||||||
|
case invtype::InvTypeViewMODPC:
|
||||||
|
return invtype::InvTypeViewMODPCSize;
|
||||||
|
case invtype::InvTypeViewMODBank:
|
||||||
|
return invtype::InvTypeViewMODBankSize;
|
||||||
|
case invtype::InvTypeViewMODSharedBank:
|
||||||
|
return invtype::InvTypeViewMODSharedBankSize;
|
||||||
|
case invtype::InvTypeViewMODLimbo:
|
||||||
|
return invtype::InvTypeViewMODLimboSize;
|
||||||
|
case invtype::InvTypeAltStorage:
|
||||||
|
return invtype::InvTypeAltStorageSize;
|
||||||
|
case invtype::InvTypeArchived:
|
||||||
|
return invtype::InvTypeArchivedSize;
|
||||||
|
case invtype::InvTypeOther:
|
||||||
|
return invtype::InvTypeOtherSize;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* SoF::invtype::InvTypeName(int inv_type)
|
||||||
|
{
|
||||||
|
switch (inv_type) {
|
||||||
|
case invtype::InvTypeInvalid:
|
||||||
|
return "Invalid Type";
|
||||||
|
case invtype::InvTypePossessions:
|
||||||
|
return "Possessions";
|
||||||
|
case invtype::InvTypeBank:
|
||||||
|
return "Bank";
|
||||||
|
case invtype::InvTypeSharedBank:
|
||||||
|
return "Shared Bank";
|
||||||
|
case invtype::InvTypeTrade:
|
||||||
|
return "Trade";
|
||||||
|
case invtype::InvTypeWorld:
|
||||||
|
return "World";
|
||||||
|
case invtype::InvTypeLimbo:
|
||||||
|
return "Limbo";
|
||||||
|
case invtype::InvTypeTribute:
|
||||||
|
return "Tribute";
|
||||||
|
case invtype::InvTypeGuildTribute:
|
||||||
|
return "Guild Tribute";
|
||||||
|
case invtype::InvTypeMerchant:
|
||||||
|
return "Merchant";
|
||||||
|
case invtype::InvTypeCorpse:
|
||||||
|
return "Corpse";
|
||||||
|
case invtype::InvTypeBazaar:
|
||||||
|
return "Bazaar";
|
||||||
|
case invtype::InvTypeInspect:
|
||||||
|
return "Inspect";
|
||||||
|
case invtype::InvTypeViewMODPC:
|
||||||
|
return "View MOD PC";
|
||||||
|
case invtype::InvTypeViewMODBank:
|
||||||
|
return "View MOD Bank";
|
||||||
|
case invtype::InvTypeViewMODSharedBank:
|
||||||
|
return "View MOD Shared Bank";
|
||||||
|
case invtype::InvTypeViewMODLimbo:
|
||||||
|
return "View MOD Limbo";
|
||||||
|
case invtype::InvTypeAltStorage:
|
||||||
|
return "Alt Storage";
|
||||||
|
case invtype::InvTypeArchived:
|
||||||
|
return "Archived";
|
||||||
|
case invtype::InvTypeOther:
|
||||||
|
return "Other";
|
||||||
|
default:
|
||||||
|
return "Unknown Type";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* SoF::invslot::InvPossessionsSlotName(int inv_slot)
|
||||||
|
{
|
||||||
|
switch (inv_slot) {
|
||||||
|
case invslot::InvSlotInvalid:
|
||||||
|
return "Invalid Slot";
|
||||||
|
case invslot::PossessionsCharm:
|
||||||
|
return "Charm";
|
||||||
|
case invslot::PossessionsEar1:
|
||||||
|
return "Ear 1";
|
||||||
|
case invslot::PossessionsHead:
|
||||||
|
return "Head";
|
||||||
|
case invslot::PossessionsFace:
|
||||||
|
return "Face";
|
||||||
|
case invslot::PossessionsEar2:
|
||||||
|
return "Ear 2";
|
||||||
|
case invslot::PossessionsNeck:
|
||||||
|
return "Neck";
|
||||||
|
case invslot::PossessionsShoulders:
|
||||||
|
return "Shoulders";
|
||||||
|
case invslot::PossessionsArms:
|
||||||
|
return "Arms";
|
||||||
|
case invslot::PossessionsBack:
|
||||||
|
return "Back";
|
||||||
|
case invslot::PossessionsWrist1:
|
||||||
|
return "Wrist 1";
|
||||||
|
case invslot::PossessionsWrist2:
|
||||||
|
return "Wrist 2";
|
||||||
|
case invslot::PossessionsRange:
|
||||||
|
return "Range";
|
||||||
|
case invslot::PossessionsHands:
|
||||||
|
return "Hands";
|
||||||
|
case invslot::PossessionsPrimary:
|
||||||
|
return "Primary";
|
||||||
|
case invslot::PossessionsSecondary:
|
||||||
|
return "Secondary";
|
||||||
|
case invslot::PossessionsFinger1:
|
||||||
|
return "Finger 1";
|
||||||
|
case invslot::PossessionsFinger2:
|
||||||
|
return "Finger 2";
|
||||||
|
case invslot::PossessionsChest:
|
||||||
|
return "Chest";
|
||||||
|
case invslot::PossessionsLegs:
|
||||||
|
return "Legs";
|
||||||
|
case invslot::PossessionsFeet:
|
||||||
|
return "Feet";
|
||||||
|
case invslot::PossessionsWaist:
|
||||||
|
return "Waist";
|
||||||
|
case invslot::PossessionsPowerSource:
|
||||||
|
return "Power Source";
|
||||||
|
case invslot::PossessionsAmmo:
|
||||||
|
return "Ammo";
|
||||||
|
case invslot::PossessionsGeneral1:
|
||||||
|
return "General 1";
|
||||||
|
case invslot::PossessionsGeneral2:
|
||||||
|
return "General 2";
|
||||||
|
case invslot::PossessionsGeneral3:
|
||||||
|
return "General 3";
|
||||||
|
case invslot::PossessionsGeneral4:
|
||||||
|
return "General 4";
|
||||||
|
case invslot::PossessionsGeneral5:
|
||||||
|
return "General 5";
|
||||||
|
case invslot::PossessionsGeneral6:
|
||||||
|
return "General 6";
|
||||||
|
case invslot::PossessionsGeneral7:
|
||||||
|
return "General 7";
|
||||||
|
case invslot::PossessionsGeneral8:
|
||||||
|
return "General 8";
|
||||||
|
case invslot::PossessionsCursor:
|
||||||
|
return "Cursor";
|
||||||
|
default:
|
||||||
|
return "Unknown Slot";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* SoF::invslot::InvCorpseSlotName(int inv_slot)
|
||||||
|
{
|
||||||
|
if (!invtype::InvTypeSize(invtype::InvTypeCorpse) || inv_slot == invslot::InvSlotInvalid)
|
||||||
|
return "Invalid Slot";
|
||||||
|
|
||||||
|
// needs work
|
||||||
|
if ((size_t)(inv_slot + 1) < invslot::CorpseBegin || (size_t)(inv_slot + 1) >= invslot::CorpseEnd)
|
||||||
|
return "Unknown Slot";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Slot %i", (inv_slot + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* SoF::invslot::InvSlotName(int inv_type, int inv_slot)
|
||||||
|
{
|
||||||
|
if (inv_type == invtype::InvTypePossessions)
|
||||||
|
return invslot::InvPossessionsSlotName(inv_slot);
|
||||||
|
else if (inv_type == invtype::InvTypeCorpse)
|
||||||
|
return invslot::InvCorpseSlotName(inv_slot);
|
||||||
|
|
||||||
|
size_t type_size = invtype::InvTypeSize(inv_type);
|
||||||
|
|
||||||
|
if (!type_size || inv_slot == invslot::InvSlotInvalid)
|
||||||
|
return "Invalid Slot";
|
||||||
|
|
||||||
|
if ((size_t)(inv_slot + 1) >= type_size)
|
||||||
|
return "Unknown Slot";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Slot %i", (inv_slot + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* SoF::invbag::InvBagIndexName(int bag_index)
|
||||||
|
{
|
||||||
|
if (bag_index == invbag::InvBagInvalid)
|
||||||
|
return "Invalid Bag";
|
||||||
|
|
||||||
|
if ((size_t)bag_index >= invbag::ItemBagSize)
|
||||||
|
return "Unknown Bag";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Bag %i", (bag_index + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* SoF::invaug::InvAugIndexName(int aug_index)
|
||||||
|
{
|
||||||
|
if (aug_index == invaug::InvAugInvalid)
|
||||||
|
return "Invalid Augment";
|
||||||
|
|
||||||
|
if ((size_t)aug_index >= invaug::ItemAugSize)
|
||||||
|
return "Unknown Augment";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Augment %i", (aug_index + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|||||||
@ -17,178 +17,284 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef COMMON_SOF_CONSTANTS_H
|
#ifndef COMMON_SOF_LIMITS_H
|
||||||
#define COMMON_SOF_CONSTANTS_H
|
#define COMMON_SOF_LIMITS_H
|
||||||
|
|
||||||
#include "../types.h"
|
#include "../types.h"
|
||||||
|
#include "../client_version.h"
|
||||||
|
#include "../skills.h"
|
||||||
|
|
||||||
|
|
||||||
namespace SoF
|
namespace SoF
|
||||||
{
|
{
|
||||||
namespace inventory {
|
enum : int { Invalid = -1, Null, Safety };
|
||||||
typedef enum : int16 {
|
|
||||||
TypePossessions = 0,
|
|
||||||
TypeBank,
|
|
||||||
TypeSharedBank,
|
|
||||||
TypeTrade,
|
|
||||||
TypeWorld,
|
|
||||||
TypeLimbo,
|
|
||||||
TypeTribute,
|
|
||||||
TypeTrophyTribute,
|
|
||||||
TypeGuildTribute,
|
|
||||||
TypeMerchant,
|
|
||||||
TypeDeleted,
|
|
||||||
TypeCorpse,
|
|
||||||
TypeBazaar,
|
|
||||||
TypeInspect,
|
|
||||||
TypeRealEstate,
|
|
||||||
TypeViewMODPC,
|
|
||||||
TypeViewMODBank,
|
|
||||||
TypeViewMODSharedBank,
|
|
||||||
TypeViewMODLimbo,
|
|
||||||
TypeAltStorage,
|
|
||||||
TypeArchived,
|
|
||||||
TypeMail,
|
|
||||||
TypeGuildTrophyTribute,
|
|
||||||
TypeOther,
|
|
||||||
TypeCount
|
|
||||||
} InventoryTypes;
|
|
||||||
|
|
||||||
typedef enum : int16 {
|
enum : bool { False = false, True = true };
|
||||||
SlotCharm = 0,
|
|
||||||
SlotEar1,
|
|
||||||
SlotHead,
|
|
||||||
SlotFace,
|
|
||||||
SlotEar2,
|
|
||||||
SlotNeck,
|
|
||||||
SlotShoulders,
|
|
||||||
SlotArms,
|
|
||||||
SlotBack,
|
|
||||||
SlotWrist1,
|
|
||||||
SlotWrist2,
|
|
||||||
SlotRange,
|
|
||||||
SlotHands,
|
|
||||||
SlotPrimary,
|
|
||||||
SlotSecondary,
|
|
||||||
SlotFinger1,
|
|
||||||
SlotFinger2,
|
|
||||||
SlotChest,
|
|
||||||
SlotLegs,
|
|
||||||
SlotFeet,
|
|
||||||
SlotWaist,
|
|
||||||
SlotPowerSource,
|
|
||||||
SlotAmmo,
|
|
||||||
SlotGeneral1,
|
|
||||||
SlotGeneral2,
|
|
||||||
SlotGeneral3,
|
|
||||||
SlotGeneral4,
|
|
||||||
SlotGeneral5,
|
|
||||||
SlotGeneral6,
|
|
||||||
SlotGeneral7,
|
|
||||||
SlotGeneral8,
|
|
||||||
SlotCursor,
|
|
||||||
SlotCount,
|
|
||||||
SlotEquipmentBegin = SlotCharm,
|
|
||||||
SlotEquipmentEnd = SlotAmmo,
|
|
||||||
SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1),
|
|
||||||
SlotGeneralBegin = SlotGeneral1,
|
|
||||||
SlotGeneralEnd = SlotGeneral8,
|
|
||||||
SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1)
|
|
||||||
} PossessionsSlots;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace consts {
|
// pre-declarations
|
||||||
static const size_t CHARACTER_CREATION_LIMIT = 12;
|
namespace invtype {
|
||||||
|
inline EQEmu::versions::ClientVersion InvTypeRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
static const uint16 TYPE_POSSESSIONS_SIZE = inventory::SlotCount;
|
enum : int { InvTypeInvalid = -1, InvTypeBegin };
|
||||||
static const uint16 TYPE_BANK_SIZE = 24;
|
|
||||||
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
|
|
||||||
static const uint16 TYPE_TRADE_SIZE = 8;
|
|
||||||
static const uint16 TYPE_WORLD_SIZE = 10;
|
|
||||||
static const uint16 TYPE_LIMBO_SIZE = 36;
|
|
||||||
static const uint16 TYPE_TRIBUTE_SIZE = 0; //?
|
|
||||||
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_MERCHANT_SIZE = 0;
|
|
||||||
static const uint16 TYPE_DELETED_SIZE = 0;
|
|
||||||
static const uint16 TYPE_CORPSE_SIZE = inventory::SlotCount;
|
|
||||||
static const uint16 TYPE_BAZAAR_SIZE = 80;
|
|
||||||
static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount;
|
|
||||||
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE;
|
|
||||||
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_ARCHIVED_SIZE = 0;
|
|
||||||
static const uint16 TYPE_MAIL_SIZE = 0;
|
|
||||||
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_KRONO_SIZE = NOT_USED;
|
|
||||||
static const uint16 TYPE_OTHER_SIZE = 0;
|
|
||||||
|
|
||||||
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
|
enum InventoryType : int {
|
||||||
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
|
InvTypePossessions = InvTypeBegin,
|
||||||
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
|
InvTypeBank,
|
||||||
|
InvTypeSharedBank,
|
||||||
|
InvTypeTrade,
|
||||||
|
InvTypeWorld,
|
||||||
|
InvTypeLimbo,
|
||||||
|
InvTypeTribute,
|
||||||
|
InvTypeGuildTribute,
|
||||||
|
InvTypeMerchant,
|
||||||
|
InvTypeCorpse,
|
||||||
|
InvTypeBazaar,
|
||||||
|
InvTypeInspect,
|
||||||
|
InvTypeViewMODPC,
|
||||||
|
InvTypeViewMODBank,
|
||||||
|
InvTypeViewMODSharedBank,
|
||||||
|
InvTypeViewMODLimbo,
|
||||||
|
InvTypeAltStorage,
|
||||||
|
InvTypeArchived,
|
||||||
|
InvTypeOther,
|
||||||
|
InvTypeCount
|
||||||
|
};
|
||||||
|
|
||||||
static const int16 GENERAL_BEGIN = inventory::SlotGeneral1;
|
} /*invtype*/
|
||||||
static const int16 GENERAL_END = inventory::SlotGeneral8;
|
|
||||||
static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount;
|
|
||||||
static const int16 GENERAL_BAGS_BEGIN = 262;
|
|
||||||
static const int16 GENERAL_BAGS_END_OFFSET = 79;
|
|
||||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 CURSOR = inventory::SlotCursor;
|
namespace invslot {
|
||||||
static const int16 CURSOR_BAG_BEGIN = 342;
|
inline EQEmu::versions::ClientVersion InvSlotRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
|
||||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 BANK_BEGIN = 2000;
|
enum : int { InvSlotInvalid = -1, InvSlotBegin };
|
||||||
static const int16 BANK_END = 2023;
|
|
||||||
static const int16 BANK_BAGS_BEGIN = 2032;
|
|
||||||
static const int16 BANK_BAGS_END_OFFSET = 239;
|
|
||||||
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 SHARED_BANK_BEGIN = 2500;
|
enum PossessionsSlot : int {
|
||||||
static const int16 SHARED_BANK_END = 2501;
|
PossessionsCharm = InvSlotBegin,
|
||||||
static const int16 SHARED_BANK_BAGS_BEGIN = 2532;
|
PossessionsEar1,
|
||||||
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
|
PossessionsHead,
|
||||||
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
|
PossessionsFace,
|
||||||
|
PossessionsEar2,
|
||||||
|
PossessionsNeck,
|
||||||
|
PossessionsShoulders,
|
||||||
|
PossessionsArms,
|
||||||
|
PossessionsBack,
|
||||||
|
PossessionsWrist1,
|
||||||
|
PossessionsWrist2,
|
||||||
|
PossessionsRange,
|
||||||
|
PossessionsHands,
|
||||||
|
PossessionsPrimary,
|
||||||
|
PossessionsSecondary,
|
||||||
|
PossessionsFinger1,
|
||||||
|
PossessionsFinger2,
|
||||||
|
PossessionsChest,
|
||||||
|
PossessionsLegs,
|
||||||
|
PossessionsFeet,
|
||||||
|
PossessionsWaist,
|
||||||
|
PossessionsPowerSource,
|
||||||
|
PossessionsAmmo,
|
||||||
|
PossessionsGeneral1,
|
||||||
|
PossessionsGeneral2,
|
||||||
|
PossessionsGeneral3,
|
||||||
|
PossessionsGeneral4,
|
||||||
|
PossessionsGeneral5,
|
||||||
|
PossessionsGeneral6,
|
||||||
|
PossessionsGeneral7,
|
||||||
|
PossessionsGeneral8,
|
||||||
|
PossessionsCursor,
|
||||||
|
PossessionsCount
|
||||||
|
};
|
||||||
|
|
||||||
static const int16 TRADE_BEGIN = 3000;
|
const int EquipmentBegin = PossessionsCharm;
|
||||||
static const int16 TRADE_END = 3007;
|
const int EquipmentEnd = PossessionsAmmo;
|
||||||
static const int16 TRADE_NPC_END = 3003;
|
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
|
||||||
static const int16 TRADE_BAGS_BEGIN = 3031;
|
|
||||||
static const int16 TRADE_BAGS_END_OFFSET = 79;
|
|
||||||
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 WORLD_BEGIN = 4000;
|
const int GeneralBegin = PossessionsGeneral1;
|
||||||
static const int16 WORLD_END = 4009;
|
const int GeneralEnd = PossessionsGeneral8;
|
||||||
|
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
|
||||||
|
|
||||||
static const int16 TRIBUTE_BEGIN = 400;
|
} /*invslot*/
|
||||||
static const int16 TRIBUTE_END = 404;
|
|
||||||
|
|
||||||
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
|
namespace invbag {
|
||||||
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
|
inline EQEmu::versions::ClientVersion InvBagRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
static const uint16 ITEM_COMMON_SIZE = 5;
|
enum : int { InvBagInvalid = -1, InvBagBegin };
|
||||||
static const uint16 ITEM_CONTAINER_SIZE = 10;
|
|
||||||
|
|
||||||
static const size_t BANDOLIERS_SIZE = 20; // number of bandolier instances
|
} /*invbag*/
|
||||||
static const size_t BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
|
||||||
|
|
||||||
static const size_t POTION_BELT_ITEM_COUNT = 5;
|
namespace invaug {
|
||||||
|
inline EQEmu::versions::ClientVersion InvAugRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
static const size_t TEXT_LINK_BODY_LENGTH = 50;
|
enum : int { InvAugInvalid = -1, InvAugBegin };
|
||||||
|
|
||||||
static const size_t PLAYER_PROFILE_SKILL_MAX = SkillTripleAttack;
|
} /*invaug*/
|
||||||
}
|
|
||||||
|
|
||||||
namespace limits {
|
namespace item {
|
||||||
static const bool ALLOWS_EMPTY_BAG_IN_BAG = false;
|
inline EQEmu::versions::ClientVersion ItemRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||||
static const bool ALLOWS_CLICK_CAST_FROM_BAG = false;
|
|
||||||
static const bool COIN_HAS_WEIGHT = true;
|
enum ItemPacketType : int {
|
||||||
}
|
ItemPacketMerchant = 100,
|
||||||
|
ItemPacketTradeView = 101,
|
||||||
|
ItemPacketLoot = 102,
|
||||||
|
ItemPacketTrade = 103,
|
||||||
|
ItemPacketCharInventory = 105,
|
||||||
|
ItemPacketLimbo = 106,
|
||||||
|
ItemPacketWorldContainer = 107,
|
||||||
|
ItemPacketTributeItem = 108,
|
||||||
|
ItemPacketGuildTribute = 109,
|
||||||
|
ItemPacketCharmUpdate = 110
|
||||||
|
};
|
||||||
|
|
||||||
|
} /*item*/
|
||||||
|
|
||||||
|
namespace profile {
|
||||||
|
inline EQEmu::versions::ClientVersion ProfileRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
|
} /*profile*/
|
||||||
|
|
||||||
|
namespace constants {
|
||||||
|
inline EQEmu::versions::ClientVersion ConstantsRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
|
} /*constants*/
|
||||||
|
|
||||||
|
namespace behavior {
|
||||||
|
inline EQEmu::versions::ClientVersion BehaviorRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
|
} /*behavior*/
|
||||||
|
|
||||||
|
namespace skills {
|
||||||
|
inline EQEmu::versions::ClientVersion SkillsRef() { return EQEmu::versions::ClientVersion::SoF; }
|
||||||
|
|
||||||
|
} /*skills*/
|
||||||
|
|
||||||
|
|
||||||
|
// declarations
|
||||||
|
namespace invtype {
|
||||||
|
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
|
||||||
|
const size_t InvTypeBankSize = 24;
|
||||||
|
const size_t InvTypeSharedBankSize = 2;
|
||||||
|
const size_t InvTypeTradeSize = 8;
|
||||||
|
const size_t InvTypeWorldSize = 10;
|
||||||
|
const size_t InvTypeLimboSize = 36;
|
||||||
|
const size_t InvTypeTributeSize = 5;
|
||||||
|
const size_t InvTypeGuildTributeSize = 0;//unknown
|
||||||
|
const size_t InvTypeMerchantSize = 80;
|
||||||
|
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
|
||||||
|
const size_t InvTypeBazaarSize = 80;
|
||||||
|
const size_t InvTypeInspectSize = invslot::EquipmentCount;
|
||||||
|
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
|
||||||
|
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
|
||||||
|
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
|
||||||
|
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
|
||||||
|
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
|
||||||
|
const size_t InvTypeArchivedSize = 0;//unknown
|
||||||
|
const size_t InvTypeOtherSize = 0;//unknown
|
||||||
|
|
||||||
|
const size_t NPCTradeSize = 4;
|
||||||
|
|
||||||
|
extern size_t InvTypeSize(int inv_type);
|
||||||
|
extern const char* InvTypeName(int inv_type);
|
||||||
|
|
||||||
|
} /*invtype*/
|
||||||
|
|
||||||
|
namespace invslot {
|
||||||
|
const int BankBegin = 2000;
|
||||||
|
const int BankEnd = (BankBegin + invtype::InvTypeBankSize) - 1;
|
||||||
|
|
||||||
|
const int SharedBankBegin = 2500;
|
||||||
|
const int SharedBankEnd = (SharedBankBegin + invtype::InvTypeSharedBankSize) - 1;
|
||||||
|
|
||||||
|
const int TradeBegin = 3000;
|
||||||
|
const int TradeEnd = (TradeBegin + invtype::InvTypeTradeSize) - 1;
|
||||||
|
const int TradeNPCEnd = 3003;
|
||||||
|
|
||||||
|
const int WorldBegin = 4000;
|
||||||
|
const int WorldEnd = (WorldBegin + invtype::InvTypeWorldSize) - 1;
|
||||||
|
|
||||||
|
const int TributeBegin = 400;
|
||||||
|
const int TributeEnd = 404;
|
||||||
|
|
||||||
|
const int CorpseBegin = PossessionsGeneral1;
|
||||||
|
const int CorpseEnd = PossessionsGeneral1 + PossessionsCursor;
|
||||||
|
|
||||||
|
extern const char* InvPossessionsSlotName(int inv_slot);
|
||||||
|
extern const char* InvCorpseSlotName(int inv_slot);
|
||||||
|
extern const char* InvSlotName(int inv_type, int inv_slot);
|
||||||
|
|
||||||
|
} /*invslot*/
|
||||||
|
|
||||||
|
namespace invbag {
|
||||||
|
const size_t ItemBagSize = 10;
|
||||||
|
|
||||||
|
const int GeneralBagsBegin = 262;
|
||||||
|
const int GeneralBagsSize = invslot::GeneralCount * ItemBagSize;
|
||||||
|
const int GeneralBagsEnd = (GeneralBagsBegin + GeneralBagsSize) - 1;
|
||||||
|
|
||||||
|
const int CursorBagBegin = 342;
|
||||||
|
const int CursorBagSize = ItemBagSize;
|
||||||
|
const int CursorBagEnd = (CursorBagBegin + CursorBagSize) - 1;
|
||||||
|
|
||||||
|
const int BankBagsBegin = 2032;
|
||||||
|
const int BankBagsSize = (invtype::InvTypeBankSize * ItemBagSize);
|
||||||
|
const int BankBagsEnd = (BankBagsBegin + BankBagsSize) - 1;
|
||||||
|
|
||||||
|
const int SharedBankBagsBegin = 2532;
|
||||||
|
const int SharedBankBagsSize = invtype::InvTypeSharedBankSize * ItemBagSize;
|
||||||
|
const int SharedBankBagsEnd = (SharedBankBagsBegin + SharedBankBagsSize) - 1;
|
||||||
|
|
||||||
|
const int TradeBagsBegin = 3031;
|
||||||
|
const int TradeBagsSize = invtype::InvTypeTradeSize * ItemBagSize;
|
||||||
|
const int TradeBagsEnd = (TradeBagsBegin + TradeBagsSize) - 1;
|
||||||
|
|
||||||
|
extern const char* InvBagIndexName(int bag_index);
|
||||||
|
|
||||||
|
} /*invbag*/
|
||||||
|
|
||||||
|
namespace invaug {
|
||||||
|
const size_t ItemAugSize = 5;
|
||||||
|
|
||||||
|
extern const char* InvAugIndexName(int aug_index);
|
||||||
|
|
||||||
|
} /*invaug*/
|
||||||
|
|
||||||
|
namespace item {
|
||||||
|
|
||||||
|
} /*item*/
|
||||||
|
|
||||||
|
namespace profile {
|
||||||
|
const size_t TributeSize = invtype::InvTypeTributeSize;
|
||||||
|
|
||||||
|
const size_t BandoliersSize = 20; // number of bandolier instances
|
||||||
|
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
|
||||||
|
|
||||||
|
const size_t PotionBeltSize = 5;
|
||||||
|
|
||||||
|
const size_t SkillArraySize = 100;
|
||||||
|
|
||||||
|
} /*profile*/
|
||||||
|
|
||||||
|
namespace constants {
|
||||||
|
const size_t CharacterCreationLimit = 12;
|
||||||
|
|
||||||
|
const size_t SayLinkBodySize = 50;
|
||||||
|
|
||||||
|
} /*constants*/
|
||||||
|
|
||||||
|
namespace behavior {
|
||||||
|
const bool ConcatenateInvTypeLimbo = true;
|
||||||
|
|
||||||
|
const bool AllowOverLevelEquipment = false;
|
||||||
|
|
||||||
|
const bool AllowEmptyBagInBag = false;
|
||||||
|
const bool AllowClickCastFromBag = false;
|
||||||
|
|
||||||
|
const bool CoinHasWeight = true;
|
||||||
|
|
||||||
|
} /*behavior*/
|
||||||
|
|
||||||
|
namespace skills {
|
||||||
|
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
|
||||||
|
|
||||||
|
} /*skills*/
|
||||||
|
|
||||||
}; /*SoF*/
|
}; /*SoF*/
|
||||||
|
|
||||||
#endif /*COMMON_SOF_CONSTANTS_H*/
|
#endif /*COMMON_SOF_LIMITS_H*/
|
||||||
|
|||||||
@ -705,7 +705,7 @@ struct BandolierItem_Struct
|
|||||||
struct Bandolier_Struct
|
struct Bandolier_Struct
|
||||||
{
|
{
|
||||||
char Name[32];
|
char Name[32];
|
||||||
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
|
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||||
};
|
};
|
||||||
|
|
||||||
//len = 72
|
//len = 72
|
||||||
@ -719,7 +719,7 @@ struct PotionBeltItem_Struct
|
|||||||
//len = 288
|
//len = 288
|
||||||
struct PotionBelt_Struct
|
struct PotionBelt_Struct
|
||||||
{
|
{
|
||||||
PotionBeltItem_Struct Items[consts::POTION_BELT_ITEM_COUNT];
|
PotionBeltItem_Struct Items[profile::PotionBeltSize];
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
|
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
|
||||||
@ -938,7 +938,7 @@ struct PlayerProfile_Struct //23576 Octets
|
|||||||
/*08288*/ uint32 aapoints_spent; // Number of spent AA points
|
/*08288*/ uint32 aapoints_spent; // Number of spent AA points
|
||||||
/*08292*/ uint32 aapoints; // Unspent AA points
|
/*08292*/ uint32 aapoints; // Unspent AA points
|
||||||
/*08296*/ uint8 unknown06160[4];
|
/*08296*/ uint8 unknown06160[4];
|
||||||
/*08300*/ Bandolier_Struct bandoliers[consts::BANDOLIERS_SIZE]; // [6400] bandolier contents
|
/*08300*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // [6400] bandolier contents
|
||||||
/*14700*/ PotionBelt_Struct potionbelt; // [360] potion belt 72 extra octets by adding 1 more belt slot
|
/*14700*/ PotionBelt_Struct potionbelt; // [360] potion belt 72 extra octets by adding 1 more belt slot
|
||||||
/*15060*/ uint8 unknown12852[8];
|
/*15060*/ uint8 unknown12852[8];
|
||||||
/*15068*/ uint32 available_slots;
|
/*15068*/ uint32 available_slots;
|
||||||
|
|||||||
@ -966,18 +966,18 @@ namespace Titanium
|
|||||||
// OUT(unknown06160[4]);
|
// OUT(unknown06160[4]);
|
||||||
|
|
||||||
// Copy bandoliers where server and client indexes converge
|
// Copy bandoliers where server and client indexes converge
|
||||||
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++r) {
|
||||||
OUT_str(bandoliers[r].Name);
|
OUT_str(bandoliers[r].Name);
|
||||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||||
OUT(bandoliers[r].Items[k].ID);
|
OUT(bandoliers[r].Items[k].ID);
|
||||||
OUT(bandoliers[r].Items[k].Icon);
|
OUT(bandoliers[r].Items[k].Icon);
|
||||||
OUT_str(bandoliers[r].Items[k].Name);
|
OUT_str(bandoliers[r].Items[k].Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||||
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++r) {
|
||||||
eq->bandoliers[r].Name[0] = '\0';
|
eq->bandoliers[r].Name[0] = '\0';
|
||||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||||
eq->bandoliers[r].Items[k].ID = 0;
|
eq->bandoliers[r].Items[k].ID = 0;
|
||||||
eq->bandoliers[r].Items[k].Icon = 0;
|
eq->bandoliers[r].Items[k].Icon = 0;
|
||||||
eq->bandoliers[r].Items[k].Name[0] = '\0';
|
eq->bandoliers[r].Items[k].Name[0] = '\0';
|
||||||
@ -987,13 +987,13 @@ namespace Titanium
|
|||||||
// OUT(unknown07444[5120]);
|
// OUT(unknown07444[5120]);
|
||||||
|
|
||||||
// Copy potion belt where server and client indexes converge
|
// Copy potion belt where server and client indexes converge
|
||||||
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
|
||||||
OUT(potionbelt.Items[r].ID);
|
OUT(potionbelt.Items[r].ID);
|
||||||
OUT(potionbelt.Items[r].Icon);
|
OUT(potionbelt.Items[r].Icon);
|
||||||
OUT_str(potionbelt.Items[r].Name);
|
OUT_str(potionbelt.Items[r].Name);
|
||||||
}
|
}
|
||||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||||
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
|
||||||
eq->potionbelt.Items[r].ID = 0;
|
eq->potionbelt.Items[r].ID = 0;
|
||||||
eq->potionbelt.Items[r].Icon = 0;
|
eq->potionbelt.Items[r].Icon = 0;
|
||||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||||
@ -2325,7 +2325,7 @@ namespace Titanium
|
|||||||
ob << StringFormat("%.*s\"", depth, protection); // Quotes (and protection, if needed) around static data
|
ob << StringFormat("%.*s\"", depth, protection); // Quotes (and protection, if needed) around static data
|
||||||
|
|
||||||
// Sub data
|
// Sub data
|
||||||
for (int index = SUB_INDEX_BEGIN; index < consts::ITEM_CONTAINER_SIZE; ++index) {
|
for (int index = SUB_INDEX_BEGIN; index < invbag::ItemBagSize; ++index) {
|
||||||
ob << '|';
|
ob << '|';
|
||||||
|
|
||||||
ItemInst* sub = inst->GetItem(index);
|
ItemInst* sub = inst->GetItem(index);
|
||||||
@ -2373,7 +2373,7 @@ namespace Titanium
|
|||||||
|
|
||||||
static inline void ServerToTitaniumTextLink(std::string& titaniumTextLink, const std::string& serverTextLink)
|
static inline void ServerToTitaniumTextLink(std::string& titaniumTextLink, const std::string& serverTextLink)
|
||||||
{
|
{
|
||||||
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||||
titaniumTextLink = serverTextLink;
|
titaniumTextLink = serverTextLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2413,7 +2413,7 @@ namespace Titanium
|
|||||||
|
|
||||||
static inline void TitaniumToServerTextLink(std::string& serverTextLink, const std::string& titaniumTextLink)
|
static inline void TitaniumToServerTextLink(std::string& serverTextLink, const std::string& titaniumTextLink)
|
||||||
{
|
{
|
||||||
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (titaniumTextLink.find('\x12') == std::string::npos)) {
|
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (titaniumTextLink.find('\x12') == std::string::npos)) {
|
||||||
serverTextLink = titaniumTextLink;
|
serverTextLink = titaniumTextLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2422,7 +2422,7 @@ namespace Titanium
|
|||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
if (segments[segment_iter].length() <= consts::TEXT_LINK_BODY_LENGTH) {
|
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
|
||||||
serverTextLink.append(segments[segment_iter]);
|
serverTextLink.append(segments[segment_iter]);
|
||||||
// TODO: log size mismatch error
|
// TODO: log size mismatch error
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -16,3 +16,238 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "titanium_limits.h"
|
||||||
|
|
||||||
|
#include "../string_util.h"
|
||||||
|
|
||||||
|
|
||||||
|
size_t Titanium::invtype::InvTypeSize(int inv_type)
|
||||||
|
{
|
||||||
|
switch (inv_type) {
|
||||||
|
case invtype::InvTypePossessions:
|
||||||
|
return invtype::InvTypePossessionsSize;
|
||||||
|
case invtype::InvTypeBank:
|
||||||
|
return invtype::InvTypeBankSize;
|
||||||
|
case invtype::InvTypeSharedBank:
|
||||||
|
return invtype::InvTypeSharedBankSize;
|
||||||
|
case invtype::InvTypeTrade:
|
||||||
|
return invtype::InvTypeTradeSize;
|
||||||
|
case invtype::InvTypeWorld:
|
||||||
|
return invtype::InvTypeWorldSize;
|
||||||
|
case invtype::InvTypeLimbo:
|
||||||
|
return invtype::InvTypeLimboSize;
|
||||||
|
case invtype::InvTypeTribute:
|
||||||
|
return invtype::InvTypeTributeSize;
|
||||||
|
case invtype::InvTypeGuildTribute:
|
||||||
|
return invtype::InvTypeGuildTributeSize;
|
||||||
|
case invtype::InvTypeMerchant:
|
||||||
|
return invtype::InvTypeMerchantSize;
|
||||||
|
case invtype::InvTypeCorpse:
|
||||||
|
return invtype::InvTypeCorpseSize;
|
||||||
|
case invtype::InvTypeBazaar:
|
||||||
|
return invtype::InvTypeBazaarSize;
|
||||||
|
case invtype::InvTypeInspect:
|
||||||
|
return invtype::InvTypeInspectSize;
|
||||||
|
case invtype::InvTypeViewMODPC:
|
||||||
|
return invtype::InvTypeViewMODPCSize;
|
||||||
|
case invtype::InvTypeViewMODBank:
|
||||||
|
return invtype::InvTypeViewMODBankSize;
|
||||||
|
case invtype::InvTypeViewMODSharedBank:
|
||||||
|
return invtype::InvTypeViewMODSharedBankSize;
|
||||||
|
case invtype::InvTypeViewMODLimbo:
|
||||||
|
return invtype::InvTypeViewMODLimboSize;
|
||||||
|
case invtype::InvTypeAltStorage:
|
||||||
|
return invtype::InvTypeAltStorageSize;
|
||||||
|
case invtype::InvTypeArchived:
|
||||||
|
return invtype::InvTypeArchivedSize;
|
||||||
|
case invtype::InvTypeOther:
|
||||||
|
return invtype::InvTypeOtherSize;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* Titanium::invtype::InvTypeName(int inv_type)
|
||||||
|
{
|
||||||
|
switch (inv_type) {
|
||||||
|
case invtype::InvTypeInvalid:
|
||||||
|
return "Invalid Type";
|
||||||
|
case invtype::InvTypePossessions:
|
||||||
|
return "Possessions";
|
||||||
|
case invtype::InvTypeBank:
|
||||||
|
return "Bank";
|
||||||
|
case invtype::InvTypeSharedBank:
|
||||||
|
return "Shared Bank";
|
||||||
|
case invtype::InvTypeTrade:
|
||||||
|
return "Trade";
|
||||||
|
case invtype::InvTypeWorld:
|
||||||
|
return "World";
|
||||||
|
case invtype::InvTypeLimbo:
|
||||||
|
return "Limbo";
|
||||||
|
case invtype::InvTypeTribute:
|
||||||
|
return "Tribute";
|
||||||
|
case invtype::InvTypeGuildTribute:
|
||||||
|
return "Guild Tribute";
|
||||||
|
case invtype::InvTypeMerchant:
|
||||||
|
return "Merchant";
|
||||||
|
case invtype::InvTypeCorpse:
|
||||||
|
return "Corpse";
|
||||||
|
case invtype::InvTypeBazaar:
|
||||||
|
return "Bazaar";
|
||||||
|
case invtype::InvTypeInspect:
|
||||||
|
return "Inspect";
|
||||||
|
case invtype::InvTypeViewMODPC:
|
||||||
|
return "View MOD PC";
|
||||||
|
case invtype::InvTypeViewMODBank:
|
||||||
|
return "View MOD Bank";
|
||||||
|
case invtype::InvTypeViewMODSharedBank:
|
||||||
|
return "View MOD Shared Bank";
|
||||||
|
case invtype::InvTypeViewMODLimbo:
|
||||||
|
return "View MOD Limbo";
|
||||||
|
case invtype::InvTypeAltStorage:
|
||||||
|
return "Alt Storage";
|
||||||
|
case invtype::InvTypeArchived:
|
||||||
|
return "Archived";
|
||||||
|
case invtype::InvTypeOther:
|
||||||
|
return "Other";
|
||||||
|
default:
|
||||||
|
return "Unknown Type";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* Titanium::invslot::InvPossessionsSlotName(int inv_slot)
|
||||||
|
{
|
||||||
|
switch (inv_slot) {
|
||||||
|
case invslot::InvSlotInvalid:
|
||||||
|
return "Invalid Slot";
|
||||||
|
case invslot::PossessionsCharm:
|
||||||
|
return "Charm";
|
||||||
|
case invslot::PossessionsEar1:
|
||||||
|
return "Ear 1";
|
||||||
|
case invslot::PossessionsHead:
|
||||||
|
return "Head";
|
||||||
|
case invslot::PossessionsFace:
|
||||||
|
return "Face";
|
||||||
|
case invslot::PossessionsEar2:
|
||||||
|
return "Ear 2";
|
||||||
|
case invslot::PossessionsNeck:
|
||||||
|
return "Neck";
|
||||||
|
case invslot::PossessionsShoulders:
|
||||||
|
return "Shoulders";
|
||||||
|
case invslot::PossessionsArms:
|
||||||
|
return "Arms";
|
||||||
|
case invslot::PossessionsBack:
|
||||||
|
return "Back";
|
||||||
|
case invslot::PossessionsWrist1:
|
||||||
|
return "Wrist 1";
|
||||||
|
case invslot::PossessionsWrist2:
|
||||||
|
return "Wrist 2";
|
||||||
|
case invslot::PossessionsRange:
|
||||||
|
return "Range";
|
||||||
|
case invslot::PossessionsHands:
|
||||||
|
return "Hands";
|
||||||
|
case invslot::PossessionsPrimary:
|
||||||
|
return "Primary";
|
||||||
|
case invslot::PossessionsSecondary:
|
||||||
|
return "Secondary";
|
||||||
|
case invslot::PossessionsFinger1:
|
||||||
|
return "Finger 1";
|
||||||
|
case invslot::PossessionsFinger2:
|
||||||
|
return "Finger 2";
|
||||||
|
case invslot::PossessionsChest:
|
||||||
|
return "Chest";
|
||||||
|
case invslot::PossessionsLegs:
|
||||||
|
return "Legs";
|
||||||
|
case invslot::PossessionsFeet:
|
||||||
|
return "Feet";
|
||||||
|
case invslot::PossessionsWaist:
|
||||||
|
return "Waist";
|
||||||
|
case invslot::PossessionsAmmo:
|
||||||
|
return "Ammo";
|
||||||
|
case invslot::PossessionsGeneral1:
|
||||||
|
return "General 1";
|
||||||
|
case invslot::PossessionsGeneral2:
|
||||||
|
return "General 2";
|
||||||
|
case invslot::PossessionsGeneral3:
|
||||||
|
return "General 3";
|
||||||
|
case invslot::PossessionsGeneral4:
|
||||||
|
return "General 4";
|
||||||
|
case invslot::PossessionsGeneral5:
|
||||||
|
return "General 5";
|
||||||
|
case invslot::PossessionsGeneral6:
|
||||||
|
return "General 6";
|
||||||
|
case invslot::PossessionsGeneral7:
|
||||||
|
return "General 7";
|
||||||
|
case invslot::PossessionsGeneral8:
|
||||||
|
return "General 8";
|
||||||
|
case invslot::PossessionsCursor:
|
||||||
|
return "Cursor";
|
||||||
|
default:
|
||||||
|
return "Unknown Slot";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* Titanium::invslot::InvCorpseSlotName(int inv_slot)
|
||||||
|
{
|
||||||
|
if (!invtype::InvTypeSize(invtype::InvTypeCorpse) || inv_slot == invslot::InvSlotInvalid)
|
||||||
|
return "Invalid Slot";
|
||||||
|
|
||||||
|
// needs work
|
||||||
|
if ((size_t)(inv_slot + 1) < invslot::CorpseBegin || (size_t)(inv_slot + 1) >= invslot::CorpseEnd)
|
||||||
|
return "Unknown Slot";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Slot %i", (inv_slot + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* Titanium::invslot::InvSlotName(int inv_type, int inv_slot)
|
||||||
|
{
|
||||||
|
if (inv_type == invtype::InvTypePossessions)
|
||||||
|
return invslot::InvPossessionsSlotName(inv_slot);
|
||||||
|
else if (inv_type == invtype::InvTypeCorpse)
|
||||||
|
return invslot::InvCorpseSlotName(inv_slot);
|
||||||
|
|
||||||
|
size_t type_size = invtype::InvTypeSize(inv_type);
|
||||||
|
|
||||||
|
if (!type_size || inv_slot == invslot::InvSlotInvalid)
|
||||||
|
return "Invalid Slot";
|
||||||
|
|
||||||
|
if ((size_t)(inv_slot + 1) >= type_size)
|
||||||
|
return "Unknown Slot";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Slot %i", (inv_slot + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* Titanium::invbag::InvBagIndexName(int bag_index)
|
||||||
|
{
|
||||||
|
if (bag_index == invbag::InvBagInvalid)
|
||||||
|
return "Invalid Bag";
|
||||||
|
|
||||||
|
if ((size_t)bag_index >= invbag::ItemBagSize)
|
||||||
|
return "Unknown Bag";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Bag %i", (bag_index + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* Titanium::invaug::InvAugIndexName(int aug_index)
|
||||||
|
{
|
||||||
|
if (aug_index == invaug::InvAugInvalid)
|
||||||
|
return "Invalid Augment";
|
||||||
|
|
||||||
|
if ((size_t)aug_index >= invaug::ItemAugSize)
|
||||||
|
return "Unknown Augment";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Augment %i", (aug_index + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|||||||
@ -17,177 +17,283 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef COMMON_TITANIUM_CONSTANTS_H
|
#ifndef COMMON_TITANIUM_LIMITS_H
|
||||||
#define COMMON_TITANIUM_CONSTANTS_H
|
#define COMMON_TITANIUM_LIMITS_H
|
||||||
|
|
||||||
#include "../types.h"
|
#include "../types.h"
|
||||||
|
#include "../client_version.h"
|
||||||
|
#include "../skills.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Titanium
|
namespace Titanium
|
||||||
{
|
{
|
||||||
namespace inventory {
|
enum : int { Invalid = -1, Null, Safety };
|
||||||
typedef enum : int16 {
|
|
||||||
TypePossessions = 0,
|
|
||||||
TypeBank,
|
|
||||||
TypeSharedBank,
|
|
||||||
TypeTrade,
|
|
||||||
TypeWorld,
|
|
||||||
TypeLimbo,
|
|
||||||
TypeTribute,
|
|
||||||
TypeTrophyTribute,
|
|
||||||
TypeGuildTribute,
|
|
||||||
TypeMerchant,
|
|
||||||
TypeDeleted,
|
|
||||||
TypeCorpse,
|
|
||||||
TypeBazaar,
|
|
||||||
TypeInspect,
|
|
||||||
TypeRealEstate,
|
|
||||||
TypeViewMODPC,
|
|
||||||
TypeViewMODBank,
|
|
||||||
TypeViewMODSharedBank,
|
|
||||||
TypeViewMODLimbo,
|
|
||||||
TypeAltStorage,
|
|
||||||
TypeArchived,
|
|
||||||
TypeMail,
|
|
||||||
TypeGuildTrophyTribute,
|
|
||||||
TypeOther,
|
|
||||||
TypeCount
|
|
||||||
} InventoryTypes;
|
|
||||||
|
|
||||||
typedef enum : int16 {
|
enum : bool { False = false, True = true };
|
||||||
SlotCharm = 0,
|
|
||||||
SlotEar1,
|
// pre-declarations
|
||||||
SlotHead,
|
namespace invtype {
|
||||||
SlotFace,
|
inline EQEmu::versions::ClientVersion InvTypeRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||||
SlotEar2,
|
|
||||||
SlotNeck,
|
|
||||||
SlotShoulders,
|
|
||||||
SlotArms,
|
|
||||||
SlotBack,
|
|
||||||
SlotWrist1,
|
|
||||||
SlotWrist2,
|
|
||||||
SlotRange,
|
|
||||||
SlotHands,
|
|
||||||
SlotPrimary,
|
|
||||||
SlotSecondary,
|
|
||||||
SlotFinger1,
|
|
||||||
SlotFinger2,
|
|
||||||
SlotChest,
|
|
||||||
SlotLegs,
|
|
||||||
SlotFeet,
|
|
||||||
SlotWaist,
|
|
||||||
SlotAmmo,
|
|
||||||
SlotGeneral1,
|
|
||||||
SlotGeneral2,
|
|
||||||
SlotGeneral3,
|
|
||||||
SlotGeneral4,
|
|
||||||
SlotGeneral5,
|
|
||||||
SlotGeneral6,
|
|
||||||
SlotGeneral7,
|
|
||||||
SlotGeneral8,
|
|
||||||
SlotCursor,
|
|
||||||
SlotCount,
|
|
||||||
SlotEquipmentBegin = SlotCharm,
|
|
||||||
SlotEquipmentEnd = SlotAmmo,
|
|
||||||
SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1),
|
|
||||||
SlotGeneralBegin = SlotGeneral1,
|
|
||||||
SlotGeneralEnd = SlotGeneral8,
|
|
||||||
SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1)
|
|
||||||
} PossessionsSlots;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace consts {
|
enum : int { InvTypeInvalid = -1, InvTypeBegin };
|
||||||
static const size_t CHARACTER_CREATION_LIMIT = 8; // Hard-coded in client - DO NOT ALTER
|
|
||||||
|
|
||||||
static const uint16 TYPE_POSSESSIONS_SIZE = inventory::SlotCount;
|
enum InventoryType : int {
|
||||||
static const uint16 TYPE_BANK_SIZE = 16;
|
InvTypePossessions = InvTypeBegin,
|
||||||
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
|
InvTypeBank,
|
||||||
static const uint16 TYPE_TRADE_SIZE = 8;
|
InvTypeSharedBank,
|
||||||
static const uint16 TYPE_WORLD_SIZE = 10;
|
InvTypeTrade,
|
||||||
static const uint16 TYPE_LIMBO_SIZE = 36;
|
InvTypeWorld,
|
||||||
static const uint16 TYPE_TRIBUTE_SIZE = 0; //?
|
InvTypeLimbo,
|
||||||
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
|
InvTypeTribute,
|
||||||
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
|
InvTypeGuildTribute,
|
||||||
static const uint16 TYPE_MERCHANT_SIZE = 0;
|
InvTypeMerchant,
|
||||||
static const uint16 TYPE_DELETED_SIZE = 0;
|
InvTypeCorpse,
|
||||||
static const uint16 TYPE_CORPSE_SIZE = inventory::SlotCount;
|
InvTypeBazaar,
|
||||||
static const uint16 TYPE_BAZAAR_SIZE = 80;
|
InvTypeInspect,
|
||||||
static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount;
|
InvTypeViewMODPC,
|
||||||
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
|
InvTypeViewMODBank,
|
||||||
static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE;
|
InvTypeViewMODSharedBank,
|
||||||
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE;
|
InvTypeViewMODLimbo,
|
||||||
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE;
|
InvTypeAltStorage,
|
||||||
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE;
|
InvTypeArchived,
|
||||||
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
|
InvTypeOther,
|
||||||
static const uint16 TYPE_ARCHIVED_SIZE = 0;
|
InvTypeCount
|
||||||
static const uint16 TYPE_MAIL_SIZE = 0;
|
};
|
||||||
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_KRONO_SIZE = NOT_USED;
|
|
||||||
static const uint16 TYPE_OTHER_SIZE = 0;
|
|
||||||
|
|
||||||
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
|
} /*invtype*/
|
||||||
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
|
|
||||||
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
|
|
||||||
|
|
||||||
static const int16 GENERAL_BEGIN = inventory::SlotGeneral1;
|
namespace invslot {
|
||||||
static const int16 GENERAL_END = inventory::SlotGeneral8;
|
inline EQEmu::versions::ClientVersion InvSlotRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||||
static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount;
|
|
||||||
static const int16 GENERAL_BAGS_BEGIN = 251;
|
|
||||||
static const int16 GENERAL_BAGS_END_OFFSET = 79;
|
|
||||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 CURSOR = inventory::SlotCursor;
|
enum : int { InvSlotInvalid = -1, InvSlotBegin };
|
||||||
static const int16 CURSOR_BAG_BEGIN = 331;
|
|
||||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
|
||||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 BANK_BEGIN = 2000;
|
enum PossessionsSlot : int {
|
||||||
static const int16 BANK_END = 2015;
|
PossessionsCharm = InvSlotBegin,
|
||||||
static const int16 BANK_BAGS_BEGIN = 2031;
|
PossessionsEar1,
|
||||||
static const int16 BANK_BAGS_END_OFFSET = 159;
|
PossessionsHead,
|
||||||
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
|
PossessionsFace,
|
||||||
|
PossessionsEar2,
|
||||||
|
PossessionsNeck,
|
||||||
|
PossessionsShoulders,
|
||||||
|
PossessionsArms,
|
||||||
|
PossessionsBack,
|
||||||
|
PossessionsWrist1,
|
||||||
|
PossessionsWrist2,
|
||||||
|
PossessionsRange,
|
||||||
|
PossessionsHands,
|
||||||
|
PossessionsPrimary,
|
||||||
|
PossessionsSecondary,
|
||||||
|
PossessionsFinger1,
|
||||||
|
PossessionsFinger2,
|
||||||
|
PossessionsChest,
|
||||||
|
PossessionsLegs,
|
||||||
|
PossessionsFeet,
|
||||||
|
PossessionsWaist,
|
||||||
|
PossessionsAmmo,
|
||||||
|
PossessionsGeneral1,
|
||||||
|
PossessionsGeneral2,
|
||||||
|
PossessionsGeneral3,
|
||||||
|
PossessionsGeneral4,
|
||||||
|
PossessionsGeneral5,
|
||||||
|
PossessionsGeneral6,
|
||||||
|
PossessionsGeneral7,
|
||||||
|
PossessionsGeneral8,
|
||||||
|
PossessionsCursor,
|
||||||
|
PossessionsCount
|
||||||
|
};
|
||||||
|
|
||||||
static const int16 SHARED_BANK_BEGIN = 2500;
|
const int EquipmentBegin = PossessionsCharm;
|
||||||
static const int16 SHARED_BANK_END = 2501;
|
const int EquipmentEnd = PossessionsAmmo;
|
||||||
static const int16 SHARED_BANK_BAGS_BEGIN = 2531;
|
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
|
||||||
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
|
|
||||||
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 TRADE_BEGIN = 3000;
|
const int GeneralBegin = PossessionsGeneral1;
|
||||||
static const int16 TRADE_END = 3007;
|
const int GeneralEnd = PossessionsGeneral8;
|
||||||
static const int16 TRADE_NPC_END = 3003;
|
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
|
||||||
static const int16 TRADE_BAGS_BEGIN = 3031;
|
|
||||||
static const int16 TRADE_BAGS_END_OFFSET = 79;
|
|
||||||
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 WORLD_BEGIN = 4000;
|
} /*invslot*/
|
||||||
static const int16 WORLD_END = 4009;
|
|
||||||
|
|
||||||
static const int16 TRIBUTE_BEGIN = 400;
|
namespace invbag {
|
||||||
static const int16 TRIBUTE_END = 404;
|
inline EQEmu::versions::ClientVersion InvBagRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
|
enum : int { InvBagInvalid = -1, InvBagBegin };
|
||||||
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
|
|
||||||
|
|
||||||
static const uint16 ITEM_COMMON_SIZE = 5;
|
} /*invbag*/
|
||||||
static const uint16 ITEM_CONTAINER_SIZE = 10;
|
|
||||||
|
|
||||||
static const size_t BANDOLIERS_SIZE = 4; // number of bandolier instances
|
namespace invaug {
|
||||||
static const size_t BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
inline EQEmu::versions::ClientVersion InvAugRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
static const size_t POTION_BELT_ITEM_COUNT = 4;
|
enum : int { InvAugInvalid = -1, InvAugBegin };
|
||||||
|
|
||||||
static const size_t TEXT_LINK_BODY_LENGTH = 45;
|
} /*invaug*/
|
||||||
|
|
||||||
static const size_t PLAYER_PROFILE_SKILL_MAX = SkillFrenzy;
|
namespace item {
|
||||||
}
|
inline EQEmu::versions::ClientVersion ItemRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
namespace limits {
|
enum ItemPacketType : int {
|
||||||
static const bool ALLOWS_EMPTY_BAG_IN_BAG = false;
|
ItemPacketMerchant = 100,
|
||||||
static const bool ALLOWS_CLICK_CAST_FROM_BAG = false;
|
ItemPacketTradeView = 101,
|
||||||
static const bool COIN_HAS_WEIGHT = true;
|
ItemPacketLoot = 102,
|
||||||
}
|
ItemPacketTrade = 103,
|
||||||
|
ItemPacketCharInventory = 105,
|
||||||
|
ItemPacketLimbo = 106,
|
||||||
|
ItemPacketWorldContainer = 107,
|
||||||
|
ItemPacketTributeItem = 108,
|
||||||
|
ItemPacketGuildTribute = 109,
|
||||||
|
ItemPacketCharmUpdate = 110
|
||||||
|
};
|
||||||
|
|
||||||
|
} /*item*/
|
||||||
|
|
||||||
|
namespace profile {
|
||||||
|
inline EQEmu::versions::ClientVersion ProfileRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
|
} /*profile*/
|
||||||
|
|
||||||
|
namespace constants {
|
||||||
|
inline EQEmu::versions::ClientVersion ConstantsRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
|
} /*constants*/
|
||||||
|
|
||||||
|
namespace behavior {
|
||||||
|
inline EQEmu::versions::ClientVersion BehaviorRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
|
} /*behavior*/
|
||||||
|
|
||||||
|
namespace skills {
|
||||||
|
inline EQEmu::versions::ClientVersion SkillsRef() { return EQEmu::versions::ClientVersion::Titanium; }
|
||||||
|
|
||||||
|
} /*skills*/
|
||||||
|
|
||||||
|
|
||||||
|
// declarations
|
||||||
|
namespace invtype {
|
||||||
|
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
|
||||||
|
const size_t InvTypeBankSize = 16;
|
||||||
|
const size_t InvTypeSharedBankSize = 2;
|
||||||
|
const size_t InvTypeTradeSize = 8;
|
||||||
|
const size_t InvTypeWorldSize = 10;
|
||||||
|
const size_t InvTypeLimboSize = 36;
|
||||||
|
const size_t InvTypeTributeSize = 5;
|
||||||
|
const size_t InvTypeGuildTributeSize = 0;//unknown
|
||||||
|
const size_t InvTypeMerchantSize = 80;
|
||||||
|
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
|
||||||
|
const size_t InvTypeBazaarSize = 80;
|
||||||
|
const size_t InvTypeInspectSize = invslot::EquipmentCount;
|
||||||
|
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
|
||||||
|
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
|
||||||
|
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
|
||||||
|
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
|
||||||
|
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
|
||||||
|
const size_t InvTypeArchivedSize = 0;//unknown
|
||||||
|
const size_t InvTypeOtherSize = 0;//unknown
|
||||||
|
|
||||||
|
const size_t NPCTradeSize = 4;
|
||||||
|
|
||||||
|
extern size_t InvTypeSize(int inv_type);
|
||||||
|
extern const char* InvTypeName(int inv_type);
|
||||||
|
|
||||||
|
} /*invtype*/
|
||||||
|
|
||||||
|
namespace invslot {
|
||||||
|
const int BankBegin = 2000;
|
||||||
|
const int BankEnd = (BankBegin + invtype::InvTypeBankSize) - 1;
|
||||||
|
|
||||||
|
const int SharedBankBegin = 2500;
|
||||||
|
const int SharedBankEnd = (SharedBankBegin + invtype::InvTypeSharedBankSize) - 1;
|
||||||
|
|
||||||
|
const int TradeBegin = 3000;
|
||||||
|
const int TradeEnd = (TradeBegin + invtype::InvTypeTradeSize) - 1;
|
||||||
|
const int TradeNPCEnd = 3003;
|
||||||
|
|
||||||
|
const int WorldBegin = 4000;
|
||||||
|
const int WorldEnd = (WorldBegin + invtype::InvTypeWorldSize) - 1;
|
||||||
|
|
||||||
|
const int TributeBegin = 400;
|
||||||
|
const int TributeEnd = 404;
|
||||||
|
|
||||||
|
const int CorpseBegin = PossessionsGeneral1;
|
||||||
|
const int CorpseEnd = PossessionsGeneral1 + PossessionsCursor;
|
||||||
|
|
||||||
|
extern const char* InvPossessionsSlotName(int inv_slot);
|
||||||
|
extern const char* InvCorpseSlotName(int inv_slot);
|
||||||
|
extern const char* InvSlotName(int inv_type, int inv_slot);
|
||||||
|
|
||||||
|
} /*invslot*/
|
||||||
|
|
||||||
|
namespace invbag {
|
||||||
|
const size_t ItemBagSize = 10;
|
||||||
|
|
||||||
|
const int GeneralBagsBegin = 251;
|
||||||
|
const int GeneralBagsSize = invslot::GeneralCount * ItemBagSize;
|
||||||
|
const int GeneralBagsEnd = (GeneralBagsBegin + GeneralBagsSize) - 1;
|
||||||
|
|
||||||
|
const int CursorBagBegin = 331;
|
||||||
|
const int CursorBagSize = ItemBagSize;
|
||||||
|
const int CursorBagEnd = (CursorBagBegin + CursorBagSize) - 1;
|
||||||
|
|
||||||
|
const int BankBagsBegin = 2031;
|
||||||
|
const int BankBagsSize = (invtype::InvTypeBankSize * ItemBagSize);
|
||||||
|
const int BankBagsEnd = (BankBagsBegin + BankBagsSize) - 1;
|
||||||
|
|
||||||
|
const int SharedBankBagsBegin = 2531;
|
||||||
|
const int SharedBankBagsSize = invtype::InvTypeSharedBankSize * ItemBagSize;
|
||||||
|
const int SharedBankBagsEnd = (SharedBankBagsBegin + SharedBankBagsSize) - 1;
|
||||||
|
|
||||||
|
const int TradeBagsBegin = 3031;
|
||||||
|
const int TradeBagsSize = invtype::InvTypeTradeSize * ItemBagSize;
|
||||||
|
const int TradeBagsEnd = (TradeBagsBegin + TradeBagsSize) - 1;
|
||||||
|
|
||||||
|
extern const char* InvBagIndexName(int bag_index);
|
||||||
|
|
||||||
|
} /*invbag*/
|
||||||
|
|
||||||
|
namespace invaug {
|
||||||
|
const size_t ItemAugSize = 5;
|
||||||
|
|
||||||
|
extern const char* InvAugIndexName(int aug_index);
|
||||||
|
|
||||||
|
} /*invaug*/
|
||||||
|
|
||||||
|
namespace item {
|
||||||
|
|
||||||
|
} /*item*/
|
||||||
|
|
||||||
|
namespace profile {
|
||||||
|
const size_t TributeSize = invtype::InvTypeTributeSize;
|
||||||
|
|
||||||
|
const size_t BandoliersSize = 4; // number of bandolier instances
|
||||||
|
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
|
||||||
|
|
||||||
|
const size_t PotionBeltSize = 4;
|
||||||
|
|
||||||
|
const size_t SkillArraySize = 100;
|
||||||
|
|
||||||
|
} /*profile*/
|
||||||
|
|
||||||
|
namespace constants {
|
||||||
|
const size_t CharacterCreationLimit = 8; // Hard-coded in client - DO NOT ALTER
|
||||||
|
|
||||||
|
const size_t SayLinkBodySize = 45;
|
||||||
|
|
||||||
|
} /*constants*/
|
||||||
|
|
||||||
|
namespace behavior {
|
||||||
|
const bool ConcatenateInvTypeLimbo = true;
|
||||||
|
|
||||||
|
const bool AllowOverLevelEquipment = false;
|
||||||
|
|
||||||
|
const bool AllowEmptyBagInBag = false;
|
||||||
|
const bool AllowClickCastFromBag = false;
|
||||||
|
|
||||||
|
const bool CoinHasWeight = true;
|
||||||
|
|
||||||
|
} /*behavior*/
|
||||||
|
|
||||||
|
namespace skills {
|
||||||
|
const size_t LastUsableSkill = EQEmu::skills::SkillFrenzy;
|
||||||
|
|
||||||
|
} /*skills*/
|
||||||
|
|
||||||
}; /*Titanium*/
|
}; /*Titanium*/
|
||||||
|
|
||||||
#endif /*COMMON_TITANIUM_CONSTANTS_H*/
|
#endif /*COMMON_TITANIUM_LIMITS_H*/
|
||||||
|
|||||||
@ -633,7 +633,7 @@ struct BandolierItem_Struct
|
|||||||
struct Bandolier_Struct
|
struct Bandolier_Struct
|
||||||
{
|
{
|
||||||
char Name[32];
|
char Name[32];
|
||||||
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
|
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||||
};
|
};
|
||||||
|
|
||||||
//len = 72
|
//len = 72
|
||||||
@ -647,7 +647,7 @@ struct PotionBeltItem_Struct
|
|||||||
//len = 288
|
//len = 288
|
||||||
struct PotionBelt_Struct
|
struct PotionBelt_Struct
|
||||||
{
|
{
|
||||||
PotionBeltItem_Struct Items[consts::POTION_BELT_ITEM_COUNT];
|
PotionBeltItem_Struct Items[profile::PotionBeltSize];
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
|
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
|
||||||
@ -851,7 +851,7 @@ struct PlayerProfile_Struct
|
|||||||
/*06152*/ uint32 aapoints_spent; // Number of spent AA points
|
/*06152*/ uint32 aapoints_spent; // Number of spent AA points
|
||||||
/*06156*/ uint32 aapoints; // Unspent AA points
|
/*06156*/ uint32 aapoints; // Unspent AA points
|
||||||
/*06160*/ uint8 unknown06160[4];
|
/*06160*/ uint8 unknown06160[4];
|
||||||
/*06164*/ Bandolier_Struct bandoliers[consts::BANDOLIERS_SIZE]; // bandolier contents
|
/*06164*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // bandolier contents
|
||||||
/*07444*/ uint8 unknown07444[5120];
|
/*07444*/ uint8 unknown07444[5120];
|
||||||
/*12564*/ PotionBelt_Struct potionbelt; // potion belt
|
/*12564*/ PotionBelt_Struct potionbelt; // potion belt
|
||||||
/*12852*/ uint8 unknown12852[8];
|
/*12852*/ uint8 unknown12852[8];
|
||||||
|
|||||||
@ -1891,18 +1891,18 @@ namespace UF
|
|||||||
// OUT(unknown06160[4]);
|
// OUT(unknown06160[4]);
|
||||||
|
|
||||||
// Copy bandoliers where server and client indexes converge
|
// Copy bandoliers where server and client indexes converge
|
||||||
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < consts::BANDOLIERS_SIZE; ++r) {
|
for (r = 0; r < EQEmu::legacy::BANDOLIERS_SIZE && r < profile::BandoliersSize; ++r) {
|
||||||
OUT_str(bandoliers[r].Name);
|
OUT_str(bandoliers[r].Name);
|
||||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||||
OUT(bandoliers[r].Items[k].ID);
|
OUT(bandoliers[r].Items[k].ID);
|
||||||
OUT(bandoliers[r].Items[k].Icon);
|
OUT(bandoliers[r].Items[k].Icon);
|
||||||
OUT_str(bandoliers[r].Items[k].Name);
|
OUT_str(bandoliers[r].Items[k].Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
// Nullify bandoliers where server and client indexes diverge, with a client bias
|
||||||
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < consts::BANDOLIERS_SIZE; ++r) {
|
for (r = EQEmu::legacy::BANDOLIERS_SIZE; r < profile::BandoliersSize; ++r) {
|
||||||
eq->bandoliers[r].Name[0] = '\0';
|
eq->bandoliers[r].Name[0] = '\0';
|
||||||
for (uint32 k = 0; k < consts::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
|
for (uint32 k = 0; k < profile::BandolierItemCount; ++k) { // Will need adjusting if 'server != client' is ever true
|
||||||
eq->bandoliers[r].Items[k].ID = 0;
|
eq->bandoliers[r].Items[k].ID = 0;
|
||||||
eq->bandoliers[r].Items[k].Icon = 0;
|
eq->bandoliers[r].Items[k].Icon = 0;
|
||||||
eq->bandoliers[r].Items[k].Name[0] = '\0';
|
eq->bandoliers[r].Items[k].Name[0] = '\0';
|
||||||
@ -1912,13 +1912,13 @@ namespace UF
|
|||||||
// OUT(unknown07444[5120]);
|
// OUT(unknown07444[5120]);
|
||||||
|
|
||||||
// Copy potion belt where server and client indexes converge
|
// Copy potion belt where server and client indexes converge
|
||||||
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
for (r = 0; r < EQEmu::legacy::POTION_BELT_ITEM_COUNT && r < profile::PotionBeltSize; ++r) {
|
||||||
OUT(potionbelt.Items[r].ID);
|
OUT(potionbelt.Items[r].ID);
|
||||||
OUT(potionbelt.Items[r].Icon);
|
OUT(potionbelt.Items[r].Icon);
|
||||||
OUT_str(potionbelt.Items[r].Name);
|
OUT_str(potionbelt.Items[r].Name);
|
||||||
}
|
}
|
||||||
// Nullify potion belt where server and client indexes diverge, with a client bias
|
// Nullify potion belt where server and client indexes diverge, with a client bias
|
||||||
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < consts::POTION_BELT_ITEM_COUNT; ++r) {
|
for (r = EQEmu::legacy::POTION_BELT_ITEM_COUNT; r < profile::PotionBeltSize; ++r) {
|
||||||
eq->potionbelt.Items[r].ID = 0;
|
eq->potionbelt.Items[r].ID = 0;
|
||||||
eq->potionbelt.Items[r].Icon = 0;
|
eq->potionbelt.Items[r].Icon = 0;
|
||||||
eq->potionbelt.Items[r].Name[0] = '\0';
|
eq->potionbelt.Items[r].Name[0] = '\0';
|
||||||
@ -2227,8 +2227,8 @@ namespace UF
|
|||||||
eq->CharCount = emu->CharCount;
|
eq->CharCount = emu->CharCount;
|
||||||
eq->TotalChars = emu->TotalChars;
|
eq->TotalChars = emu->TotalChars;
|
||||||
|
|
||||||
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
|
if (eq->TotalChars > constants::CharacterCreationLimit)
|
||||||
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
|
eq->TotalChars = constants::CharacterCreationLimit;
|
||||||
|
|
||||||
// Special Underfoot adjustment - field should really be 'AdditionalChars' or 'BonusChars'
|
// Special Underfoot adjustment - field should really be 'AdditionalChars' or 'BonusChars'
|
||||||
uint32 adjusted_total = eq->TotalChars - 8; // Yes, it rolls under for '< 8' - probably an int32 field
|
uint32 adjusted_total = eq->TotalChars - 8; // Yes, it rolls under for '< 8' - probably an int32 field
|
||||||
@ -2244,7 +2244,7 @@ namespace UF
|
|||||||
|
|
||||||
size_t names_length = 0;
|
size_t names_length = 0;
|
||||||
size_t character_count = 0;
|
size_t character_count = 0;
|
||||||
for (; character_count < emu->CharCount && character_count < consts::CHARACTER_CREATION_LIMIT; ++character_count) {
|
for (; character_count < emu->CharCount && character_count < constants::CharacterCreationLimit; ++character_count) {
|
||||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||||
names_length += strlen(emu_cse->Name);
|
names_length += strlen(emu_cse->Name);
|
||||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||||
@ -2260,8 +2260,8 @@ namespace UF
|
|||||||
eq->CharCount = character_count;
|
eq->CharCount = character_count;
|
||||||
eq->TotalChars = emu->TotalChars;
|
eq->TotalChars = emu->TotalChars;
|
||||||
|
|
||||||
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
|
if (eq->TotalChars > constants::CharacterCreationLimit)
|
||||||
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
|
eq->TotalChars = constants::CharacterCreationLimit;
|
||||||
|
|
||||||
// Special Underfoot adjustment - field should really be 'AdditionalChars' or 'BonusChars' in this client
|
// Special Underfoot adjustment - field should really be 'AdditionalChars' or 'BonusChars' in this client
|
||||||
uint32 adjusted_total = eq->TotalChars - 8; // Yes, it rolls under for '< 8' - probably an int32 field
|
uint32 adjusted_total = eq->TotalChars - 8; // Yes, it rolls under for '< 8' - probably an int32 field
|
||||||
@ -4020,7 +4020,7 @@ namespace UF
|
|||||||
isbs.augtype = item->AugType;
|
isbs.augtype = item->AugType;
|
||||||
isbs.augrestrict = item->AugRestrict;
|
isbs.augrestrict = item->AugRestrict;
|
||||||
|
|
||||||
for (int index = 0; index < consts::ITEM_COMMON_SIZE; ++index) {
|
for (int index = 0; index < invaug::ItemAugSize; ++index) {
|
||||||
isbs.augslots[index].type = item->AugSlotType[index];
|
isbs.augslots[index].type = item->AugSlotType[index];
|
||||||
isbs.augslots[index].visible = item->AugSlotVisible[index];
|
isbs.augslots[index].visible = item->AugSlotVisible[index];
|
||||||
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
|
isbs.augslots[index].unknown = item->AugSlotUnk2[index];
|
||||||
@ -4254,7 +4254,7 @@ namespace UF
|
|||||||
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
|
else if (serverSlot >= EQEmu::legacy::SHARED_BANK_BAGS_BEGIN && serverSlot <= EQEmu::legacy::SHARED_BANK_BAGS_END)
|
||||||
UnderfootSlot = serverSlot + 1;
|
UnderfootSlot = serverSlot + 1;
|
||||||
else if (serverSlot == EQEmu::legacy::SlotPowerSource)
|
else if (serverSlot == EQEmu::legacy::SlotPowerSource)
|
||||||
UnderfootSlot = inventory::SlotPowerSource;
|
UnderfootSlot = invslot::PossessionsPowerSource;
|
||||||
else
|
else
|
||||||
UnderfootSlot = serverSlot;
|
UnderfootSlot = serverSlot;
|
||||||
|
|
||||||
@ -4271,15 +4271,15 @@ namespace UF
|
|||||||
{
|
{
|
||||||
uint32 ServerSlot = 0;
|
uint32 ServerSlot = 0;
|
||||||
|
|
||||||
if (ufSlot >= inventory::SlotAmmo && ufSlot <= consts::CORPSE_END) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
if (ufSlot >= invslot::PossessionsAmmo && ufSlot <= invslot::CorpseEnd) // Cursor/Ammo/Power Source and Normal Inventory Slots
|
||||||
ServerSlot = ufSlot - 1;
|
ServerSlot = ufSlot - 1;
|
||||||
else if (ufSlot >= consts::GENERAL_BAGS_BEGIN && ufSlot <= consts::CURSOR_BAG_END)
|
else if (ufSlot >= invbag::GeneralBagsBegin && ufSlot <= invbag::CursorBagEnd)
|
||||||
ServerSlot = ufSlot - 11;
|
ServerSlot = ufSlot - 11;
|
||||||
else if (ufSlot >= consts::BANK_BAGS_BEGIN && ufSlot <= consts::BANK_BAGS_END)
|
else if (ufSlot >= invbag::BankBagsBegin && ufSlot <= invbag::BankBagsEnd)
|
||||||
ServerSlot = ufSlot - 1;
|
ServerSlot = ufSlot - 1;
|
||||||
else if (ufSlot >= consts::SHARED_BANK_BAGS_BEGIN && ufSlot <= consts::SHARED_BANK_BAGS_END)
|
else if (ufSlot >= invbag::SharedBankBagsBegin && ufSlot <= invbag::SharedBankBagsEnd)
|
||||||
ServerSlot = ufSlot - 1;
|
ServerSlot = ufSlot - 1;
|
||||||
else if (ufSlot == inventory::SlotPowerSource)
|
else if (ufSlot == invslot::PossessionsPowerSource)
|
||||||
ServerSlot = EQEmu::legacy::SlotPowerSource;
|
ServerSlot = EQEmu::legacy::SlotPowerSource;
|
||||||
else
|
else
|
||||||
ServerSlot = ufSlot;
|
ServerSlot = ufSlot;
|
||||||
@ -4295,7 +4295,7 @@ namespace UF
|
|||||||
|
|
||||||
static inline void ServerToUFTextLink(std::string& ufTextLink, const std::string& serverTextLink)
|
static inline void ServerToUFTextLink(std::string& ufTextLink, const std::string& serverTextLink)
|
||||||
{
|
{
|
||||||
if ((consts::TEXT_LINK_BODY_LENGTH == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
|
||||||
ufTextLink = serverTextLink;
|
ufTextLink = serverTextLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4335,7 +4335,7 @@ namespace UF
|
|||||||
|
|
||||||
static inline void UFToServerTextLink(std::string& serverTextLink, const std::string& ufTextLink)
|
static inline void UFToServerTextLink(std::string& serverTextLink, const std::string& ufTextLink)
|
||||||
{
|
{
|
||||||
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == consts::TEXT_LINK_BODY_LENGTH) || (ufTextLink.find('\x12') == std::string::npos)) {
|
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (ufTextLink.find('\x12') == std::string::npos)) {
|
||||||
serverTextLink = ufTextLink;
|
serverTextLink = ufTextLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4344,7 +4344,7 @@ namespace UF
|
|||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
if (segments[segment_iter].length() <= consts::TEXT_LINK_BODY_LENGTH) {
|
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
|
||||||
serverTextLink.append(segments[segment_iter]);
|
serverTextLink.append(segments[segment_iter]);
|
||||||
// TODO: log size mismatch error
|
// TODO: log size mismatch error
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -16,3 +16,240 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "uf_limits.h"
|
||||||
|
|
||||||
|
#include "../string_util.h"
|
||||||
|
|
||||||
|
|
||||||
|
size_t UF::invtype::InvTypeSize(int inv_type)
|
||||||
|
{
|
||||||
|
switch (inv_type) {
|
||||||
|
case invtype::InvTypePossessions:
|
||||||
|
return invtype::InvTypePossessionsSize;
|
||||||
|
case invtype::InvTypeBank:
|
||||||
|
return invtype::InvTypeBankSize;
|
||||||
|
case invtype::InvTypeSharedBank:
|
||||||
|
return invtype::InvTypeSharedBankSize;
|
||||||
|
case invtype::InvTypeTrade:
|
||||||
|
return invtype::InvTypeTradeSize;
|
||||||
|
case invtype::InvTypeWorld:
|
||||||
|
return invtype::InvTypeWorldSize;
|
||||||
|
case invtype::InvTypeLimbo:
|
||||||
|
return invtype::InvTypeLimboSize;
|
||||||
|
case invtype::InvTypeTribute:
|
||||||
|
return invtype::InvTypeTributeSize;
|
||||||
|
case invtype::InvTypeGuildTribute:
|
||||||
|
return invtype::InvTypeGuildTributeSize;
|
||||||
|
case invtype::InvTypeMerchant:
|
||||||
|
return invtype::InvTypeMerchantSize;
|
||||||
|
case invtype::InvTypeCorpse:
|
||||||
|
return invtype::InvTypeCorpseSize;
|
||||||
|
case invtype::InvTypeBazaar:
|
||||||
|
return invtype::InvTypeBazaarSize;
|
||||||
|
case invtype::InvTypeInspect:
|
||||||
|
return invtype::InvTypeInspectSize;
|
||||||
|
case invtype::InvTypeViewMODPC:
|
||||||
|
return invtype::InvTypeViewMODPCSize;
|
||||||
|
case invtype::InvTypeViewMODBank:
|
||||||
|
return invtype::InvTypeViewMODBankSize;
|
||||||
|
case invtype::InvTypeViewMODSharedBank:
|
||||||
|
return invtype::InvTypeViewMODSharedBankSize;
|
||||||
|
case invtype::InvTypeViewMODLimbo:
|
||||||
|
return invtype::InvTypeViewMODLimboSize;
|
||||||
|
case invtype::InvTypeAltStorage:
|
||||||
|
return invtype::InvTypeAltStorageSize;
|
||||||
|
case invtype::InvTypeArchived:
|
||||||
|
return invtype::InvTypeArchivedSize;
|
||||||
|
case invtype::InvTypeOther:
|
||||||
|
return invtype::InvTypeOtherSize;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* UF::invtype::InvTypeName(int inv_type)
|
||||||
|
{
|
||||||
|
switch (inv_type) {
|
||||||
|
case invtype::InvTypeInvalid:
|
||||||
|
return "Invalid Type";
|
||||||
|
case invtype::InvTypePossessions:
|
||||||
|
return "Possessions";
|
||||||
|
case invtype::InvTypeBank:
|
||||||
|
return "Bank";
|
||||||
|
case invtype::InvTypeSharedBank:
|
||||||
|
return "Shared Bank";
|
||||||
|
case invtype::InvTypeTrade:
|
||||||
|
return "Trade";
|
||||||
|
case invtype::InvTypeWorld:
|
||||||
|
return "World";
|
||||||
|
case invtype::InvTypeLimbo:
|
||||||
|
return "Limbo";
|
||||||
|
case invtype::InvTypeTribute:
|
||||||
|
return "Tribute";
|
||||||
|
case invtype::InvTypeGuildTribute:
|
||||||
|
return "Guild Tribute";
|
||||||
|
case invtype::InvTypeMerchant:
|
||||||
|
return "Merchant";
|
||||||
|
case invtype::InvTypeCorpse:
|
||||||
|
return "Corpse";
|
||||||
|
case invtype::InvTypeBazaar:
|
||||||
|
return "Bazaar";
|
||||||
|
case invtype::InvTypeInspect:
|
||||||
|
return "Inspect";
|
||||||
|
case invtype::InvTypeViewMODPC:
|
||||||
|
return "View MOD PC";
|
||||||
|
case invtype::InvTypeViewMODBank:
|
||||||
|
return "View MOD Bank";
|
||||||
|
case invtype::InvTypeViewMODSharedBank:
|
||||||
|
return "View MOD Shared Bank";
|
||||||
|
case invtype::InvTypeViewMODLimbo:
|
||||||
|
return "View MOD Limbo";
|
||||||
|
case invtype::InvTypeAltStorage:
|
||||||
|
return "Alt Storage";
|
||||||
|
case invtype::InvTypeArchived:
|
||||||
|
return "Archived";
|
||||||
|
case invtype::InvTypeOther:
|
||||||
|
return "Other";
|
||||||
|
default:
|
||||||
|
return "Unknown Type";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* UF::invslot::InvPossessionsSlotName(int inv_slot)
|
||||||
|
{
|
||||||
|
switch (inv_slot) {
|
||||||
|
case invslot::InvSlotInvalid:
|
||||||
|
return "Invalid Slot";
|
||||||
|
case invslot::PossessionsCharm:
|
||||||
|
return "Charm";
|
||||||
|
case invslot::PossessionsEar1:
|
||||||
|
return "Ear 1";
|
||||||
|
case invslot::PossessionsHead:
|
||||||
|
return "Head";
|
||||||
|
case invslot::PossessionsFace:
|
||||||
|
return "Face";
|
||||||
|
case invslot::PossessionsEar2:
|
||||||
|
return "Ear 2";
|
||||||
|
case invslot::PossessionsNeck:
|
||||||
|
return "Neck";
|
||||||
|
case invslot::PossessionsShoulders:
|
||||||
|
return "Shoulders";
|
||||||
|
case invslot::PossessionsArms:
|
||||||
|
return "Arms";
|
||||||
|
case invslot::PossessionsBack:
|
||||||
|
return "Back";
|
||||||
|
case invslot::PossessionsWrist1:
|
||||||
|
return "Wrist 1";
|
||||||
|
case invslot::PossessionsWrist2:
|
||||||
|
return "Wrist 2";
|
||||||
|
case invslot::PossessionsRange:
|
||||||
|
return "Range";
|
||||||
|
case invslot::PossessionsHands:
|
||||||
|
return "Hands";
|
||||||
|
case invslot::PossessionsPrimary:
|
||||||
|
return "Primary";
|
||||||
|
case invslot::PossessionsSecondary:
|
||||||
|
return "Secondary";
|
||||||
|
case invslot::PossessionsFinger1:
|
||||||
|
return "Finger 1";
|
||||||
|
case invslot::PossessionsFinger2:
|
||||||
|
return "Finger 2";
|
||||||
|
case invslot::PossessionsChest:
|
||||||
|
return "Chest";
|
||||||
|
case invslot::PossessionsLegs:
|
||||||
|
return "Legs";
|
||||||
|
case invslot::PossessionsFeet:
|
||||||
|
return "Feet";
|
||||||
|
case invslot::PossessionsWaist:
|
||||||
|
return "Waist";
|
||||||
|
case invslot::PossessionsPowerSource:
|
||||||
|
return "Power Source";
|
||||||
|
case invslot::PossessionsAmmo:
|
||||||
|
return "Ammo";
|
||||||
|
case invslot::PossessionsGeneral1:
|
||||||
|
return "General 1";
|
||||||
|
case invslot::PossessionsGeneral2:
|
||||||
|
return "General 2";
|
||||||
|
case invslot::PossessionsGeneral3:
|
||||||
|
return "General 3";
|
||||||
|
case invslot::PossessionsGeneral4:
|
||||||
|
return "General 4";
|
||||||
|
case invslot::PossessionsGeneral5:
|
||||||
|
return "General 5";
|
||||||
|
case invslot::PossessionsGeneral6:
|
||||||
|
return "General 6";
|
||||||
|
case invslot::PossessionsGeneral7:
|
||||||
|
return "General 7";
|
||||||
|
case invslot::PossessionsGeneral8:
|
||||||
|
return "General 8";
|
||||||
|
case invslot::PossessionsCursor:
|
||||||
|
return "Cursor";
|
||||||
|
default:
|
||||||
|
return "Unknown Slot";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* UF::invslot::InvCorpseSlotName(int inv_slot)
|
||||||
|
{
|
||||||
|
if (!invtype::InvTypeSize(invtype::InvTypeCorpse) || inv_slot == invslot::InvSlotInvalid)
|
||||||
|
return "Invalid Slot";
|
||||||
|
|
||||||
|
// needs work
|
||||||
|
if ((size_t)(inv_slot + 1) < invslot::CorpseBegin || (size_t)(inv_slot + 1) >= invslot::CorpseEnd)
|
||||||
|
return "Unknown Slot";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Slot %i", (inv_slot + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* UF::invslot::InvSlotName(int inv_type, int inv_slot)
|
||||||
|
{
|
||||||
|
if (inv_type == invtype::InvTypePossessions)
|
||||||
|
return invslot::InvPossessionsSlotName(inv_slot);
|
||||||
|
else if (inv_type == invtype::InvTypeCorpse)
|
||||||
|
return invslot::InvCorpseSlotName(inv_slot);
|
||||||
|
|
||||||
|
size_t type_size = invtype::InvTypeSize(inv_type);
|
||||||
|
|
||||||
|
if (!type_size || inv_slot == invslot::InvSlotInvalid)
|
||||||
|
return "Invalid Slot";
|
||||||
|
|
||||||
|
if ((size_t)(inv_slot + 1) >= type_size)
|
||||||
|
return "Unknown Slot";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Slot %i", (inv_slot + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* UF::invbag::InvBagIndexName(int bag_index)
|
||||||
|
{
|
||||||
|
if (bag_index == invbag::InvBagInvalid)
|
||||||
|
return "Invalid Bag";
|
||||||
|
|
||||||
|
if ((size_t)bag_index >= invbag::ItemBagSize)
|
||||||
|
return "Unknown Bag";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Bag %i", (bag_index + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* UF::invaug::InvAugIndexName(int aug_index)
|
||||||
|
{
|
||||||
|
if (aug_index == invaug::InvAugInvalid)
|
||||||
|
return "Invalid Augment";
|
||||||
|
|
||||||
|
if ((size_t)aug_index >= invaug::ItemAugSize)
|
||||||
|
return "Unknown Augment";
|
||||||
|
|
||||||
|
static std::string ret_str;
|
||||||
|
ret_str = StringFormat("Augment %i", (aug_index + 1));
|
||||||
|
|
||||||
|
return ret_str.c_str();
|
||||||
|
}
|
||||||
|
|||||||
@ -17,178 +17,285 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef COMMON_UF_CONSTANTS_H
|
#ifndef COMMON_UF_LIMITS_H
|
||||||
#define COMMON_UF_CONSTANTS_H
|
#define COMMON_UF_LIMITS_H
|
||||||
|
|
||||||
#include "../types.h"
|
#include "../types.h"
|
||||||
|
#include "../client_version.h"
|
||||||
|
#include "../skills.h"
|
||||||
|
|
||||||
|
|
||||||
namespace UF
|
namespace UF
|
||||||
{
|
{
|
||||||
namespace inventory {
|
enum : int { Invalid = -1, Null, Safety };
|
||||||
typedef enum : int16 {
|
|
||||||
TypePossessions = 0,
|
|
||||||
TypeBank,
|
|
||||||
TypeSharedBank,
|
|
||||||
TypeTrade,
|
|
||||||
TypeWorld,
|
|
||||||
TypeLimbo,
|
|
||||||
TypeTribute,
|
|
||||||
TypeTrophyTribute,
|
|
||||||
TypeGuildTribute,
|
|
||||||
TypeMerchant,
|
|
||||||
TypeDeleted,
|
|
||||||
TypeCorpse,
|
|
||||||
TypeBazaar,
|
|
||||||
TypeInspect,
|
|
||||||
TypeRealEstate,
|
|
||||||
TypeViewMODPC,
|
|
||||||
TypeViewMODBank,
|
|
||||||
TypeViewMODSharedBank,
|
|
||||||
TypeViewMODLimbo,
|
|
||||||
TypeAltStorage,
|
|
||||||
TypeArchived,
|
|
||||||
TypeMail,
|
|
||||||
TypeGuildTrophyTribute,
|
|
||||||
TypeOther,
|
|
||||||
TypeCount
|
|
||||||
} InventoryTypes;
|
|
||||||
|
|
||||||
typedef enum : int16 {
|
enum : bool { False = false, True = true };
|
||||||
SlotCharm = 0,
|
|
||||||
SlotEar1,
|
|
||||||
SlotHead,
|
|
||||||
SlotFace,
|
|
||||||
SlotEar2,
|
|
||||||
SlotNeck,
|
|
||||||
SlotShoulders,
|
|
||||||
SlotArms,
|
|
||||||
SlotBack,
|
|
||||||
SlotWrist1,
|
|
||||||
SlotWrist2,
|
|
||||||
SlotRange,
|
|
||||||
SlotHands,
|
|
||||||
SlotPrimary,
|
|
||||||
SlotSecondary,
|
|
||||||
SlotFinger1,
|
|
||||||
SlotFinger2,
|
|
||||||
SlotChest,
|
|
||||||
SlotLegs,
|
|
||||||
SlotFeet,
|
|
||||||
SlotWaist,
|
|
||||||
SlotPowerSource,
|
|
||||||
SlotAmmo,
|
|
||||||
SlotGeneral1,
|
|
||||||
SlotGeneral2,
|
|
||||||
SlotGeneral3,
|
|
||||||
SlotGeneral4,
|
|
||||||
SlotGeneral5,
|
|
||||||
SlotGeneral6,
|
|
||||||
SlotGeneral7,
|
|
||||||
SlotGeneral8,
|
|
||||||
SlotCursor,
|
|
||||||
SlotCount,
|
|
||||||
SlotEquipmentBegin = SlotCharm,
|
|
||||||
SlotEquipmentEnd = SlotAmmo,
|
|
||||||
SlotEquipmentCount = (SlotEquipmentEnd - SlotEquipmentBegin + 1),
|
|
||||||
SlotGeneralBegin = SlotGeneral1,
|
|
||||||
SlotGeneralEnd = SlotGeneral8,
|
|
||||||
SlotGeneralCount = (SlotGeneralEnd - SlotGeneralBegin + 1)
|
|
||||||
} PossessionsSlots;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace consts {
|
// pre-declarations
|
||||||
static const size_t CHARACTER_CREATION_LIMIT = 12;
|
namespace invtype {
|
||||||
|
inline EQEmu::versions::ClientVersion InvTypeRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
static const uint16 TYPE_POSSESSIONS_SIZE = inventory::SlotCount;
|
enum : int { InvTypeInvalid = -1, InvTypeBegin };
|
||||||
static const uint16 TYPE_BANK_SIZE = 24;
|
|
||||||
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
|
|
||||||
static const uint16 TYPE_TRADE_SIZE = 8;
|
|
||||||
static const uint16 TYPE_WORLD_SIZE = 10;
|
|
||||||
static const uint16 TYPE_LIMBO_SIZE = 36;
|
|
||||||
static const uint16 TYPE_TRIBUTE_SIZE = 0; //?
|
|
||||||
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_MERCHANT_SIZE = 0;
|
|
||||||
static const uint16 TYPE_DELETED_SIZE = 0;
|
|
||||||
static const uint16 TYPE_CORPSE_SIZE = inventory::SlotCount;
|
|
||||||
static const uint16 TYPE_BAZAAR_SIZE = 80;
|
|
||||||
static const uint16 TYPE_INSPECT_SIZE = inventory::SlotEquipmentCount;
|
|
||||||
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_PC_SIZE = TYPE_POSSESSIONS_SIZE;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = TYPE_BANK_SIZE;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = TYPE_SHARED_BANK_SIZE;
|
|
||||||
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = TYPE_LIMBO_SIZE;
|
|
||||||
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_ARCHIVED_SIZE = 0;
|
|
||||||
static const uint16 TYPE_MAIL_SIZE = 0;
|
|
||||||
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
|
|
||||||
static const uint16 TYPE_KRONO_SIZE = NOT_USED;
|
|
||||||
static const uint16 TYPE_OTHER_SIZE = 0;
|
|
||||||
|
|
||||||
static const int16 EQUIPMENT_BEGIN = inventory::SlotCharm;
|
enum InventoryType : int {
|
||||||
static const int16 EQUIPMENT_END = inventory::SlotAmmo;
|
InvTypePossessions = InvTypeBegin,
|
||||||
static const uint16 EQUIPMENT_SIZE = inventory::SlotEquipmentCount;
|
InvTypeBank,
|
||||||
|
InvTypeSharedBank,
|
||||||
|
InvTypeTrade,
|
||||||
|
InvTypeWorld,
|
||||||
|
InvTypeLimbo,
|
||||||
|
InvTypeTribute,
|
||||||
|
InvTypeGuildTribute,
|
||||||
|
InvTypeMerchant,
|
||||||
|
InvTypeCorpse,
|
||||||
|
InvTypeBazaar,
|
||||||
|
InvTypeInspect,
|
||||||
|
InvTypeViewMODPC,
|
||||||
|
InvTypeViewMODBank,
|
||||||
|
InvTypeViewMODSharedBank,
|
||||||
|
InvTypeViewMODLimbo,
|
||||||
|
InvTypeAltStorage,
|
||||||
|
InvTypeArchived,
|
||||||
|
InvTypeOther,
|
||||||
|
InvTypeCount
|
||||||
|
};
|
||||||
|
|
||||||
|
} /*invtype*/
|
||||||
|
|
||||||
static const int16 GENERAL_BEGIN = inventory::SlotGeneral1;
|
namespace invslot {
|
||||||
static const int16 GENERAL_END = inventory::SlotGeneral8;
|
inline EQEmu::versions::ClientVersion InvSlotRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||||
static const uint16 GENERAL_SIZE = inventory::SlotGeneralCount;
|
|
||||||
static const int16 GENERAL_BAGS_BEGIN = 262;
|
|
||||||
static const int16 GENERAL_BAGS_END_OFFSET = 79;
|
|
||||||
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 CURSOR = inventory::SlotCursor;
|
enum : int { InvSlotInvalid = -1, InvSlotBegin };
|
||||||
static const int16 CURSOR_BAG_BEGIN = 342;
|
|
||||||
static const int16 CURSOR_BAG_END_OFFSET = 9;
|
|
||||||
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 BANK_BEGIN = 2000;
|
enum PossessionsSlot : int {
|
||||||
static const int16 BANK_END = 2023;
|
PossessionsCharm = InvSlotBegin,
|
||||||
static const int16 BANK_BAGS_BEGIN = 2032;
|
PossessionsEar1,
|
||||||
static const int16 BANK_BAGS_END_OFFSET = 239;
|
PossessionsHead,
|
||||||
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
|
PossessionsFace,
|
||||||
|
PossessionsEar2,
|
||||||
|
PossessionsNeck,
|
||||||
|
PossessionsShoulders,
|
||||||
|
PossessionsArms,
|
||||||
|
PossessionsBack,
|
||||||
|
PossessionsWrist1,
|
||||||
|
PossessionsWrist2,
|
||||||
|
PossessionsRange,
|
||||||
|
PossessionsHands,
|
||||||
|
PossessionsPrimary,
|
||||||
|
PossessionsSecondary,
|
||||||
|
PossessionsFinger1,
|
||||||
|
PossessionsFinger2,
|
||||||
|
PossessionsChest,
|
||||||
|
PossessionsLegs,
|
||||||
|
PossessionsFeet,
|
||||||
|
PossessionsWaist,
|
||||||
|
PossessionsPowerSource,
|
||||||
|
PossessionsAmmo,
|
||||||
|
PossessionsGeneral1,
|
||||||
|
PossessionsGeneral2,
|
||||||
|
PossessionsGeneral3,
|
||||||
|
PossessionsGeneral4,
|
||||||
|
PossessionsGeneral5,
|
||||||
|
PossessionsGeneral6,
|
||||||
|
PossessionsGeneral7,
|
||||||
|
PossessionsGeneral8,
|
||||||
|
PossessionsCursor,
|
||||||
|
PossessionsCount
|
||||||
|
};
|
||||||
|
|
||||||
static const int16 SHARED_BANK_BEGIN = 2500;
|
const int EquipmentBegin = PossessionsCharm;
|
||||||
static const int16 SHARED_BANK_END = 2501;
|
const int EquipmentEnd = PossessionsAmmo;
|
||||||
static const int16 SHARED_BANK_BAGS_BEGIN = 2532;
|
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
|
||||||
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
|
|
||||||
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 TRADE_BEGIN = 3000;
|
const int GeneralBegin = PossessionsGeneral1;
|
||||||
static const int16 TRADE_END = 3007;
|
const int GeneralEnd = PossessionsGeneral8;
|
||||||
static const int16 TRADE_NPC_END = 3003;
|
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
|
||||||
static const int16 TRADE_BAGS_BEGIN = 3031;
|
|
||||||
static const int16 TRADE_BAGS_END_OFFSET = 79;
|
} /*invslot*/
|
||||||
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
|
|
||||||
|
|
||||||
static const int16 WORLD_BEGIN = 4000;
|
namespace invbag {
|
||||||
static const int16 WORLD_END = 4009;
|
inline EQEmu::versions::ClientVersion InvBagRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
static const int16 TRIBUTE_BEGIN = 400;
|
enum : int { InvBagInvalid = -1, InvBagBegin };
|
||||||
static const int16 TRIBUTE_END = 404;
|
|
||||||
|
} /*invbag*/
|
||||||
|
|
||||||
static const int16 CORPSE_BEGIN = inventory::SlotGeneral1;
|
namespace invaug {
|
||||||
static const int16 CORPSE_END = inventory::SlotGeneral1 + inventory::SlotCursor;
|
inline EQEmu::versions::ClientVersion InvAugRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
static const uint16 ITEM_COMMON_SIZE = 5;
|
enum : int { InvAugInvalid = -1, InvAugBegin };
|
||||||
static const uint16 ITEM_CONTAINER_SIZE = 10;
|
|
||||||
|
} /*invaug*/
|
||||||
|
|
||||||
static const size_t BANDOLIERS_SIZE = 20; // number of bandolier instances
|
namespace item {
|
||||||
static const size_t BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
|
inline EQEmu::versions::ClientVersion ItemRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
static const size_t POTION_BELT_ITEM_COUNT = 5;
|
enum ItemPacketType : int {
|
||||||
|
ItemPacketMerchant = 100,
|
||||||
|
ItemPacketTradeView = 101,
|
||||||
|
ItemPacketLoot = 102,
|
||||||
|
ItemPacketTrade = 103,
|
||||||
|
ItemPacketCharInventory = 105,
|
||||||
|
ItemPacketLimbo = 106,
|
||||||
|
ItemPacketWorldContainer = 107,
|
||||||
|
ItemPacketTributeItem = 108,
|
||||||
|
ItemPacketGuildTribute = 109,
|
||||||
|
ItemPacketCharmUpdate = 110,
|
||||||
|
ItemPacket11 = 111
|
||||||
|
};
|
||||||
|
|
||||||
|
} /*item*/
|
||||||
|
|
||||||
static const size_t TEXT_LINK_BODY_LENGTH = 50;
|
namespace profile {
|
||||||
|
inline EQEmu::versions::ClientVersion ProfileRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
|
} /*profile*/
|
||||||
|
|
||||||
static const size_t PLAYER_PROFILE_SKILL_MAX = SkillTripleAttack;
|
namespace constants {
|
||||||
}
|
inline EQEmu::versions::ClientVersion ConstantsRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
|
} /*constants*/
|
||||||
|
|
||||||
namespace limits {
|
namespace behavior {
|
||||||
static const bool ALLOWS_EMPTY_BAG_IN_BAG = false;
|
inline EQEmu::versions::ClientVersion BehaviorRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||||
static const bool ALLOWS_CLICK_CAST_FROM_BAG = false;
|
|
||||||
static const bool COIN_HAS_WEIGHT = false;
|
} /*behavior*/
|
||||||
}
|
|
||||||
|
namespace skills {
|
||||||
|
inline EQEmu::versions::ClientVersion SkillsRef() { return EQEmu::versions::ClientVersion::UF; }
|
||||||
|
|
||||||
|
} /*skills*/
|
||||||
|
|
||||||
|
|
||||||
|
// declarations
|
||||||
|
namespace invtype {
|
||||||
|
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
|
||||||
|
const size_t InvTypeBankSize = 24;
|
||||||
|
const size_t InvTypeSharedBankSize = 2;
|
||||||
|
const size_t InvTypeTradeSize = 8;
|
||||||
|
const size_t InvTypeWorldSize = 10;
|
||||||
|
const size_t InvTypeLimboSize = 36;
|
||||||
|
const size_t InvTypeTributeSize = 5;
|
||||||
|
const size_t InvTypeGuildTributeSize = 0;//unknown
|
||||||
|
const size_t InvTypeMerchantSize = 80;
|
||||||
|
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
|
||||||
|
const size_t InvTypeBazaarSize = 80;
|
||||||
|
const size_t InvTypeInspectSize = invslot::EquipmentCount;
|
||||||
|
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
|
||||||
|
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
|
||||||
|
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
|
||||||
|
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
|
||||||
|
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
|
||||||
|
const size_t InvTypeArchivedSize = 0;//unknown
|
||||||
|
const size_t InvTypeOtherSize = 0;//unknown
|
||||||
|
|
||||||
|
const size_t NPCTradeSize = 4;
|
||||||
|
|
||||||
|
extern size_t InvTypeSize(int inv_type);
|
||||||
|
extern const char* InvTypeName(int inv_type);
|
||||||
|
|
||||||
|
} /*invtype*/
|
||||||
|
|
||||||
|
namespace invslot {
|
||||||
|
const int BankBegin = 2000;
|
||||||
|
const int BankEnd = (BankBegin + invtype::InvTypeBankSize) - 1;
|
||||||
|
|
||||||
|
const int SharedBankBegin = 2500;
|
||||||
|
const int SharedBankEnd = (SharedBankBegin + invtype::InvTypeSharedBankSize) - 1;
|
||||||
|
|
||||||
|
const int TradeBegin = 3000;
|
||||||
|
const int TradeEnd = (TradeBegin + invtype::InvTypeTradeSize) - 1;
|
||||||
|
const int TradeNPCEnd = 3003;
|
||||||
|
|
||||||
|
const int WorldBegin = 4000;
|
||||||
|
const int WorldEnd = (WorldBegin + invtype::InvTypeWorldSize) - 1;
|
||||||
|
|
||||||
|
const int TributeBegin = 400;
|
||||||
|
const int TributeEnd = 404;
|
||||||
|
|
||||||
|
const int CorpseBegin = invslot::PossessionsGeneral1;
|
||||||
|
const int CorpseEnd = invslot::PossessionsGeneral1 + invslot::PossessionsCursor;
|
||||||
|
|
||||||
|
extern const char* InvPossessionsSlotName(int inv_slot);
|
||||||
|
extern const char* InvCorpseSlotName(int inv_slot);
|
||||||
|
extern const char* InvSlotName(int inv_type, int inv_slot);
|
||||||
|
|
||||||
|
} /*invslot*/
|
||||||
|
|
||||||
|
namespace invbag {
|
||||||
|
const size_t ItemBagSize = 10;
|
||||||
|
|
||||||
|
const int GeneralBagsBegin = 262;
|
||||||
|
const int GeneralBagsSize = invslot::GeneralCount * ItemBagSize;
|
||||||
|
const int GeneralBagsEnd = (GeneralBagsBegin + GeneralBagsSize) - 1;
|
||||||
|
|
||||||
|
const int CursorBagBegin = 342;
|
||||||
|
const int CursorBagSize = ItemBagSize;
|
||||||
|
const int CursorBagEnd = (CursorBagBegin + CursorBagSize) - 1;
|
||||||
|
|
||||||
|
const int BankBagsBegin = 2032;
|
||||||
|
const int BankBagsSize = (invtype::InvTypeBankSize * ItemBagSize);
|
||||||
|
const int BankBagsEnd = (BankBagsBegin + BankBagsSize) - 1;
|
||||||
|
|
||||||
|
const int SharedBankBagsBegin = 2532;
|
||||||
|
const int SharedBankBagsSize = invtype::InvTypeSharedBankSize * ItemBagSize;
|
||||||
|
const int SharedBankBagsEnd = (SharedBankBagsBegin + SharedBankBagsSize) - 1;
|
||||||
|
|
||||||
|
const int TradeBagsBegin = 3031;
|
||||||
|
const int TradeBagsSize = invtype::InvTypeTradeSize * ItemBagSize;
|
||||||
|
const int TradeBagsEnd = (TradeBagsBegin + TradeBagsSize) - 1;
|
||||||
|
|
||||||
|
extern const char* InvBagIndexName(int bag_index);
|
||||||
|
|
||||||
|
} /*invbag*/
|
||||||
|
|
||||||
|
namespace invaug {
|
||||||
|
const size_t ItemAugSize = 5;
|
||||||
|
|
||||||
|
extern const char* InvAugIndexName(int aug_index);
|
||||||
|
|
||||||
|
} /*invaug*/
|
||||||
|
|
||||||
|
namespace item {
|
||||||
|
|
||||||
|
} /*item*/
|
||||||
|
|
||||||
|
namespace profile {
|
||||||
|
const size_t TributeSize = invtype::InvTypeTributeSize;
|
||||||
|
|
||||||
|
const size_t BandoliersSize = 20; // number of bandolier instances
|
||||||
|
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
|
||||||
|
|
||||||
|
const size_t PotionBeltSize = 5;
|
||||||
|
|
||||||
|
const size_t SkillArraySize = 100;
|
||||||
|
|
||||||
|
} /*profile*/
|
||||||
|
|
||||||
|
namespace constants {
|
||||||
|
const size_t CharacterCreationLimit = 12;
|
||||||
|
|
||||||
|
const size_t SayLinkBodySize = 50;
|
||||||
|
|
||||||
|
} /*constants*/
|
||||||
|
|
||||||
|
namespace behavior {
|
||||||
|
const bool ConcatenateInvTypeLimbo = true;
|
||||||
|
|
||||||
|
const bool AllowOverLevelEquipment = true;
|
||||||
|
|
||||||
|
const bool AllowEmptyBagInBag = false;
|
||||||
|
const bool AllowClickCastFromBag = false;
|
||||||
|
|
||||||
|
const bool CoinHasWeight = false;
|
||||||
|
|
||||||
|
} /*behavior*/
|
||||||
|
|
||||||
|
namespace skills {
|
||||||
|
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
|
||||||
|
|
||||||
|
} /*skills*/
|
||||||
|
|
||||||
}; /*UF*/
|
}; /*UF*/
|
||||||
|
|
||||||
#endif /*COMMON_UF_CONSTANTS_H*/
|
#endif /*COMMON_UF_LIMITS_H*/
|
||||||
|
|||||||
@ -773,7 +773,7 @@ struct BandolierItem_Struct
|
|||||||
struct Bandolier_Struct
|
struct Bandolier_Struct
|
||||||
{
|
{
|
||||||
char Name[32];
|
char Name[32];
|
||||||
BandolierItem_Struct Items[consts::BANDOLIER_ITEM_COUNT];
|
BandolierItem_Struct Items[profile::BandolierItemCount];
|
||||||
};
|
};
|
||||||
|
|
||||||
//len = 72
|
//len = 72
|
||||||
@ -787,7 +787,7 @@ struct PotionBeltItem_Struct
|
|||||||
//len = 288
|
//len = 288
|
||||||
struct PotionBelt_Struct
|
struct PotionBelt_Struct
|
||||||
{
|
{
|
||||||
PotionBeltItem_Struct Items[consts::POTION_BELT_ITEM_COUNT];
|
PotionBeltItem_Struct Items[profile::PotionBeltSize];
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
|
static const uint32 MAX_GROUP_LEADERSHIP_AA_ARRAY = 16;
|
||||||
@ -1010,7 +1010,7 @@ struct PlayerProfile_Struct
|
|||||||
/*11236*/ uint32 aapoints_spent; // Number of spent AA points
|
/*11236*/ uint32 aapoints_spent; // Number of spent AA points
|
||||||
/*11240*/ uint32 aapoints; // Unspent AA points
|
/*11240*/ uint32 aapoints; // Unspent AA points
|
||||||
/*11244*/ uint8 unknown11244[4];
|
/*11244*/ uint8 unknown11244[4];
|
||||||
/*11248*/ Bandolier_Struct bandoliers[consts::BANDOLIERS_SIZE]; // [6400] bandolier contents
|
/*11248*/ Bandolier_Struct bandoliers[profile::BandoliersSize]; // [6400] bandolier contents
|
||||||
/*17648*/ PotionBelt_Struct potionbelt; // [360] potion belt 72 extra octets by adding 1 more belt slot
|
/*17648*/ PotionBelt_Struct potionbelt; // [360] potion belt 72 extra octets by adding 1 more belt slot
|
||||||
/*18008*/ uint8 unknown18008[8];
|
/*18008*/ uint8 unknown18008[8];
|
||||||
/*18016*/ uint32 available_slots;
|
/*18016*/ uint32 available_slots;
|
||||||
|
|||||||
@ -17,6 +17,7 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "say_link.h"
|
||||||
#include "emu_constants.h"
|
#include "emu_constants.h"
|
||||||
|
|
||||||
#include "string_util.h"
|
#include "string_util.h"
|
||||||
|
|||||||
@ -1382,7 +1382,7 @@ bool SharedDatabase::LoadSkillCaps(const std::string &prefix) {
|
|||||||
skill_caps_mmf.reset(nullptr);
|
skill_caps_mmf.reset(nullptr);
|
||||||
|
|
||||||
uint32 class_count = PLAYER_CLASS_COUNT;
|
uint32 class_count = PLAYER_CLASS_COUNT;
|
||||||
uint32 skill_count = HIGHEST_SKILL + 1;
|
uint32 skill_count = EQEmu::skills::HIGHEST_SKILL + 1;
|
||||||
uint32 level_count = HARD_LEVEL_CAP + 1;
|
uint32 level_count = HARD_LEVEL_CAP + 1;
|
||||||
uint32 size = (class_count * skill_count * level_count * sizeof(uint16));
|
uint32 size = (class_count * skill_count * level_count * sizeof(uint16));
|
||||||
|
|
||||||
@ -1403,7 +1403,7 @@ bool SharedDatabase::LoadSkillCaps(const std::string &prefix) {
|
|||||||
|
|
||||||
void SharedDatabase::LoadSkillCaps(void *data) {
|
void SharedDatabase::LoadSkillCaps(void *data) {
|
||||||
uint32 class_count = PLAYER_CLASS_COUNT;
|
uint32 class_count = PLAYER_CLASS_COUNT;
|
||||||
uint32 skill_count = HIGHEST_SKILL + 1;
|
uint32 skill_count = EQEmu::skills::HIGHEST_SKILL + 1;
|
||||||
uint32 level_count = HARD_LEVEL_CAP + 1;
|
uint32 level_count = HARD_LEVEL_CAP + 1;
|
||||||
uint16 *skill_caps_table = reinterpret_cast<uint16*>(data);
|
uint16 *skill_caps_table = reinterpret_cast<uint16*>(data);
|
||||||
|
|
||||||
@ -1428,7 +1428,7 @@ void SharedDatabase::LoadSkillCaps(void *data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 SharedDatabase::GetSkillCap(uint8 Class_, SkillUseTypes Skill, uint8 Level) {
|
uint16 SharedDatabase::GetSkillCap(uint8 Class_, EQEmu::skills::SkillType Skill, uint8 Level) {
|
||||||
if(!skill_caps_mmf) {
|
if(!skill_caps_mmf) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1442,7 +1442,7 @@ uint16 SharedDatabase::GetSkillCap(uint8 Class_, SkillUseTypes Skill, uint8 Leve
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32 class_count = PLAYER_CLASS_COUNT;
|
uint32 class_count = PLAYER_CLASS_COUNT;
|
||||||
uint32 skill_count = HIGHEST_SKILL + 1;
|
uint32 skill_count = EQEmu::skills::HIGHEST_SKILL + 1;
|
||||||
uint32 level_count = HARD_LEVEL_CAP + 1;
|
uint32 level_count = HARD_LEVEL_CAP + 1;
|
||||||
if(Class_ > class_count || static_cast<uint32>(Skill) > skill_count || Level > level_count) {
|
if(Class_ > class_count || static_cast<uint32>(Skill) > skill_count || Level > level_count) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -1457,7 +1457,7 @@ uint16 SharedDatabase::GetSkillCap(uint8 Class_, SkillUseTypes Skill, uint8 Leve
|
|||||||
return skill_caps_table[index];
|
return skill_caps_table[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 SharedDatabase::GetTrainLevel(uint8 Class_, SkillUseTypes Skill, uint8 Level) {
|
uint8 SharedDatabase::GetTrainLevel(uint8 Class_, EQEmu::skills::SkillType Skill, uint8 Level) {
|
||||||
if(!skill_caps_mmf) {
|
if(!skill_caps_mmf) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1471,7 +1471,7 @@ uint8 SharedDatabase::GetTrainLevel(uint8 Class_, SkillUseTypes Skill, uint8 Lev
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32 class_count = PLAYER_CLASS_COUNT;
|
uint32 class_count = PLAYER_CLASS_COUNT;
|
||||||
uint32 skill_count = HIGHEST_SKILL + 1;
|
uint32 skill_count = EQEmu::skills::HIGHEST_SKILL + 1;
|
||||||
uint32 level_count = HARD_LEVEL_CAP + 1;
|
uint32 level_count = HARD_LEVEL_CAP + 1;
|
||||||
if(Class_ > class_count || static_cast<uint32>(Skill) > skill_count || Level > level_count) {
|
if(Class_ > class_count || static_cast<uint32>(Skill) > skill_count || Level > level_count) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -1642,10 +1642,10 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) {
|
|||||||
|
|
||||||
int tmp_skill = atoi(row[100]);;
|
int tmp_skill = atoi(row[100]);;
|
||||||
|
|
||||||
if(tmp_skill < 0 || tmp_skill > HIGHEST_SKILL)
|
if (tmp_skill < 0 || tmp_skill > EQEmu::skills::HIGHEST_SKILL)
|
||||||
sp[tempid].skill = SkillBegging; /* not much better we can do. */ // can probably be changed to client-based 'SkillNone' once activated
|
sp[tempid].skill = EQEmu::skills::SkillBegging; /* not much better we can do. */ // can probably be changed to client-based 'SkillNone' once activated
|
||||||
else
|
else
|
||||||
sp[tempid].skill = (SkillUseTypes) tmp_skill;
|
sp[tempid].skill = (EQEmu::skills::SkillType) tmp_skill;
|
||||||
|
|
||||||
sp[tempid].zonetype=atoi(row[101]);
|
sp[tempid].zonetype=atoi(row[101]);
|
||||||
sp[tempid].EnvironmentType=atoi(row[102]);
|
sp[tempid].EnvironmentType=atoi(row[102]);
|
||||||
|
|||||||
@ -131,8 +131,8 @@ class SharedDatabase : public Database
|
|||||||
|
|
||||||
void LoadSkillCaps(void *data);
|
void LoadSkillCaps(void *data);
|
||||||
bool LoadSkillCaps(const std::string &prefix);
|
bool LoadSkillCaps(const std::string &prefix);
|
||||||
uint16 GetSkillCap(uint8 Class_, SkillUseTypes Skill, uint8 Level);
|
uint16 GetSkillCap(uint8 Class_, EQEmu::skills::SkillType Skill, uint8 Level);
|
||||||
uint8 GetTrainLevel(uint8 Class_, SkillUseTypes Skill, uint8 Level);
|
uint8 GetTrainLevel(uint8 Class_, EQEmu::skills::SkillType Skill, uint8 Level);
|
||||||
|
|
||||||
int GetMaxSpellID();
|
int GetMaxSpellID();
|
||||||
bool LoadSpells(const std::string &prefix, int32 *records, const SPDat_Spell_Struct **sp);
|
bool LoadSpells(const std::string &prefix, int32 *records, const SPDat_Spell_Struct **sp);
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
/* EQEMu: Everquest Server Emulator
|
/* EQEMu: Everquest Server Emulator
|
||||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
|
||||||
|
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -9,17 +10,20 @@
|
|||||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||||
are required to give you total support for your newly bought product;
|
are required to give you total support for your newly bought product;
|
||||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "skills.h"
|
#include "skills.h"
|
||||||
|
|
||||||
bool EQEmu::IsTradeskill(SkillUseTypes skill)
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
|
bool EQEmu::skills::IsTradeskill(SkillType skill)
|
||||||
{
|
{
|
||||||
switch (skill) {
|
switch (skill) {
|
||||||
case SkillFishing:
|
case SkillFishing:
|
||||||
@ -40,7 +44,7 @@ bool EQEmu::IsTradeskill(SkillUseTypes skill)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::IsSpecializedSkill(SkillUseTypes skill)
|
bool EQEmu::skills::IsSpecializedSkill(SkillType skill)
|
||||||
{
|
{
|
||||||
// this could be a simple if, but if this is more portable if any IDs change (probably won't)
|
// this could be a simple if, but if this is more portable if any IDs change (probably won't)
|
||||||
// or any other specialized are added (also unlikely)
|
// or any other specialized are added (also unlikely)
|
||||||
@ -56,7 +60,7 @@ bool EQEmu::IsSpecializedSkill(SkillUseTypes skill)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float EQEmu::GetSkillMeleePushForce(SkillUseTypes skill)
|
float EQEmu::skills::GetSkillMeleePushForce(SkillType skill)
|
||||||
{
|
{
|
||||||
// This is the force/magnitude of the push from an attack of this skill type
|
// This is the force/magnitude of the push from an attack of this skill type
|
||||||
// You can find these numbers in the clients skill struct
|
// You can find these numbers in the clients skill struct
|
||||||
@ -93,7 +97,7 @@ float EQEmu::GetSkillMeleePushForce(SkillUseTypes skill)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQEmu::IsBardInstrumentSkill(SkillUseTypes skill)
|
bool EQEmu::skills::IsBardInstrumentSkill(SkillType skill)
|
||||||
{
|
{
|
||||||
switch (skill) {
|
switch (skill) {
|
||||||
case SkillBrassInstruments:
|
case SkillBrassInstruments:
|
||||||
@ -107,7 +111,7 @@ bool EQEmu::IsBardInstrumentSkill(SkillUseTypes skill)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::map<SkillUseTypes, std::string>& EQEmu::GetSkillUseTypesMap()
|
const std::map<EQEmu::skills::SkillType, std::string>& EQEmu::skills::GetSkillTypeMap()
|
||||||
{
|
{
|
||||||
/* VS2013 code
|
/* VS2013 code
|
||||||
static const std::map<SkillUseTypes, std::string> skill_use_types_map = {
|
static const std::map<SkillUseTypes, std::string> skill_use_types_map = {
|
||||||
@ -194,7 +198,7 @@ const std::map<SkillUseTypes, std::string>& EQEmu::GetSkillUseTypesMap()
|
|||||||
|
|
||||||
/* VS2012 code - begin */
|
/* VS2012 code - begin */
|
||||||
|
|
||||||
static const char* skill_use_names[_EmuSkillCount] = {
|
static const char* skill_use_names[SkillCount] = {
|
||||||
"1H Blunt",
|
"1H Blunt",
|
||||||
"1H Slashing",
|
"1H Slashing",
|
||||||
"2H Blunt",
|
"2H Blunt",
|
||||||
@ -275,14 +279,160 @@ const std::map<SkillUseTypes, std::string>& EQEmu::GetSkillUseTypesMap()
|
|||||||
"2H Piercing"
|
"2H Piercing"
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::map<SkillUseTypes, std::string> skill_use_types_map;
|
static std::map<SkillType, std::string> skill_type_map;
|
||||||
|
|
||||||
skill_use_types_map.clear();
|
skill_type_map.clear();
|
||||||
|
|
||||||
for (int i = Skill1HBlunt; i < _EmuSkillCount; ++i)
|
for (int i = Skill1HBlunt; i < SkillCount; ++i)
|
||||||
skill_use_types_map[(SkillUseTypes)i] = skill_use_names[i];
|
skill_type_map[(SkillType)i] = skill_use_names[i];
|
||||||
|
|
||||||
/* VS2012 code - end */
|
/* VS2012 code - end */
|
||||||
|
|
||||||
return skill_use_types_map;
|
return skill_type_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct EQEmu::SkillProfile // prototype - not implemented
|
||||||
|
{
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
uint32 _1HBlunt;
|
||||||
|
uint32 _1HSlashing;
|
||||||
|
uint32 _2HBlunt;
|
||||||
|
uint32 _2HSlashing;
|
||||||
|
uint32 Abjuration;
|
||||||
|
uint32 Alteration;
|
||||||
|
uint32 ApplyPoison;
|
||||||
|
uint32 Archery;
|
||||||
|
uint32 Backstab;
|
||||||
|
uint32 BindWound;
|
||||||
|
uint32 Bash;
|
||||||
|
uint32 Block;
|
||||||
|
uint32 BrassInstruments;
|
||||||
|
uint32 Channeling;
|
||||||
|
uint32 Conjuration;
|
||||||
|
uint32 Defense;
|
||||||
|
uint32 Disarm;
|
||||||
|
uint32 DisarmTraps;
|
||||||
|
uint32 Divination;
|
||||||
|
uint32 Dodge;
|
||||||
|
uint32 DoubleAttack;
|
||||||
|
union {
|
||||||
|
uint32 DragonPunch;
|
||||||
|
uint32 TailRake;
|
||||||
|
};
|
||||||
|
uint32 DualWield;
|
||||||
|
uint32 EagleStrike;
|
||||||
|
uint32 Evocation;
|
||||||
|
uint32 FeignDeath;
|
||||||
|
uint32 FlyingKick;
|
||||||
|
uint32 Forage;
|
||||||
|
uint32 HandtoHand;
|
||||||
|
uint32 Hide;
|
||||||
|
uint32 Kick;
|
||||||
|
uint32 Meditate;
|
||||||
|
uint32 Mend;
|
||||||
|
uint32 Offense;
|
||||||
|
uint32 Parry;
|
||||||
|
uint32 PickLock;
|
||||||
|
uint32 _1HPiercing;
|
||||||
|
uint32 Riposte;
|
||||||
|
uint32 RoundKick;
|
||||||
|
uint32 SafeFall;
|
||||||
|
uint32 SenseHeading;
|
||||||
|
uint32 Singing;
|
||||||
|
uint32 Sneak;
|
||||||
|
uint32 SpecializeAbjure;
|
||||||
|
uint32 SpecializeAlteration;
|
||||||
|
uint32 SpecializeConjuration;
|
||||||
|
uint32 SpecializeDivination;
|
||||||
|
uint32 SpecializeEvocation;
|
||||||
|
uint32 PickPockets;
|
||||||
|
uint32 StringedInstruments;
|
||||||
|
uint32 Swimming;
|
||||||
|
uint32 Throwing;
|
||||||
|
uint32 TigerClaw;
|
||||||
|
uint32 Tracking;
|
||||||
|
uint32 WindInstruments;
|
||||||
|
uint32 Fishing;
|
||||||
|
uint32 MakePoison;
|
||||||
|
uint32 Tinkering;
|
||||||
|
uint32 Research;
|
||||||
|
uint32 Alchemy;
|
||||||
|
uint32 Baking;
|
||||||
|
uint32 Tailoring;
|
||||||
|
uint32 SenseTraps;
|
||||||
|
uint32 Blacksmithing;
|
||||||
|
uint32 Fletching;
|
||||||
|
uint32 Brewing;
|
||||||
|
uint32 AlcoholTolerance;
|
||||||
|
uint32 Begging;
|
||||||
|
uint32 JewelryMaking;
|
||||||
|
uint32 Pottery;
|
||||||
|
uint32 PercussionInstruments;
|
||||||
|
uint32 Intimidation;
|
||||||
|
uint32 Berserking;
|
||||||
|
uint32 Taunt;
|
||||||
|
uint32 Frenzy;
|
||||||
|
uint32 RemoveTraps;
|
||||||
|
uint32 TripleAttack;
|
||||||
|
uint32 _2HPiercing;
|
||||||
|
uint32 unused1;
|
||||||
|
uint32 unused2;
|
||||||
|
uint32 unused3;
|
||||||
|
uint32 unused4;
|
||||||
|
uint32 unused5;
|
||||||
|
uint32 unused6;
|
||||||
|
uint32 unused7;
|
||||||
|
uint32 unused8;
|
||||||
|
uint32 unused9;
|
||||||
|
uint32 unused10;
|
||||||
|
uint32 unused11;
|
||||||
|
uint32 unused12;
|
||||||
|
uint32 unused13;
|
||||||
|
uint32 unused14;
|
||||||
|
uint32 unused15;
|
||||||
|
uint32 unused16;
|
||||||
|
uint32 unused17;
|
||||||
|
uint32 unused18;
|
||||||
|
uint32 unused19;
|
||||||
|
uint32 unused20;
|
||||||
|
uint32 unused21;
|
||||||
|
uint32 unused22;
|
||||||
|
};
|
||||||
|
uint32 skill[PACKET_SKILL_ARRAY_SIZE];
|
||||||
|
};
|
||||||
|
|
||||||
|
SkillProfile();
|
||||||
|
|
||||||
|
uint32* GetSkills() { return reinterpret_cast<uint32*>(&skill); }
|
||||||
|
|
||||||
|
skills::SkillType GetLastUseableSkill() { return EQEmu::skills::Skill2HPiercing; }
|
||||||
|
|
||||||
|
size_t GetSkillsArraySize() { return PACKET_SKILL_ARRAY_SIZE; }
|
||||||
|
uint32 GetSkill(int skill_id);
|
||||||
|
|
||||||
|
uint32 operator[](int skill_id) { return GetSkill(skill_id); }
|
||||||
|
|
||||||
|
// const
|
||||||
|
uint32* GetSkills() const { return const_cast<SkillProfile*>(this)->GetSkills(); }
|
||||||
|
|
||||||
|
skills::SkillType GetLastUseableSkill() const { return const_cast<SkillProfile*>(this)->GetLastUseableSkill(); }
|
||||||
|
|
||||||
|
size_t GetSkillsArraySize() const { return const_cast<SkillProfile*>(this)->GetSkillsArraySize(); }
|
||||||
|
uint32 GetSkill(int skill_id) const { return const_cast<SkillProfile*>(this)->GetSkill(skill_id); }
|
||||||
|
|
||||||
|
uint32 operator[](int skill_id) const { return const_cast<SkillProfile*>(this)->GetSkill(skill_id); }
|
||||||
|
};
|
||||||
|
|
||||||
|
EQEmu::SkillProfile::SkillProfile()
|
||||||
|
{
|
||||||
|
memset(&skill, 0, (sizeof(uint32) * PACKET_SKILL_ARRAY_SIZE));
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 EQEmu::SkillProfile::GetSkill(int skill_id)
|
||||||
|
{
|
||||||
|
if (skill_id < 0 || skill_id >= PACKET_SKILL_ARRAY_SIZE)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return skill[skill_id];
|
||||||
}
|
}
|
||||||
|
|||||||
117
common/skills.h
117
common/skills.h
@ -1,5 +1,6 @@
|
|||||||
/* EQEMu: Everquest Server Emulator
|
/* EQEMu: Everquest Server Emulator
|
||||||
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemulator.org)
|
|
||||||
|
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -9,25 +10,24 @@
|
|||||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||||
are required to give you total support for your newly bought product;
|
are required to give you total support for your newly bought product;
|
||||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#ifndef SKILLS_H
|
|
||||||
#define SKILLS_H
|
#ifndef COMMON_SKILLS_H
|
||||||
|
#define COMMON_SKILLS_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
/*
|
|
||||||
** Skill use types
|
namespace EQEmu
|
||||||
**
|
|
||||||
** (ref: eqstr_us.txt [05-10-2013])
|
|
||||||
*/
|
|
||||||
enum SkillUseTypes
|
|
||||||
{
|
{
|
||||||
|
namespace skills {
|
||||||
|
enum SkillType : int {
|
||||||
/*13855*/ Skill1HBlunt = 0,
|
/*13855*/ Skill1HBlunt = 0,
|
||||||
/*13856*/ Skill1HSlashing,
|
/*13856*/ Skill1HSlashing,
|
||||||
/*13857*/ Skill2HBlunt,
|
/*13857*/ Skill2HBlunt,
|
||||||
@ -111,78 +111,65 @@ enum SkillUseTypes
|
|||||||
|
|
||||||
// RoF2+ specific skills
|
// RoF2+ specific skills
|
||||||
/*00789*/ Skill2HPiercing, // 77
|
/*00789*/ Skill2HPiercing, // 77
|
||||||
// /*01216*/ SkillNone, // This needs to move down as new skills are added
|
// /*01216*/ SkillNone, // This needs to move down as new skills are added
|
||||||
|
|
||||||
/*00000*/ _EmuSkillCount // move to last position of active enumeration labels
|
/*00000*/ SkillCount // move to last position of active enumeration labels
|
||||||
|
|
||||||
// Skill Counts
|
// Skill Counts
|
||||||
// /*-----*/ _SkillCount_62 = 75, // use for Ti and earlier max skill checks
|
// /*-----*/ SkillCount_62 = 75, // use for Ti and earlier max skill checks
|
||||||
// /*-----*/ _SkillCount_SoF = 77, // use for SoF thru RoF1 max skill checks
|
// /*-----*/ SkillCount_SoF = 77, // use for SoF thru RoF1 max skill checks
|
||||||
// /*-----*/ _SkillCount_RoF2 = 78, // use for RoF2 max skill checks
|
// /*-----*/ SkillCount_RoF2 = 78, // use for RoF2 max skill checks
|
||||||
|
|
||||||
// Support values
|
// Support values
|
||||||
// /*-----*/ _SkillServerArraySize = _SkillCount_RoF2, // Should reflect last client '_SkillCount'
|
// /*-----*/ SkillServerArraySize = _SkillCount_RoF2, // Should reflect last client '_SkillCount'
|
||||||
|
|
||||||
// Superfluous additions to SkillUseTypes..server-use only
|
// Superfluous additions to SkillUseTypes..server-use only
|
||||||
// /*-----*/ ExtSkillGenericTradeskill = 100
|
// /*-----*/ ExtSkillGenericTradeskill = 100
|
||||||
|
|
||||||
/* ([EQClientVersion] [0] - Unknown, [3] - SoF, [7] - RoF2[05-10-2013])
|
/* ([EQClientVersion] [0] - Unknown, [3] - SoF, [7] - RoF2[05-10-2013])
|
||||||
[Skill] [index] | [0] [1] [2] [3] [4] [5] [6] [7]
|
[Skill] [index] | [0] [1] [2] [3] [4] [5] [6] [7]
|
||||||
Frenzy (05837) | --- 074 074 074 074 074 074 074
|
Frenzy (05837) | --- 074 074 074 074 074 074 074
|
||||||
Remove Traps (03670) | --- --- --- 075 075 075 075 075
|
Remove Traps (03670) | --- --- --- 075 075 075 075 075
|
||||||
Triple Attack (13049) | --- --- --- 076 076 076 076 076
|
Triple Attack (13049) | --- --- --- 076 076 076 076 076
|
||||||
2H Piercing (00789) | --- --- --- --- --- --- --- 077
|
2H Piercing (00789) | --- --- --- --- --- --- --- 077
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
[SkillCaps.txt] (SoF+)
|
[SkillCaps.txt] (SoF+)
|
||||||
a^b^c^d(^e) (^e is RoF+, but cursory glance appears to be all zeros)
|
a^b^c^d(^e) (^e is RoF+, but cursory glance appears to be all zeros)
|
||||||
|
|
||||||
a - Class
|
a - Class
|
||||||
b - Skill
|
b - Skill
|
||||||
c - Level
|
c - Level
|
||||||
d - Max Value
|
d - Max Value
|
||||||
(e - Unknown)
|
(e - Unknown)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
NOTE: Disregard this until it is sorted out
|
Changed (tradeskill==75) to ExtSkillGenericTradeskill in tradeskills.cpp for both instances. If it's a pseudo-enumeration of
|
||||||
|
an AA ability, then use the 'ExtSkill' ('ExtendedSkill') prefix with a value >= 100. (current implementation)
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
I changed (tradeskill==75) to ExtSkillGenericTradeskill in tradeskills.cpp for both instances. If it's a pseudo-enumeration of
|
// temporary until it can be sorted out...
|
||||||
an AA ability, then use the 'ExtSkill' ('ExtendedSkill') prefix with a value >= 100. (current implementation)
|
|
||||||
|
|
||||||
We probably need to recode ALL of the skill checks to use the new Skill2HPiercing and ensure that the animation value is
|
|
||||||
properly changed in the patch files. As far as earlier clients using this new skill, it can be done, but we just need to ensure
|
|
||||||
that skill address is not inadvertently passed to the client..and we can just send an actual message for the skill-up. Use of a
|
|
||||||
command can tell the player what that particular skill value is.
|
|
||||||
|
|
||||||
Nothing on SkillTripleAttack just yet..haven't looked into its current implementation.
|
|
||||||
|
|
||||||
In addition to the above re-coding, we're probably going to need to rework the database pp blob to reserve space for the current
|
|
||||||
100-dword buffer allocation. This way, we can just add new ones without having to rework it each time.
|
|
||||||
(Wasn't done for this in particular..but, thanks Akkadius!)
|
|
||||||
|
|
||||||
-U
|
|
||||||
*/
|
|
||||||
};
|
|
||||||
|
|
||||||
// temporary until it can be sorted out...
|
|
||||||
#define HIGHEST_SKILL Skill2HPiercing
|
#define HIGHEST_SKILL Skill2HPiercing
|
||||||
// Spell Effects use this value to determine if an effect applies to all skills.
|
// Spell Effects use this value to determine if an effect applies to all skills.
|
||||||
#define ALL_SKILLS -1
|
#define ALL_SKILLS -1
|
||||||
|
|
||||||
// server profile does not reflect this yet..so, prefixed with 'PACKET_'
|
// server profile does not reflect this yet..so, prefixed with 'PACKET_'
|
||||||
#define PACKET_SKILL_ARRAY_SIZE 100
|
#define PACKET_SKILL_ARRAY_SIZE 100
|
||||||
|
|
||||||
|
extern bool IsTradeskill(SkillType skill);
|
||||||
|
extern bool IsSpecializedSkill(SkillType skill);
|
||||||
|
extern float GetSkillMeleePushForce(SkillType skill);
|
||||||
|
extern bool IsBardInstrumentSkill(SkillType skill);
|
||||||
|
|
||||||
// for skill related helper functions
|
extern const std::map<SkillType, std::string>& GetSkillTypeMap();
|
||||||
namespace EQEmu {
|
|
||||||
bool IsTradeskill(SkillUseTypes skill);
|
|
||||||
bool IsSpecializedSkill(SkillUseTypes skill);
|
|
||||||
float GetSkillMeleePushForce(SkillUseTypes skill);
|
|
||||||
bool IsBardInstrumentSkill(SkillUseTypes skill);
|
|
||||||
|
|
||||||
const std::map<SkillUseTypes, std::string>& GetSkillUseTypesMap();
|
} /*skills*/
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
struct SkillProfile;
|
||||||
|
|
||||||
|
} /*EQEmu*/
|
||||||
|
|
||||||
|
#endif /*COMMON_SKILLS_H*/
|
||||||
|
|||||||
@ -681,7 +681,7 @@ struct SPDat_Spell_Struct
|
|||||||
/* 086 */ int effectid[EFFECT_COUNT]; // Spell's effects
|
/* 086 */ int effectid[EFFECT_COUNT]; // Spell's effects
|
||||||
/* 098 */ SpellTargetType targettype; // Spell's Target
|
/* 098 */ SpellTargetType targettype; // Spell's Target
|
||||||
/* 099 */ int basediff; // base difficulty fizzle adjustment
|
/* 099 */ int basediff; // base difficulty fizzle adjustment
|
||||||
/* 100 */ SkillUseTypes skill;
|
/* 100 */ EQEmu::skills::SkillType skill;
|
||||||
/* 101 */ int8 zonetype; // 01=Outdoors, 02=dungeons, ff=Any
|
/* 101 */ int8 zonetype; // 01=Outdoors, 02=dungeons, ff=Any
|
||||||
/* 102 */ int8 EnvironmentType;
|
/* 102 */ int8 EnvironmentType;
|
||||||
/* 103 */ int8 TimeOfDay;
|
/* 103 */ int8 TimeOfDay;
|
||||||
|
|||||||
@ -30,7 +30,7 @@ void LoadSkillCaps(SharedDatabase *database, const std::string &prefix) {
|
|||||||
mutex.Lock();
|
mutex.Lock();
|
||||||
|
|
||||||
uint32 class_count = PLAYER_CLASS_COUNT;
|
uint32 class_count = PLAYER_CLASS_COUNT;
|
||||||
uint32 skill_count = HIGHEST_SKILL + 1;
|
uint32 skill_count = EQEmu::skills::HIGHEST_SKILL + 1;
|
||||||
uint32 level_count = HARD_LEVEL_CAP + 1;
|
uint32 level_count = HARD_LEVEL_CAP + 1;
|
||||||
uint32 size = (class_count * skill_count * level_count * sizeof(uint16));
|
uint32 size = (class_count * skill_count * level_count * sizeof(uint16));
|
||||||
|
|
||||||
|
|||||||
@ -35,13 +35,13 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void IsTradeskill() {
|
void IsTradeskill() {
|
||||||
TEST_ASSERT(EQEmu::IsTradeskill(SkillPottery));
|
TEST_ASSERT(EQEmu::skills::IsTradeskill(EQEmu::skills::SkillPottery));
|
||||||
TEST_ASSERT(!EQEmu::IsTradeskill(SkillParry));
|
TEST_ASSERT(!EQEmu::skills::IsTradeskill(EQEmu::skills::SkillParry));
|
||||||
}
|
}
|
||||||
|
|
||||||
void IsSpecializedSkill() {
|
void IsSpecializedSkill() {
|
||||||
TEST_ASSERT(EQEmu::IsSpecializedSkill(SkillSpecializeConjuration));
|
TEST_ASSERT(EQEmu::skills::IsSpecializedSkill(EQEmu::skills::SkillSpecializeConjuration));
|
||||||
TEST_ASSERT(!EQEmu::IsSpecializedSkill(SkillConjuration))
|
TEST_ASSERT(!EQEmu::skills::IsSpecializedSkill(EQEmu::skills::SkillConjuration))
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -211,9 +211,9 @@ void Client::SendMaxCharCreate() {
|
|||||||
auto outapp = new EQApplicationPacket(OP_SendMaxCharacters, sizeof(MaxCharacters_Struct));
|
auto outapp = new EQApplicationPacket(OP_SendMaxCharacters, sizeof(MaxCharacters_Struct));
|
||||||
MaxCharacters_Struct* mc = (MaxCharacters_Struct*)outapp->pBuffer;
|
MaxCharacters_Struct* mc = (MaxCharacters_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
mc->max_chars = EQEmu::limits::CharacterCreationLimit(m_ClientVersion);
|
mc->max_chars = EQEmu::constants::CharacterCreationLimit(m_ClientVersion);
|
||||||
if (mc->max_chars > EQEmu::constants::CharacterCreationLimit)
|
if (mc->max_chars > EQEmu::constants::CharacterCreationMax)
|
||||||
mc->max_chars = EQEmu::constants::CharacterCreationLimit;
|
mc->max_chars = EQEmu::constants::CharacterCreationMax;
|
||||||
|
|
||||||
QueuePacket(outapp);
|
QueuePacket(outapp);
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
@ -746,8 +746,8 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
|||||||
// This can probably be moved outside and have another method return requested info (don't forget to remove the #include "../common/shareddb.h" above)
|
// This can probably be moved outside and have another method return requested info (don't forget to remove the #include "../common/shareddb.h" above)
|
||||||
// (This is a literal translation of the original process..I don't see why it can't be changed to a single-target query over account iteration)
|
// (This is a literal translation of the original process..I don't see why it can't be changed to a single-target query over account iteration)
|
||||||
if (!pZoning) {
|
if (!pZoning) {
|
||||||
size_t character_limit = EQEmu::limits::CharacterCreationLimit(eqs->ClientVersion());
|
size_t character_limit = EQEmu::constants::CharacterCreationLimit(eqs->ClientVersion());
|
||||||
if (character_limit > EQEmu::constants::CharacterCreationLimit) { character_limit = EQEmu::constants::CharacterCreationLimit; }
|
if (character_limit > EQEmu::constants::CharacterCreationMax) { character_limit = EQEmu::constants::CharacterCreationMax; }
|
||||||
if (eqs->ClientVersion() == EQEmu::versions::ClientVersion::Titanium) { character_limit = 8; }
|
if (eqs->ClientVersion() == EQEmu::versions::ClientVersion::Titanium) { character_limit = 8; }
|
||||||
|
|
||||||
std::string tgh_query = StringFormat(
|
std::string tgh_query = StringFormat(
|
||||||
@ -1464,8 +1464,8 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
|||||||
SetClassStartingSkills(&pp);
|
SetClassStartingSkills(&pp);
|
||||||
SetClassLanguages(&pp);
|
SetClassLanguages(&pp);
|
||||||
|
|
||||||
pp.skills[SkillSwimming] = RuleI(Skills, SwimmingStartValue);
|
pp.skills[EQEmu::skills::SkillSwimming] = RuleI(Skills, SwimmingStartValue);
|
||||||
pp.skills[SkillSenseHeading] = RuleI(Skills, SenseHeadingStartValue);
|
pp.skills[EQEmu::skills::SkillSenseHeading] = RuleI(Skills, SenseHeadingStartValue);
|
||||||
|
|
||||||
// strcpy(pp.servername, WorldConfig::get()->ShortName.c_str());
|
// strcpy(pp.servername, WorldConfig::get()->ShortName.c_str());
|
||||||
|
|
||||||
@ -1839,21 +1839,21 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc)
|
|||||||
|
|
||||||
void Client::SetClassStartingSkills(PlayerProfile_Struct *pp)
|
void Client::SetClassStartingSkills(PlayerProfile_Struct *pp)
|
||||||
{
|
{
|
||||||
for (uint32 i = 0; i <= HIGHEST_SKILL; ++i) {
|
for (uint32 i = 0; i <= EQEmu::skills::HIGHEST_SKILL; ++i) {
|
||||||
if (pp->skills[i] == 0) {
|
if (pp->skills[i] == 0) {
|
||||||
// Skip specialized, tradeskills (fishing excluded), Alcohol Tolerance, and Bind Wound
|
// Skip specialized, tradeskills (fishing excluded), Alcohol Tolerance, and Bind Wound
|
||||||
if (EQEmu::IsSpecializedSkill((SkillUseTypes)i) ||
|
if (EQEmu::skills::IsSpecializedSkill((EQEmu::skills::SkillType)i) ||
|
||||||
(EQEmu::IsTradeskill((SkillUseTypes)i) && i != SkillFishing) ||
|
(EQEmu::skills::IsTradeskill((EQEmu::skills::SkillType)i) && i != EQEmu::skills::SkillFishing) ||
|
||||||
i == SkillAlcoholTolerance || i == SkillBindWound)
|
i == EQEmu::skills::SkillAlcoholTolerance || i == EQEmu::skills::SkillBindWound)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pp->skills[i] = database.GetSkillCap(pp->class_, (SkillUseTypes)i, 1);
|
pp->skills[i] = database.GetSkillCap(pp->class_, (EQEmu::skills::SkillType)i, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cle->GetClientVersion() < static_cast<uint8>(EQEmu::versions::ClientVersion::RoF2) && pp->class_ == BERSERKER) {
|
if (cle->GetClientVersion() < static_cast<uint8>(EQEmu::versions::ClientVersion::RoF2) && pp->class_ == BERSERKER) {
|
||||||
pp->skills[Skill1HPiercing] = pp->skills[Skill2HPiercing];
|
pp->skills[EQEmu::skills::Skill1HPiercing] = pp->skills[EQEmu::skills::Skill2HPiercing];
|
||||||
pp->skills[Skill2HPiercing] = 0;
|
pp->skills[EQEmu::skills::Skill2HPiercing] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1876,41 +1876,41 @@ void Client::SetRaceStartingSkills( PlayerProfile_Struct *pp )
|
|||||||
}
|
}
|
||||||
case DARK_ELF:
|
case DARK_ELF:
|
||||||
{
|
{
|
||||||
pp->skills[SkillHide] = 50;
|
pp->skills[EQEmu::skills::SkillHide] = 50;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case FROGLOK:
|
case FROGLOK:
|
||||||
{
|
{
|
||||||
pp->skills[SkillSwimming] = 125;
|
pp->skills[EQEmu::skills::SkillSwimming] = 125;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GNOME:
|
case GNOME:
|
||||||
{
|
{
|
||||||
pp->skills[SkillTinkering] = 50;
|
pp->skills[EQEmu::skills::SkillTinkering] = 50;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case HALFLING:
|
case HALFLING:
|
||||||
{
|
{
|
||||||
pp->skills[SkillHide] = 50;
|
pp->skills[EQEmu::skills::SkillHide] = 50;
|
||||||
pp->skills[SkillSneak] = 50;
|
pp->skills[EQEmu::skills::SkillSneak] = 50;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IKSAR:
|
case IKSAR:
|
||||||
{
|
{
|
||||||
pp->skills[SkillForage] = 50;
|
pp->skills[EQEmu::skills::SkillForage] = 50;
|
||||||
pp->skills[SkillSwimming] = 100;
|
pp->skills[EQEmu::skills::SkillSwimming] = 100;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WOOD_ELF:
|
case WOOD_ELF:
|
||||||
{
|
{
|
||||||
pp->skills[SkillForage] = 50;
|
pp->skills[EQEmu::skills::SkillForage] = 50;
|
||||||
pp->skills[SkillHide] = 50;
|
pp->skills[EQEmu::skills::SkillHide] = 50;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case VAHSHIR:
|
case VAHSHIR:
|
||||||
{
|
{
|
||||||
pp->skills[SkillSafeFall] = 50;
|
pp->skills[EQEmu::skills::SkillSafeFall] = 50;
|
||||||
pp->skills[SkillSneak] = 50;
|
pp->skills[EQEmu::skills::SkillSneak] = 50;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,11 +37,11 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou
|
|||||||
{
|
{
|
||||||
/* Set Character Creation Limit */
|
/* Set Character Creation Limit */
|
||||||
EQEmu::versions::ClientVersion client_version = EQEmu::versions::ConvertClientVersionBitToClientVersion(clientVersionBit);
|
EQEmu::versions::ClientVersion client_version = EQEmu::versions::ConvertClientVersionBitToClientVersion(clientVersionBit);
|
||||||
size_t character_limit = EQEmu::limits::CharacterCreationLimit(client_version);
|
size_t character_limit = EQEmu::constants::CharacterCreationLimit(client_version);
|
||||||
|
|
||||||
// Validate against absolute server max
|
// Validate against absolute server max
|
||||||
if (character_limit > EQEmu::constants::CharacterCreationLimit)
|
if (character_limit > EQEmu::constants::CharacterCreationMax)
|
||||||
character_limit = EQEmu::constants::CharacterCreationLimit;
|
character_limit = EQEmu::constants::CharacterCreationMax;
|
||||||
|
|
||||||
// Force Titanium clients to use '8'
|
// Force Titanium clients to use '8'
|
||||||
if (client_version == EQEmu::versions::ClientVersion::Titanium)
|
if (client_version == EQEmu::versions::ClientVersion::Titanium)
|
||||||
|
|||||||
178
zone/attack.cpp
178
zone/attack.cpp
@ -50,7 +50,7 @@ extern WorldServer worldserver;
|
|||||||
extern EntityList entity_list;
|
extern EntityList entity_list;
|
||||||
extern Zone* zone;
|
extern Zone* zone;
|
||||||
|
|
||||||
bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* weapon)
|
bool Mob::AttackAnimation(EQEmu::skills::SkillType &skillinuse, int Hand, const ItemInst* weapon)
|
||||||
{
|
{
|
||||||
// Determine animation
|
// Determine animation
|
||||||
int type = 0;
|
int type = 0;
|
||||||
@ -61,63 +61,63 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w
|
|||||||
|
|
||||||
switch (item->ItemType) {
|
switch (item->ItemType) {
|
||||||
case EQEmu::item::ItemType1HSlash: // 1H Slashing
|
case EQEmu::item::ItemType1HSlash: // 1H Slashing
|
||||||
skillinuse = Skill1HSlashing;
|
skillinuse = EQEmu::skills::Skill1HSlashing;
|
||||||
type = anim1HWeapon;
|
type = anim1HWeapon;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType2HSlash: // 2H Slashing
|
case EQEmu::item::ItemType2HSlash: // 2H Slashing
|
||||||
skillinuse = Skill2HSlashing;
|
skillinuse = EQEmu::skills::Skill2HSlashing;
|
||||||
type = anim2HSlashing;
|
type = anim2HSlashing;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType1HPiercing: // Piercing
|
case EQEmu::item::ItemType1HPiercing: // Piercing
|
||||||
skillinuse = Skill1HPiercing;
|
skillinuse = EQEmu::skills::Skill1HPiercing;
|
||||||
type = anim1HPiercing;
|
type = anim1HPiercing;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType1HBlunt: // 1H Blunt
|
case EQEmu::item::ItemType1HBlunt: // 1H Blunt
|
||||||
skillinuse = Skill1HBlunt;
|
skillinuse = EQEmu::skills::Skill1HBlunt;
|
||||||
type = anim1HWeapon;
|
type = anim1HWeapon;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType2HBlunt: // 2H Blunt
|
case EQEmu::item::ItemType2HBlunt: // 2H Blunt
|
||||||
skillinuse = Skill2HBlunt;
|
skillinuse = EQEmu::skills::Skill2HBlunt;
|
||||||
type = anim2HSlashing; //anim2HWeapon
|
type = anim2HSlashing; //anim2HWeapon
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType2HPiercing: // 2H Piercing
|
case EQEmu::item::ItemType2HPiercing: // 2H Piercing
|
||||||
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
|
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
|
||||||
skillinuse = Skill1HPiercing;
|
skillinuse = EQEmu::skills::Skill1HPiercing;
|
||||||
else
|
else
|
||||||
skillinuse = Skill2HPiercing;
|
skillinuse = EQEmu::skills::Skill2HPiercing;
|
||||||
type = anim2HWeapon;
|
type = anim2HWeapon;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemTypeMartial:
|
case EQEmu::item::ItemTypeMartial:
|
||||||
skillinuse = SkillHandtoHand;
|
skillinuse = EQEmu::skills::SkillHandtoHand;
|
||||||
type = animHand2Hand;
|
type = animHand2Hand;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
skillinuse = SkillHandtoHand;
|
skillinuse = EQEmu::skills::SkillHandtoHand;
|
||||||
type = animHand2Hand;
|
type = animHand2Hand;
|
||||||
break;
|
break;
|
||||||
}// switch
|
}// switch
|
||||||
}
|
}
|
||||||
else if(IsNPC()) {
|
else if(IsNPC()) {
|
||||||
switch (skillinuse) {
|
switch (skillinuse) {
|
||||||
case Skill1HSlashing: // 1H Slashing
|
case EQEmu::skills::Skill1HSlashing: // 1H Slashing
|
||||||
type = anim1HWeapon;
|
type = anim1HWeapon;
|
||||||
break;
|
break;
|
||||||
case Skill2HSlashing: // 2H Slashing
|
case EQEmu::skills::Skill2HSlashing: // 2H Slashing
|
||||||
type = anim2HSlashing;
|
type = anim2HSlashing;
|
||||||
break;
|
break;
|
||||||
case Skill1HPiercing: // Piercing
|
case EQEmu::skills::Skill1HPiercing: // Piercing
|
||||||
type = anim1HPiercing;
|
type = anim1HPiercing;
|
||||||
break;
|
break;
|
||||||
case Skill1HBlunt: // 1H Blunt
|
case EQEmu::skills::Skill1HBlunt: // 1H Blunt
|
||||||
type = anim1HWeapon;
|
type = anim1HWeapon;
|
||||||
break;
|
break;
|
||||||
case Skill2HBlunt: // 2H Blunt
|
case EQEmu::skills::Skill2HBlunt: // 2H Blunt
|
||||||
type = anim2HSlashing; //anim2HWeapon
|
type = anim2HSlashing; //anim2HWeapon
|
||||||
break;
|
break;
|
||||||
case Skill2HPiercing: // 2H Piercing
|
case EQEmu::skills::Skill2HPiercing: // 2H Piercing
|
||||||
type = anim2HWeapon;
|
type = anim2HWeapon;
|
||||||
break;
|
break;
|
||||||
case SkillHandtoHand:
|
case EQEmu::skills::SkillHandtoHand:
|
||||||
type = animHand2Hand;
|
type = animHand2Hand;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -126,7 +126,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w
|
|||||||
}// switch
|
}// switch
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skillinuse = SkillHandtoHand;
|
skillinuse = EQEmu::skills::SkillHandtoHand;
|
||||||
type = animHand2Hand;
|
type = animHand2Hand;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w
|
|||||||
|
|
||||||
// called when a mob is attacked, does the checks to see if it's a hit
|
// called when a mob is attacked, does the checks to see if it's a hit
|
||||||
// and does other mitigation checks. 'this' is the mob being attacked.
|
// and does other mitigation checks. 'this' is the mob being attacked.
|
||||||
bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 chance_mod)
|
bool Mob::CheckHitChance(Mob* other, EQEmu::skills::SkillType skillinuse, int Hand, int16 chance_mod)
|
||||||
{
|
{
|
||||||
/*/
|
/*/
|
||||||
//Reworked a lot of this code to achieve better balance at higher levels.
|
//Reworked a lot of this code to achieve better balance at higher levels.
|
||||||
@ -218,7 +218,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
|
|||||||
|
|
||||||
if(defender->IsClient())
|
if(defender->IsClient())
|
||||||
{
|
{
|
||||||
chancetohit += (RuleR(Combat,WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(SkillDefense) - defender->GetSkill(SkillDefense)));
|
chancetohit += (RuleR(Combat, WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(EQEmu::skills::SkillDefense) - defender->GetSkill(EQEmu::skills::SkillDefense)));
|
||||||
Log.Out(Logs::Detail, Logs::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit);
|
Log.Out(Logs::Detail, Logs::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,15 +254,15 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
|
|||||||
hitBonus += attacker->itembonuses.HitChanceEffect[skillinuse] +
|
hitBonus += attacker->itembonuses.HitChanceEffect[skillinuse] +
|
||||||
attacker->spellbonuses.HitChanceEffect[skillinuse]+
|
attacker->spellbonuses.HitChanceEffect[skillinuse]+
|
||||||
attacker->aabonuses.HitChanceEffect[skillinuse]+
|
attacker->aabonuses.HitChanceEffect[skillinuse]+
|
||||||
attacker->itembonuses.HitChanceEffect[HIGHEST_SKILL+1] +
|
attacker->itembonuses.HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1] +
|
||||||
attacker->spellbonuses.HitChanceEffect[HIGHEST_SKILL+1] +
|
attacker->spellbonuses.HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1] +
|
||||||
attacker->aabonuses.HitChanceEffect[HIGHEST_SKILL+1];
|
attacker->aabonuses.HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1];
|
||||||
|
|
||||||
//Accuracy = Spell Effect , HitChance = 'Accuracy' from Item Effect
|
//Accuracy = Spell Effect , HitChance = 'Accuracy' from Item Effect
|
||||||
//Only AA derived accuracy can be skill limited. ie (Precision of the Pathfinder, Dead Aim)
|
//Only AA derived accuracy can be skill limited. ie (Precision of the Pathfinder, Dead Aim)
|
||||||
hitBonus += (attacker->itembonuses.Accuracy[HIGHEST_SKILL+1] +
|
hitBonus += (attacker->itembonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] +
|
||||||
attacker->spellbonuses.Accuracy[HIGHEST_SKILL+1] +
|
attacker->spellbonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] +
|
||||||
attacker->aabonuses.Accuracy[HIGHEST_SKILL+1] +
|
attacker->aabonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] +
|
||||||
attacker->aabonuses.Accuracy[skillinuse] +
|
attacker->aabonuses.Accuracy[skillinuse] +
|
||||||
attacker->itembonuses.HitChance) / 15.0f; //Item Mod 'Accuracy'
|
attacker->itembonuses.HitChance) / 15.0f; //Item Mod 'Accuracy'
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
|
|||||||
if(attacker->IsNPC())
|
if(attacker->IsNPC())
|
||||||
hitBonus += (attacker->CastToNPC()->GetAccuracyRating() / 10.0f); //Modifier from database
|
hitBonus += (attacker->CastToNPC()->GetAccuracyRating() / 10.0f); //Modifier from database
|
||||||
|
|
||||||
if(skillinuse == SkillArchery)
|
if (skillinuse == EQEmu::skills::SkillArchery)
|
||||||
hitBonus -= hitBonus*RuleR(Combat, ArcheryHitPenalty);
|
hitBonus -= hitBonus*RuleR(Combat, ArcheryHitPenalty);
|
||||||
|
|
||||||
//Calculate final chance to hit
|
//Calculate final chance to hit
|
||||||
@ -382,13 +382,13 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
|
|||||||
// Need to check if we have something in MainHand to actually attack with (or fists)
|
// Need to check if we have something in MainHand to actually attack with (or fists)
|
||||||
if (hand != EQEmu::legacy::SlotRange && CanThisClassRiposte() && InFront && !ImmuneRipo) {
|
if (hand != EQEmu::legacy::SlotRange && CanThisClassRiposte() && InFront && !ImmuneRipo) {
|
||||||
if (IsClient())
|
if (IsClient())
|
||||||
CastToClient()->CheckIncreaseSkill(SkillRiposte, other, -10);
|
CastToClient()->CheckIncreaseSkill(EQEmu::skills::SkillRiposte, other, -10);
|
||||||
// check auto discs ... I guess aa/items too :P
|
// check auto discs ... I guess aa/items too :P
|
||||||
if (spellbonuses.RiposteChance == 10000 || aabonuses.RiposteChance == 10000 || itembonuses.RiposteChance == 10000) {
|
if (spellbonuses.RiposteChance == 10000 || aabonuses.RiposteChance == 10000 || itembonuses.RiposteChance == 10000) {
|
||||||
damage = -3;
|
damage = -3;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
int chance = GetSkill(SkillRiposte) + 100;
|
int chance = GetSkill(EQEmu::skills::SkillRiposte) + 100;
|
||||||
chance += (chance * (aabonuses.RiposteChance + spellbonuses.RiposteChance + itembonuses.RiposteChance)) / 100;
|
chance += (chance * (aabonuses.RiposteChance + spellbonuses.RiposteChance + itembonuses.RiposteChance)) / 100;
|
||||||
chance /= 50;
|
chance /= 50;
|
||||||
chance += itembonuses.HeroicDEX / 25; // live has "heroic strickthrough" here to counter
|
chance += itembonuses.HeroicDEX / 25; // live has "heroic strickthrough" here to counter
|
||||||
@ -420,14 +420,14 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
|
|||||||
|
|
||||||
if (CanThisClassBlock() && (InFront || bBlockFromRear)) {
|
if (CanThisClassBlock() && (InFront || bBlockFromRear)) {
|
||||||
if (IsClient())
|
if (IsClient())
|
||||||
CastToClient()->CheckIncreaseSkill(SkillBlock, other, -10);
|
CastToClient()->CheckIncreaseSkill(EQEmu::skills::SkillBlock, other, -10);
|
||||||
// check auto discs ... I guess aa/items too :P
|
// check auto discs ... I guess aa/items too :P
|
||||||
if (spellbonuses.IncreaseBlockChance == 10000 || aabonuses.IncreaseBlockChance == 10000 ||
|
if (spellbonuses.IncreaseBlockChance == 10000 || aabonuses.IncreaseBlockChance == 10000 ||
|
||||||
itembonuses.IncreaseBlockChance == 10000) {
|
itembonuses.IncreaseBlockChance == 10000) {
|
||||||
damage = -1;
|
damage = -1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
int chance = GetSkill(SkillBlock) + 100;
|
int chance = GetSkill(EQEmu::skills::SkillBlock) + 100;
|
||||||
chance += (chance * (aabonuses.IncreaseBlockChance + spellbonuses.IncreaseBlockChance + itembonuses.IncreaseBlockChance)) / 100;
|
chance += (chance * (aabonuses.IncreaseBlockChance + spellbonuses.IncreaseBlockChance + itembonuses.IncreaseBlockChance)) / 100;
|
||||||
chance /= 25;
|
chance /= 25;
|
||||||
chance += itembonuses.HeroicDEX / 25; // live has "heroic strickthrough" here to counter
|
chance += itembonuses.HeroicDEX / 25; // live has "heroic strickthrough" here to counter
|
||||||
@ -444,13 +444,13 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
|
|||||||
// parry
|
// parry
|
||||||
if (CanThisClassParry() && InFront && hand != EQEmu::legacy::SlotRange) {
|
if (CanThisClassParry() && InFront && hand != EQEmu::legacy::SlotRange) {
|
||||||
if (IsClient())
|
if (IsClient())
|
||||||
CastToClient()->CheckIncreaseSkill(SkillParry, other, -10);
|
CastToClient()->CheckIncreaseSkill(EQEmu::skills::SkillParry, other, -10);
|
||||||
// check auto discs ... I guess aa/items too :P
|
// check auto discs ... I guess aa/items too :P
|
||||||
if (spellbonuses.ParryChance == 10000 || aabonuses.ParryChance == 10000 || itembonuses.ParryChance == 10000) {
|
if (spellbonuses.ParryChance == 10000 || aabonuses.ParryChance == 10000 || itembonuses.ParryChance == 10000) {
|
||||||
damage = -2;
|
damage = -2;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
int chance = GetSkill(SkillParry) + 100;
|
int chance = GetSkill(EQEmu::skills::SkillParry) + 100;
|
||||||
chance += (chance * (aabonuses.ParryChance + spellbonuses.ParryChance + itembonuses.ParryChance)) / 100;
|
chance += (chance * (aabonuses.ParryChance + spellbonuses.ParryChance + itembonuses.ParryChance)) / 100;
|
||||||
chance /= 45;
|
chance /= 45;
|
||||||
chance += itembonuses.HeroicDEX / 25; // live has "heroic strickthrough" here to counter
|
chance += itembonuses.HeroicDEX / 25; // live has "heroic strickthrough" here to counter
|
||||||
@ -467,13 +467,13 @@ bool Mob::AvoidDamage(Mob *other, int32 &damage, int hand)
|
|||||||
// dodge
|
// dodge
|
||||||
if (CanThisClassDodge() && (InFront || GetClass() == MONK) ) {
|
if (CanThisClassDodge() && (InFront || GetClass() == MONK) ) {
|
||||||
if (IsClient())
|
if (IsClient())
|
||||||
CastToClient()->CheckIncreaseSkill(SkillDodge, other, -10);
|
CastToClient()->CheckIncreaseSkill(EQEmu::skills::SkillDodge, other, -10);
|
||||||
// check auto discs ... I guess aa/items too :P
|
// check auto discs ... I guess aa/items too :P
|
||||||
if (spellbonuses.DodgeChance == 10000 || aabonuses.DodgeChance == 10000 || itembonuses.DodgeChance == 10000) {
|
if (spellbonuses.DodgeChance == 10000 || aabonuses.DodgeChance == 10000 || itembonuses.DodgeChance == 10000) {
|
||||||
damage = -4;
|
damage = -4;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
int chance = GetSkill(SkillDodge) + 100;
|
int chance = GetSkill(EQEmu::skills::SkillDodge) + 100;
|
||||||
chance += (chance * (aabonuses.DodgeChance + spellbonuses.DodgeChance + itembonuses.DodgeChance)) / 100;
|
chance += (chance * (aabonuses.DodgeChance + spellbonuses.DodgeChance + itembonuses.DodgeChance)) / 100;
|
||||||
chance /= 45;
|
chance /= 45;
|
||||||
chance += itembonuses.HeroicAGI / 25; // live has "heroic strickthrough" here to counter
|
chance += itembonuses.HeroicAGI / 25; // live has "heroic strickthrough" here to counter
|
||||||
@ -525,7 +525,7 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac
|
|||||||
spellbonuses.CombatStability) / 100.0f;
|
spellbonuses.CombatStability) / 100.0f;
|
||||||
|
|
||||||
if (RuleB(Combat, UseIntervalAC)) {
|
if (RuleB(Combat, UseIntervalAC)) {
|
||||||
float softcap = (GetSkill(SkillDefense) + GetLevel()) *
|
float softcap = (GetSkill(EQEmu::skills::SkillDefense) + GetLevel()) *
|
||||||
RuleR(Combat, SoftcapFactor) * (1.0 + aa_mit);
|
RuleR(Combat, SoftcapFactor) * (1.0 + aa_mit);
|
||||||
float mitigation_rating = 0.0;
|
float mitigation_rating = 0.0;
|
||||||
float attack_rating = 0.0;
|
float attack_rating = 0.0;
|
||||||
@ -625,17 +625,17 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac
|
|||||||
|
|
||||||
if (GetClass() == WIZARD || GetClass() == MAGICIAN ||
|
if (GetClass() == WIZARD || GetClass() == MAGICIAN ||
|
||||||
GetClass() == NECROMANCER || GetClass() == ENCHANTER)
|
GetClass() == NECROMANCER || GetClass() == ENCHANTER)
|
||||||
mitigation_rating = ((GetSkill(SkillDefense) + itembonuses.HeroicAGI/10) / 4.0) + armor + 1;
|
mitigation_rating = ((GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 4.0) + armor + 1;
|
||||||
else
|
else
|
||||||
mitigation_rating = ((GetSkill(SkillDefense) + itembonuses.HeroicAGI/10) / 3.0) + (armor * 1.333333) + 1;
|
mitigation_rating = ((GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 3.0) + (armor * 1.333333) + 1;
|
||||||
mitigation_rating *= 0.847;
|
mitigation_rating *= 0.847;
|
||||||
|
|
||||||
mitigation_rating = mod_mitigation_rating(mitigation_rating, attacker);
|
mitigation_rating = mod_mitigation_rating(mitigation_rating, attacker);
|
||||||
|
|
||||||
if (attacker->IsClient())
|
if (attacker->IsClient())
|
||||||
attack_rating = (attacker->CastToClient()->CalcATK() + ((attacker->GetSTR()-66) * 0.9) + (attacker->GetSkill(SkillOffense)*1.345));
|
attack_rating = (attacker->CastToClient()->CalcATK() + ((attacker->GetSTR() - 66) * 0.9) + (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345));
|
||||||
else
|
else
|
||||||
attack_rating = (attacker->GetATK() + (attacker->GetSkill(SkillOffense)*1.345) + ((attacker->GetSTR()-66) * 0.9));
|
attack_rating = (attacker->GetATK() + (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345) + ((attacker->GetSTR() - 66) * 0.9));
|
||||||
|
|
||||||
attack_rating = attacker->mod_attack_rating(attack_rating, this);
|
attack_rating = attacker->mod_attack_rating(attack_rating, this);
|
||||||
|
|
||||||
@ -1059,7 +1059,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
|||||||
|
|
||||||
// calculate attack_skill and skillinuse depending on hand and weapon
|
// calculate attack_skill and skillinuse depending on hand and weapon
|
||||||
// also send Packet to near clients
|
// also send Packet to near clients
|
||||||
SkillUseTypes skillinuse;
|
EQEmu::skills::SkillType skillinuse;
|
||||||
AttackAnimation(skillinuse, Hand, weapon);
|
AttackAnimation(skillinuse, Hand, weapon);
|
||||||
Log.Out(Logs::Detail, Logs::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse);
|
Log.Out(Logs::Detail, Logs::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse);
|
||||||
|
|
||||||
@ -1095,7 +1095,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
|||||||
max_hit = (RuleI(Combat, HitCapPre20));
|
max_hit = (RuleI(Combat, HitCapPre20));
|
||||||
|
|
||||||
CheckIncreaseSkill(skillinuse, other, -15);
|
CheckIncreaseSkill(skillinuse, other, -15);
|
||||||
CheckIncreaseSkill(SkillOffense, other, -15);
|
CheckIncreaseSkill(EQEmu::skills::SkillOffense, other, -15);
|
||||||
|
|
||||||
// ***************************************************************
|
// ***************************************************************
|
||||||
// *** Calculate the damage bonus, if applicable, for this hit ***
|
// *** Calculate the damage bonus, if applicable, for this hit ***
|
||||||
@ -1236,7 +1236,7 @@ void Mob::Heal()
|
|||||||
SendHPUpdate();
|
SendHPUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, int special)
|
void Client::Damage(Mob* other, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, int special)
|
||||||
{
|
{
|
||||||
if(dead || IsCorpse())
|
if(dead || IsCorpse())
|
||||||
return;
|
return;
|
||||||
@ -1249,7 +1249,7 @@ void Client::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes att
|
|||||||
//Don't do PvP mitigation if the caster is damaging himself
|
//Don't do PvP mitigation if the caster is damaging himself
|
||||||
if(other && other->IsClient() && (other != this) && damage > 0) {
|
if(other && other->IsClient() && (other != this) && damage > 0) {
|
||||||
int PvPMitigation = 100;
|
int PvPMitigation = 100;
|
||||||
if(attack_skill == SkillArchery)
|
if (attack_skill == EQEmu::skills::SkillArchery)
|
||||||
PvPMitigation = 80;
|
PvPMitigation = 80;
|
||||||
else
|
else
|
||||||
PvPMitigation = 67;
|
PvPMitigation = 67;
|
||||||
@ -1265,11 +1265,11 @@ void Client::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes att
|
|||||||
if (damage > 0) {
|
if (damage > 0) {
|
||||||
|
|
||||||
if (spell_id == SPELL_UNKNOWN)
|
if (spell_id == SPELL_UNKNOWN)
|
||||||
CheckIncreaseSkill(SkillDefense, other, -15);
|
CheckIncreaseSkill(EQEmu::skills::SkillDefense, other, -15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack_skill)
|
bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQEmu::skills::SkillType attack_skill)
|
||||||
{
|
{
|
||||||
if(!ClientFinishedLoading())
|
if(!ClientFinishedLoading())
|
||||||
return false;
|
return false;
|
||||||
@ -1584,13 +1584,13 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
|||||||
|
|
||||||
FaceTarget(GetTarget());
|
FaceTarget(GetTarget());
|
||||||
|
|
||||||
SkillUseTypes skillinuse = SkillHandtoHand;
|
EQEmu::skills::SkillType skillinuse = EQEmu::skills::SkillHandtoHand;
|
||||||
if (Hand == EQEmu::legacy::SlotPrimary) {
|
if (Hand == EQEmu::legacy::SlotPrimary) {
|
||||||
skillinuse = static_cast<SkillUseTypes>(GetPrimSkill());
|
skillinuse = static_cast<EQEmu::skills::SkillType>(GetPrimSkill());
|
||||||
OffHandAtk(false);
|
OffHandAtk(false);
|
||||||
}
|
}
|
||||||
if (Hand == EQEmu::legacy::SlotSecondary) {
|
if (Hand == EQEmu::legacy::SlotSecondary) {
|
||||||
skillinuse = static_cast<SkillUseTypes>(GetSecSkill());
|
skillinuse = static_cast<EQEmu::skills::SkillType>(GetSecSkill());
|
||||||
OffHandAtk(true);
|
OffHandAtk(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1613,32 +1613,32 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
|||||||
|
|
||||||
switch(weapon->ItemType) {
|
switch(weapon->ItemType) {
|
||||||
case EQEmu::item::ItemType1HSlash:
|
case EQEmu::item::ItemType1HSlash:
|
||||||
skillinuse = Skill1HSlashing;
|
skillinuse = EQEmu::skills::Skill1HSlashing;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType2HSlash:
|
case EQEmu::item::ItemType2HSlash:
|
||||||
skillinuse = Skill2HSlashing;
|
skillinuse = EQEmu::skills::Skill2HSlashing;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType1HPiercing:
|
case EQEmu::item::ItemType1HPiercing:
|
||||||
skillinuse = Skill1HPiercing;
|
skillinuse = EQEmu::skills::Skill1HPiercing;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType2HPiercing:
|
case EQEmu::item::ItemType2HPiercing:
|
||||||
skillinuse = Skill2HPiercing;
|
skillinuse = EQEmu::skills::Skill2HPiercing;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType1HBlunt:
|
case EQEmu::item::ItemType1HBlunt:
|
||||||
skillinuse = Skill1HBlunt;
|
skillinuse = EQEmu::skills::Skill1HBlunt;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType2HBlunt:
|
case EQEmu::item::ItemType2HBlunt:
|
||||||
skillinuse = Skill2HBlunt;
|
skillinuse = EQEmu::skills::Skill2HBlunt;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemTypeBow:
|
case EQEmu::item::ItemTypeBow:
|
||||||
skillinuse = SkillArchery;
|
skillinuse = EQEmu::skills::SkillArchery;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemTypeLargeThrowing:
|
case EQEmu::item::ItemTypeLargeThrowing:
|
||||||
case EQEmu::item::ItemTypeSmallThrowing:
|
case EQEmu::item::ItemTypeSmallThrowing:
|
||||||
skillinuse = SkillThrowing;
|
skillinuse = EQEmu::skills::SkillThrowing;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
skillinuse = SkillHandtoHand;
|
skillinuse = EQEmu::skills::SkillHandtoHand;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1795,7 +1795,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, int special) {
|
void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, int special) {
|
||||||
if(spell_id==0)
|
if(spell_id==0)
|
||||||
spell_id = SPELL_UNKNOWN;
|
spell_id = SPELL_UNKNOWN;
|
||||||
|
|
||||||
@ -1838,7 +1838,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, SkillUseTypes attack_skill)
|
bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQEmu::skills::SkillType attack_skill)
|
||||||
{
|
{
|
||||||
Log.Out(Logs::Detail, Logs::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d",
|
Log.Out(Logs::Detail, Logs::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d",
|
||||||
((killer_mob) ? (killer_mob->GetName()) : ("[nullptr]")), damage, spell, attack_skill);
|
((killer_mob) ? (killer_mob->GetName()) : ("[nullptr]")), damage, spell, attack_skill);
|
||||||
@ -2485,7 +2485,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) {
|
|||||||
}
|
}
|
||||||
DS -= DS * attacker->itembonuses.DSMitigation / 100;
|
DS -= DS * attacker->itembonuses.DSMitigation / 100;
|
||||||
}
|
}
|
||||||
attacker->Damage(this, -DS, spellid, SkillAbjuration/*hackish*/, false);
|
attacker->Damage(this, -DS, spellid, EQEmu::skills::SkillAbjuration/*hackish*/, false);
|
||||||
//we can assume there is a spell now
|
//we can assume there is a spell now
|
||||||
auto outapp = new EQApplicationPacket(OP_Damage, sizeof(CombatDamage_Struct));
|
auto outapp = new EQApplicationPacket(OP_Damage, sizeof(CombatDamage_Struct));
|
||||||
CombatDamage_Struct* cds = (CombatDamage_Struct*)outapp->pBuffer;
|
CombatDamage_Struct* cds = (CombatDamage_Struct*)outapp->pBuffer;
|
||||||
@ -2512,7 +2512,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) {
|
|||||||
|
|
||||||
if(rev_ds < 0) {
|
if(rev_ds < 0) {
|
||||||
Log.Out(Logs::Detail, Logs::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName());
|
Log.Out(Logs::Detail, Logs::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName());
|
||||||
attacker->Damage(this, -rev_ds, rev_ds_spell_id, SkillAbjuration/*hackish*/, false); //"this" (us) will get the hate, etc. not sure how this works on Live, but it'll works for now, and tanks will love us for this
|
attacker->Damage(this, -rev_ds, rev_ds_spell_id, EQEmu::skills::SkillAbjuration/*hackish*/, false); //"this" (us) will get the hate, etc. not sure how this works on Live, but it'll works for now, and tanks will love us for this
|
||||||
//do we need to send a damage packet here also?
|
//do we need to send a damage packet here also?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2584,7 +2584,7 @@ int Mob::GetHandToHandDamage(void)
|
|||||||
{
|
{
|
||||||
if (RuleB(Combat, UseRevampHandToHand)) {
|
if (RuleB(Combat, UseRevampHandToHand)) {
|
||||||
// everyone uses this in the revamp!
|
// everyone uses this in the revamp!
|
||||||
int skill = GetSkill(SkillHandtoHand);
|
int skill = GetSkill(EQEmu::skills::SkillHandtoHand);
|
||||||
int epic = 0;
|
int epic = 0;
|
||||||
if (IsClient() && CastToClient()->GetItemIDAt(12) == 10652 && GetLevel() > 46)
|
if (IsClient() && CastToClient()->GetItemIDAt(12) == 10652 && GetLevel() > 46)
|
||||||
epic = 280;
|
epic = 280;
|
||||||
@ -2625,7 +2625,7 @@ int Mob::GetHandToHandDelay(void)
|
|||||||
{
|
{
|
||||||
if (RuleB(Combat, UseRevampHandToHand)) {
|
if (RuleB(Combat, UseRevampHandToHand)) {
|
||||||
// everyone uses this in the revamp!
|
// everyone uses this in the revamp!
|
||||||
int skill = GetSkill(SkillHandtoHand);
|
int skill = GetSkill(EQEmu::skills::SkillHandtoHand);
|
||||||
int epic = 0;
|
int epic = 0;
|
||||||
int iksar = 0;
|
int iksar = 0;
|
||||||
if (IsClient() && CastToClient()->GetItemIDAt(12) == 10652 && GetLevel() > 46)
|
if (IsClient() && CastToClient()->GetItemIDAt(12) == 10652 && GetLevel() > 46)
|
||||||
@ -2968,7 +2968,7 @@ bool Mob::HasRangedProcs() const
|
|||||||
bool Client::CheckDoubleAttack()
|
bool Client::CheckDoubleAttack()
|
||||||
{
|
{
|
||||||
int chance = 0;
|
int chance = 0;
|
||||||
int skill = GetSkill(SkillDoubleAttack);
|
int skill = GetSkill(EQEmu::skills::SkillDoubleAttack);
|
||||||
//Check for bonuses that give you a double attack chance regardless of skill (ie Bestial Frenzy/Harmonious Attack AA)
|
//Check for bonuses that give you a double attack chance regardless of skill (ie Bestial Frenzy/Harmonious Attack AA)
|
||||||
int bonusGiveDA = aabonuses.GiveDoubleAttack + spellbonuses.GiveDoubleAttack + itembonuses.GiveDoubleAttack;
|
int bonusGiveDA = aabonuses.GiveDoubleAttack + spellbonuses.GiveDoubleAttack + itembonuses.GiveDoubleAttack;
|
||||||
if (skill > 0)
|
if (skill > 0)
|
||||||
@ -2989,7 +2989,7 @@ bool Client::CheckDoubleAttack()
|
|||||||
// with varying triple attack skill (1-3% error at least)
|
// with varying triple attack skill (1-3% error at least)
|
||||||
bool Client::CheckTripleAttack()
|
bool Client::CheckTripleAttack()
|
||||||
{
|
{
|
||||||
int chance = GetSkill(SkillTripleAttack);
|
int chance = GetSkill(EQEmu::skills::SkillTripleAttack);
|
||||||
if (chance < 1)
|
if (chance < 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -3013,7 +3013,7 @@ bool Mob::CheckDoubleAttack()
|
|||||||
{
|
{
|
||||||
// Not 100% certain pets follow this or if it's just from pets not always
|
// Not 100% certain pets follow this or if it's just from pets not always
|
||||||
// having the same skills as most mobs
|
// having the same skills as most mobs
|
||||||
int chance = GetSkill(SkillDoubleAttack);
|
int chance = GetSkill(EQEmu::skills::SkillDoubleAttack);
|
||||||
if (GetLevel() > 35)
|
if (GetLevel() > 35)
|
||||||
chance += GetLevel();
|
chance += GetLevel();
|
||||||
|
|
||||||
@ -3024,9 +3024,9 @@ bool Mob::CheckDoubleAttack()
|
|||||||
return zone->random.Int(1, 500) <= chance;
|
return zone->random.Int(1, 500) <= chance;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, const SkillUseTypes skill_used, bool &avoidable, const int8 buffslot, const bool iBuffTic, int special) {
|
void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, const EQEmu::skills::SkillType skill_used, bool &avoidable, const int8 buffslot, const bool iBuffTic, int special) {
|
||||||
// This method is called with skill_used=ABJURE for Damage Shield damage.
|
// This method is called with skill_used=ABJURE for Damage Shield damage.
|
||||||
bool FromDamageShield = (skill_used == SkillAbjuration);
|
bool FromDamageShield = (skill_used == EQEmu::skills::SkillAbjuration);
|
||||||
|
|
||||||
Log.Out(Logs::Detail, Logs::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d",
|
Log.Out(Logs::Detail, Logs::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d",
|
||||||
damage, attacker?attacker->GetName():"NOBODY", skill_used, spell_id, avoidable?"yes":"no", iBuffTic?"":"not ", buffslot);
|
damage, attacker?attacker->GetName():"NOBODY", skill_used, spell_id, avoidable?"yes":"no", iBuffTic?"":"not ", buffslot);
|
||||||
@ -3041,7 +3041,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
|
|||||||
|
|
||||||
// only apply DS if physical damage (no spell damage)
|
// only apply DS if physical damage (no spell damage)
|
||||||
// damage shield calls this function with spell_id set, so its unavoidable
|
// damage shield calls this function with spell_id set, so its unavoidable
|
||||||
if (attacker && damage > 0 && spell_id == SPELL_UNKNOWN && skill_used != SkillArchery && skill_used != SkillThrowing) {
|
if (attacker && damage > 0 && spell_id == SPELL_UNKNOWN && skill_used != EQEmu::skills::SkillArchery && skill_used != EQEmu::skills::SkillThrowing) {
|
||||||
DamageShield(attacker);
|
DamageShield(attacker);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3167,7 +3167,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
//check stun chances if bashing
|
//check stun chances if bashing
|
||||||
if (damage > 0 && ((skill_used == SkillBash || skill_used == SkillKick) && attacker)) {
|
if (damage > 0 && ((skill_used == EQEmu::skills::SkillBash || skill_used == EQEmu::skills::SkillKick) && attacker)) {
|
||||||
// NPCs can stun with their bash/kick as soon as they receive it.
|
// NPCs can stun with their bash/kick as soon as they receive it.
|
||||||
// Clients can stun mobs under level 56 with their kick when they get level 55 or greater.
|
// Clients can stun mobs under level 56 with their kick when they get level 55 or greater.
|
||||||
// Clients have a chance to stun if the mob is 56+
|
// Clients have a chance to stun if the mob is 56+
|
||||||
@ -3181,15 +3181,15 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
|
|||||||
// Less than base immunity
|
// Less than base immunity
|
||||||
// Client vs. Client always uses the chance
|
// Client vs. Client always uses the chance
|
||||||
if (!IsClient() && GetLevel() <= RuleI(Spells, BaseImmunityLevel)) {
|
if (!IsClient() && GetLevel() <= RuleI(Spells, BaseImmunityLevel)) {
|
||||||
if (skill_used == SkillBash) // Bash always will
|
if (skill_used == EQEmu::skills::SkillBash) // Bash always will
|
||||||
stun_chance = 100;
|
stun_chance = 100;
|
||||||
else if (attacker->GetLevel() >= RuleI(Combat, ClientStunLevel))
|
else if (attacker->GetLevel() >= RuleI(Combat, ClientStunLevel))
|
||||||
stun_chance = 100; // only if you're over level 55 and using kick
|
stun_chance = 100; // only if you're over level 55 and using kick
|
||||||
} else { // higher than base immunity or Client vs. Client
|
} else { // higher than base immunity or Client vs. Client
|
||||||
// not sure on this number, use same as NPC for now
|
// not sure on this number, use same as NPC for now
|
||||||
if (skill_used == SkillKick && attacker->GetLevel() < RuleI(Combat, ClientStunLevel))
|
if (skill_used == EQEmu::skills::SkillKick && attacker->GetLevel() < RuleI(Combat, ClientStunLevel))
|
||||||
stun_chance = RuleI(Combat, NPCBashKickStunChance);
|
stun_chance = RuleI(Combat, NPCBashKickStunChance);
|
||||||
else if (skill_used == SkillBash)
|
else if (skill_used == EQEmu::skills::SkillBash)
|
||||||
stun_chance = RuleI(Combat, NPCBashKickStunChance) +
|
stun_chance = RuleI(Combat, NPCBashKickStunChance) +
|
||||||
attacker->spellbonuses.StunBashChance +
|
attacker->spellbonuses.StunBashChance +
|
||||||
attacker->itembonuses.StunBashChance +
|
attacker->itembonuses.StunBashChance +
|
||||||
@ -3268,7 +3268,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
|
|||||||
a->meleepush_xy = attacker->GetHeading() * 2.0f;
|
a->meleepush_xy = attacker->GetHeading() * 2.0f;
|
||||||
if (RuleB(Combat, MeleePush) && damage > 0 && !IsRooted() &&
|
if (RuleB(Combat, MeleePush) && damage > 0 && !IsRooted() &&
|
||||||
(IsClient() || zone->random.Roll(RuleI(Combat, MeleePushChance)))) {
|
(IsClient() || zone->random.Roll(RuleI(Combat, MeleePushChance)))) {
|
||||||
a->force = EQEmu::GetSkillMeleePushForce(skill_used);
|
a->force = EQEmu::skills::GetSkillMeleePushForce(skill_used);
|
||||||
// update NPC stuff
|
// update NPC stuff
|
||||||
auto new_pos = glm::vec3(m_Position.x + (a->force * std::sin(a->meleepush_xy) + m_Delta.x),
|
auto new_pos = glm::vec3(m_Position.x + (a->force * std::sin(a->meleepush_xy) + m_Delta.x),
|
||||||
m_Position.y + (a->force * std::cos(a->meleepush_xy) + m_Delta.y), m_Position.z);
|
m_Position.y + (a->force * std::cos(a->meleepush_xy) + m_Delta.y), m_Position.z);
|
||||||
@ -3868,10 +3868,10 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack
|
|||||||
|
|
||||||
int deadlyChance = 0;
|
int deadlyChance = 0;
|
||||||
int deadlyMod = 0;
|
int deadlyMod = 0;
|
||||||
if(skill == SkillArchery && GetClass() == RANGER && GetSkill(SkillArchery) >= 65)
|
if (skill == EQEmu::skills::SkillArchery && GetClass() == RANGER && GetSkill(EQEmu::skills::SkillArchery) >= 65)
|
||||||
critChance += 6;
|
critChance += 6;
|
||||||
|
|
||||||
if (skill == SkillThrowing && GetClass() == ROGUE && GetSkill(SkillThrowing) >= 65) {
|
if (skill == EQEmu::skills::SkillThrowing && GetClass() == ROGUE && GetSkill(EQEmu::skills::SkillThrowing) >= 65) {
|
||||||
critChance += RuleI(Combat, RogueCritThrowingChance);
|
critChance += RuleI(Combat, RogueCritThrowingChance);
|
||||||
deadlyChance = RuleI(Combat, RogueDeadlyStrikeChance);
|
deadlyChance = RuleI(Combat, RogueDeadlyStrikeChance);
|
||||||
deadlyMod = RuleI(Combat, RogueDeadlyStrikeMod);
|
deadlyMod = RuleI(Combat, RogueDeadlyStrikeMod);
|
||||||
@ -3952,7 +3952,7 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Mob::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse)
|
bool Mob::TryFinishingBlow(Mob *defender, EQEmu::skills::SkillType skillinuse)
|
||||||
{
|
{
|
||||||
if (defender && !defender->IsClient() && defender->GetHPRatio() < 10){
|
if (defender && !defender->IsClient() && defender->GetHPRatio() < 10){
|
||||||
|
|
||||||
@ -4024,7 +4024,7 @@ void Mob::DoRiposte(Mob *defender)
|
|||||||
|
|
||||||
if (defender->GetClass() == MONK)
|
if (defender->GetClass() == MONK)
|
||||||
defender->MonkSpecialAttack(this, defender->aabonuses.GiveDoubleRiposte[2]);
|
defender->MonkSpecialAttack(this, defender->aabonuses.GiveDoubleRiposte[2]);
|
||||||
else if (defender->IsClient() && defender->CastToClient()->HasSkill((SkillUseTypes)defender->aabonuses.GiveDoubleRiposte[2]))
|
else if (defender->IsClient() && defender->CastToClient()->HasSkill((EQEmu::skills::SkillType)defender->aabonuses.GiveDoubleRiposte[2]))
|
||||||
defender->CastToClient()->DoClassAttacks(this, defender->aabonuses.GiveDoubleRiposte[2], true);
|
defender->CastToClient()->DoClassAttacks(this, defender->aabonuses.GiveDoubleRiposte[2], true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4063,7 +4063,7 @@ bool Mob::HasDied() {
|
|||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 Mob::GetDamageTable(SkillUseTypes skillinuse)
|
uint16 Mob::GetDamageTable(EQEmu::skills::SkillType skillinuse)
|
||||||
{
|
{
|
||||||
if(GetLevel() <= 51)
|
if(GetLevel() <= 51)
|
||||||
{
|
{
|
||||||
@ -4156,7 +4156,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
|
|||||||
ProcMod = static_cast<float>(spells[base_spell_id].base2[i]);
|
ProcMod = static_cast<float>(spells[base_spell_id].base2[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (spells[base_spell_id].effectid[i] == SE_LimitToSkill && spells[base_spell_id].base[i] <= HIGHEST_SKILL) {
|
else if (spells[base_spell_id].effectid[i] == SE_LimitToSkill && spells[base_spell_id].base[i] <= EQEmu::skills::HIGHEST_SKILL) {
|
||||||
|
|
||||||
if (CanProc && spells[base_spell_id].base[i] == skill && IsValidSpell(proc_spell_id)) {
|
if (CanProc && spells[base_spell_id].base[i] == skill && IsValidSpell(proc_spell_id)) {
|
||||||
float final_chance = chance * (ProcMod / 100.0f);
|
float final_chance = chance * (ProcMod / 100.0f);
|
||||||
@ -4200,7 +4200,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
|
|||||||
ProcMod = static_cast<float>(spells[base_spell_id].base2[i]);
|
ProcMod = static_cast<float>(spells[base_spell_id].base2[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (spells[base_spell_id].effectid[i] == SE_LimitToSkill && spells[base_spell_id].base[i] <= HIGHEST_SKILL) {
|
else if (spells[base_spell_id].effectid[i] == SE_LimitToSkill && spells[base_spell_id].base[i] <= EQEmu::skills::HIGHEST_SKILL) {
|
||||||
|
|
||||||
if (CanProc && spells[base_spell_id].base[i] == skill && IsValidSpell(proc_spell_id)) {
|
if (CanProc && spells[base_spell_id].base[i] == skill && IsValidSpell(proc_spell_id)) {
|
||||||
float final_chance = chance * (ProcMod / 100.0f);
|
float final_chance = chance * (ProcMod / 100.0f);
|
||||||
@ -4261,7 +4261,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
|
|||||||
proc_spell_id = base1;
|
proc_spell_id = base1;
|
||||||
ProcMod = static_cast<float>(base2);
|
ProcMod = static_cast<float>(base2);
|
||||||
}
|
}
|
||||||
else if(effect_id == SE_LimitToSkill && base1 <= HIGHEST_SKILL) {
|
else if (effect_id == SE_LimitToSkill && base1 <= EQEmu::skills::HIGHEST_SKILL) {
|
||||||
|
|
||||||
if (CanProc && base1 == skill && IsValidSpell(proc_spell_id)) {
|
if (CanProc && base1 == skill && IsValidSpell(proc_spell_id)) {
|
||||||
float final_chance = chance * (ProcMod / 100.0f);
|
float final_chance = chance * (ProcMod / 100.0f);
|
||||||
@ -4406,7 +4406,7 @@ int32 Mob::RuneAbsorb(int32 damage, uint16 type)
|
|||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mob::CommonOutgoingHitSuccess(Mob* defender, int32 &damage, SkillUseTypes skillInUse, ExtraAttackOptions *opts)
|
void Mob::CommonOutgoingHitSuccess(Mob* defender, int32 &damage, EQEmu::skills::SkillType skillInUse, ExtraAttackOptions *opts)
|
||||||
{
|
{
|
||||||
if (!defender)
|
if (!defender)
|
||||||
return;
|
return;
|
||||||
@ -4623,15 +4623,15 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
|
|||||||
// extra off hand non-sense, can only double with skill of 150 or above
|
// extra off hand non-sense, can only double with skill of 150 or above
|
||||||
// or you have any amount of GiveDoubleAttack
|
// or you have any amount of GiveDoubleAttack
|
||||||
if (candouble && hand == EQEmu::legacy::SlotSecondary)
|
if (candouble && hand == EQEmu::legacy::SlotSecondary)
|
||||||
candouble = GetSkill(SkillDoubleAttack) > 149 || (aabonuses.GiveDoubleAttack + spellbonuses.GiveDoubleAttack + itembonuses.GiveDoubleAttack) > 0;
|
candouble = GetSkill(EQEmu::skills::SkillDoubleAttack) > 149 || (aabonuses.GiveDoubleAttack + spellbonuses.GiveDoubleAttack + itembonuses.GiveDoubleAttack) > 0;
|
||||||
|
|
||||||
if (candouble) {
|
if (candouble) {
|
||||||
CheckIncreaseSkill(SkillDoubleAttack, target, -10);
|
CheckIncreaseSkill(EQEmu::skills::SkillDoubleAttack, target, -10);
|
||||||
if (CheckDoubleAttack()) {
|
if (CheckDoubleAttack()) {
|
||||||
Attack(target, hand, false, false, IsFromSpell);
|
Attack(target, hand, false, false, IsFromSpell);
|
||||||
// you can only triple from the main hand
|
// you can only triple from the main hand
|
||||||
if (hand == EQEmu::legacy::SlotPrimary && CanThisClassTripleAttack()) {
|
if (hand == EQEmu::legacy::SlotPrimary && CanThisClassTripleAttack()) {
|
||||||
CheckIncreaseSkill(SkillTripleAttack, target, -10);
|
CheckIncreaseSkill(EQEmu::skills::SkillTripleAttack, target, -10);
|
||||||
if (CheckTripleAttack())
|
if (CheckTripleAttack())
|
||||||
Attack(target, hand, false, false, IsFromSpell);
|
Attack(target, hand, false, false, IsFromSpell);
|
||||||
}
|
}
|
||||||
@ -4659,7 +4659,7 @@ bool Mob::CheckDualWield()
|
|||||||
{
|
{
|
||||||
// Pets /might/ follow a slightly different progression
|
// Pets /might/ follow a slightly different progression
|
||||||
// although it could all be from pets having different skills than most mobs
|
// although it could all be from pets having different skills than most mobs
|
||||||
int chance = GetSkill(SkillDualWield);
|
int chance = GetSkill(EQEmu::skills::SkillDualWield);
|
||||||
if (GetLevel() > 35)
|
if (GetLevel() > 35)
|
||||||
chance += GetLevel();
|
chance += GetLevel();
|
||||||
|
|
||||||
@ -4673,7 +4673,7 @@ bool Mob::CheckDualWield()
|
|||||||
|
|
||||||
bool Client::CheckDualWield()
|
bool Client::CheckDualWield()
|
||||||
{
|
{
|
||||||
int chance = GetSkill(SkillDualWield) + GetLevel();
|
int chance = GetSkill(EQEmu::skills::SkillDualWield) + GetLevel();
|
||||||
|
|
||||||
chance += aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity;
|
chance += aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity;
|
||||||
int per_inc = spellbonuses.DualWieldChance + aabonuses.DualWieldChance + itembonuses.DualWieldChance;
|
int per_inc = spellbonuses.DualWieldChance + aabonuses.DualWieldChance + itembonuses.DualWieldChance;
|
||||||
|
|||||||
@ -34,8 +34,8 @@ public:
|
|||||||
~Beacon();
|
~Beacon();
|
||||||
|
|
||||||
//abstract virtual function implementations requird by base abstract class
|
//abstract virtual function implementations requird by base abstract class
|
||||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) { return true; }
|
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType 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, int special = 0) { return; }
|
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0) { return; }
|
||||||
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||||
ExtraAttackOptions *opts = nullptr, int special = 0) { return false; }
|
ExtraAttackOptions *opts = nullptr, int special = 0) { return false; }
|
||||||
virtual bool HasRaid() { return false; }
|
virtual bool HasRaid() { return false; }
|
||||||
|
|||||||
142
zone/bonuses.cpp
142
zone/bonuses.cpp
@ -507,7 +507,7 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->ExtraDmgSkill != 0 && item->ExtraDmgSkill <= HIGHEST_SKILL) {
|
if (item->ExtraDmgSkill != 0 && item->ExtraDmgSkill <= EQEmu::skills::HIGHEST_SKILL) {
|
||||||
if ((newbon->SkillDamageAmount[item->ExtraDmgSkill] + item->ExtraDmgAmt) >
|
if ((newbon->SkillDamageAmount[item->ExtraDmgSkill] + item->ExtraDmgAmt) >
|
||||||
RuleI(Character, ItemExtraDmgCap))
|
RuleI(Character, ItemExtraDmgCap))
|
||||||
newbon->SkillDamageAmount[item->ExtraDmgSkill] = RuleI(Character, ItemExtraDmgCap);
|
newbon->SkillDamageAmount[item->ExtraDmgSkill] = RuleI(Character, ItemExtraDmgCap);
|
||||||
@ -517,7 +517,7 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Process when ammo_slot_item = true or false
|
// Process when ammo_slot_item = true or false
|
||||||
if (item->SkillModValue != 0 && item->SkillModType <= HIGHEST_SKILL) {
|
if (item->SkillModValue != 0 && item->SkillModType <= EQEmu::skills::HIGHEST_SKILL) {
|
||||||
if ((item->SkillModValue > 0 && newbon->skillmod[item->SkillModType] < item->SkillModValue) ||
|
if ((item->SkillModValue > 0 && newbon->skillmod[item->SkillModType] < item->SkillModValue) ||
|
||||||
(item->SkillModValue < 0 && newbon->skillmod[item->SkillModType] > item->SkillModValue)) {
|
(item->SkillModValue < 0 && newbon->skillmod[item->SkillModType] > item->SkillModValue)) {
|
||||||
|
|
||||||
@ -672,10 +672,10 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
|
|||||||
// Note: AA effects that use accuracy are skill limited, while spell effect is not.
|
// Note: AA effects that use accuracy are skill limited, while spell effect is not.
|
||||||
case SE_Accuracy:
|
case SE_Accuracy:
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
if ((base2 == ALL_SKILLS) && (newbon->Accuracy[HIGHEST_SKILL + 1] < base1))
|
if ((base2 == ALL_SKILLS) && (newbon->Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] < base1))
|
||||||
newbon->Accuracy[HIGHEST_SKILL + 1] = base1;
|
newbon->Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] = base1;
|
||||||
else if (newbon->Accuracy[base2] < base1)
|
else if (newbon->Accuracy[base2] < base1)
|
||||||
newbon->Accuracy[base2] += base1;
|
newbon->Accuracy[base2] += base1;
|
||||||
break;
|
break;
|
||||||
@ -1015,10 +1015,10 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
|
|||||||
|
|
||||||
case SE_HitChance: {
|
case SE_HitChance: {
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
if (base2 == ALL_SKILLS)
|
if (base2 == ALL_SKILLS)
|
||||||
newbon->HitChanceEffect[HIGHEST_SKILL + 1] += base1;
|
newbon->HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1] += base1;
|
||||||
else
|
else
|
||||||
newbon->HitChanceEffect[base2] += base1;
|
newbon->HitChanceEffect[base2] += base1;
|
||||||
}
|
}
|
||||||
@ -1069,21 +1069,21 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
|
|||||||
|
|
||||||
case SE_CriticalHitChance: {
|
case SE_CriticalHitChance: {
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
if (base2 == ALL_SKILLS)
|
if (base2 == ALL_SKILLS)
|
||||||
newbon->CriticalHitChance[HIGHEST_SKILL + 1] += base1;
|
newbon->CriticalHitChance[EQEmu::skills::HIGHEST_SKILL + 1] += base1;
|
||||||
else
|
else
|
||||||
newbon->CriticalHitChance[base2] += base1;
|
newbon->CriticalHitChance[base2] += base1;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case SE_CriticalDamageMob: {
|
case SE_CriticalDamageMob: {
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
// base1 = effect value, base2 = skill restrictions(-1 for all)
|
// base1 = effect value, base2 = skill restrictions(-1 for all)
|
||||||
if (base2 == ALL_SKILLS)
|
if (base2 == ALL_SKILLS)
|
||||||
newbon->CritDmgMob[HIGHEST_SKILL + 1] += base1;
|
newbon->CritDmgMob[EQEmu::skills::HIGHEST_SKILL + 1] += base1;
|
||||||
else
|
else
|
||||||
newbon->CritDmgMob[base2] += base1;
|
newbon->CritDmgMob[base2] += base1;
|
||||||
break;
|
break;
|
||||||
@ -1109,10 +1109,10 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
|
|||||||
|
|
||||||
case SE_SkillDamageAmount: {
|
case SE_SkillDamageAmount: {
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
if (base2 == ALL_SKILLS)
|
if (base2 == ALL_SKILLS)
|
||||||
newbon->SkillDamageAmount[HIGHEST_SKILL + 1] += base1;
|
newbon->SkillDamageAmount[EQEmu::skills::HIGHEST_SKILL + 1] += base1;
|
||||||
else
|
else
|
||||||
newbon->SkillDamageAmount[base2] += base1;
|
newbon->SkillDamageAmount[base2] += base1;
|
||||||
break;
|
break;
|
||||||
@ -1128,10 +1128,10 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
|
|||||||
|
|
||||||
case SE_DamageModifier: {
|
case SE_DamageModifier: {
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
if (base2 == ALL_SKILLS)
|
if (base2 == ALL_SKILLS)
|
||||||
newbon->DamageModifier[HIGHEST_SKILL + 1] += base1;
|
newbon->DamageModifier[EQEmu::skills::HIGHEST_SKILL + 1] += base1;
|
||||||
else
|
else
|
||||||
newbon->DamageModifier[base2] += base1;
|
newbon->DamageModifier[base2] += base1;
|
||||||
break;
|
break;
|
||||||
@ -1139,10 +1139,10 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
|
|||||||
|
|
||||||
case SE_DamageModifier2: {
|
case SE_DamageModifier2: {
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
if (base2 == ALL_SKILLS)
|
if (base2 == ALL_SKILLS)
|
||||||
newbon->DamageModifier2[HIGHEST_SKILL + 1] += base1;
|
newbon->DamageModifier2[EQEmu::skills::HIGHEST_SKILL + 1] += base1;
|
||||||
else
|
else
|
||||||
newbon->DamageModifier2[base2] += base1;
|
newbon->DamageModifier2[base2] += base1;
|
||||||
break;
|
break;
|
||||||
@ -1178,7 +1178,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
|
|||||||
// Physically raises skill cap ie if 55/55 it will raise to 55/60
|
// Physically raises skill cap ie if 55/55 it will raise to 55/60
|
||||||
case SE_RaiseSkillCap: {
|
case SE_RaiseSkillCap: {
|
||||||
|
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (newbon->RaiseSkillCap[base2] < base1)
|
if (newbon->RaiseSkillCap[base2] < base1)
|
||||||
@ -1350,9 +1350,9 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
|
|||||||
|
|
||||||
case SE_LimitToSkill: {
|
case SE_LimitToSkill: {
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
if (base1 <= HIGHEST_SKILL)
|
if (base1 <= EQEmu::skills::HIGHEST_SKILL)
|
||||||
newbon->LimitToSkill[base1] = true;
|
newbon->LimitToSkill[base1] = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1416,7 +1416,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
|
|||||||
|
|
||||||
case SE_ReduceTradeskillFail:{
|
case SE_ReduceTradeskillFail:{
|
||||||
|
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
newbon->ReduceTradeskillFail[base2] += base1;
|
newbon->ReduceTradeskillFail[base2] += base1;
|
||||||
@ -1938,26 +1938,26 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
case SE_CriticalHitChance:
|
case SE_CriticalHitChance:
|
||||||
{
|
{
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
if (AdditiveWornBonus) {
|
if (AdditiveWornBonus) {
|
||||||
if(base2 == ALL_SKILLS)
|
if(base2 == ALL_SKILLS)
|
||||||
new_bonus->CriticalHitChance[HIGHEST_SKILL+1] += effect_value;
|
new_bonus->CriticalHitChance[EQEmu::skills::HIGHEST_SKILL + 1] += effect_value;
|
||||||
else
|
else
|
||||||
new_bonus->CriticalHitChance[base2] += effect_value;
|
new_bonus->CriticalHitChance[base2] += effect_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(effect_value < 0) {
|
else if(effect_value < 0) {
|
||||||
|
|
||||||
if(base2 == ALL_SKILLS && new_bonus->CriticalHitChance[HIGHEST_SKILL+1] > effect_value)
|
if (base2 == ALL_SKILLS && new_bonus->CriticalHitChance[EQEmu::skills::HIGHEST_SKILL + 1] > effect_value)
|
||||||
new_bonus->CriticalHitChance[HIGHEST_SKILL+1] = effect_value;
|
new_bonus->CriticalHitChance[EQEmu::skills::HIGHEST_SKILL + 1] = effect_value;
|
||||||
else if(base2 != ALL_SKILLS && new_bonus->CriticalHitChance[base2] > effect_value)
|
else if(base2 != ALL_SKILLS && new_bonus->CriticalHitChance[base2] > effect_value)
|
||||||
new_bonus->CriticalHitChance[base2] = effect_value;
|
new_bonus->CriticalHitChance[base2] = effect_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
else if(base2 == ALL_SKILLS && new_bonus->CriticalHitChance[HIGHEST_SKILL+1] < effect_value)
|
else if (base2 == ALL_SKILLS && new_bonus->CriticalHitChance[EQEmu::skills::HIGHEST_SKILL + 1] < effect_value)
|
||||||
new_bonus->CriticalHitChance[HIGHEST_SKILL+1] = effect_value;
|
new_bonus->CriticalHitChance[EQEmu::skills::HIGHEST_SKILL + 1] = effect_value;
|
||||||
else if(base2 != ALL_SKILLS && new_bonus->CriticalHitChance[base2] < effect_value)
|
else if(base2 != ALL_SKILLS && new_bonus->CriticalHitChance[base2] < effect_value)
|
||||||
new_bonus->CriticalHitChance[base2] = effect_value;
|
new_bonus->CriticalHitChance[base2] = effect_value;
|
||||||
|
|
||||||
@ -2144,24 +2144,24 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
case SE_HitChance:
|
case SE_HitChance:
|
||||||
{
|
{
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (AdditiveWornBonus){
|
if (AdditiveWornBonus){
|
||||||
if(base2 == ALL_SKILLS)
|
if(base2 == ALL_SKILLS)
|
||||||
new_bonus->HitChanceEffect[HIGHEST_SKILL+1] += effect_value;
|
new_bonus->HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1] += effect_value;
|
||||||
else
|
else
|
||||||
new_bonus->HitChanceEffect[base2] += effect_value;
|
new_bonus->HitChanceEffect[base2] += effect_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(base2 == ALL_SKILLS){
|
else if(base2 == ALL_SKILLS){
|
||||||
|
|
||||||
if ((effect_value < 0) && (new_bonus->HitChanceEffect[HIGHEST_SKILL+1] > effect_value))
|
if ((effect_value < 0) && (new_bonus->HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1] > effect_value))
|
||||||
new_bonus->HitChanceEffect[HIGHEST_SKILL+1] = effect_value;
|
new_bonus->HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1] = effect_value;
|
||||||
|
|
||||||
else if (!new_bonus->HitChanceEffect[HIGHEST_SKILL+1] ||
|
else if (!new_bonus->HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1] ||
|
||||||
((new_bonus->HitChanceEffect[HIGHEST_SKILL+1] > 0) && (new_bonus->HitChanceEffect[HIGHEST_SKILL+1] < effect_value)))
|
((new_bonus->HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1] > 0) && (new_bonus->HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1] < effect_value)))
|
||||||
new_bonus->HitChanceEffect[HIGHEST_SKILL+1] = effect_value;
|
new_bonus->HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1] = effect_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
@ -2181,9 +2181,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
case SE_DamageModifier:
|
case SE_DamageModifier:
|
||||||
{
|
{
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
int skill = base2 == ALL_SKILLS ? HIGHEST_SKILL + 1 : base2;
|
int skill = base2 == ALL_SKILLS ? EQEmu::skills::HIGHEST_SKILL + 1 : base2;
|
||||||
if (effect_value < 0 && new_bonus->DamageModifier[skill] > effect_value)
|
if (effect_value < 0 && new_bonus->DamageModifier[skill] > effect_value)
|
||||||
new_bonus->DamageModifier[skill] = effect_value;
|
new_bonus->DamageModifier[skill] = effect_value;
|
||||||
else if (effect_value > 0 && new_bonus->DamageModifier[skill] < effect_value)
|
else if (effect_value > 0 && new_bonus->DamageModifier[skill] < effect_value)
|
||||||
@ -2194,9 +2194,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
case SE_DamageModifier2:
|
case SE_DamageModifier2:
|
||||||
{
|
{
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
int skill = base2 == ALL_SKILLS ? HIGHEST_SKILL + 1 : base2;
|
int skill = base2 == ALL_SKILLS ? EQEmu::skills::HIGHEST_SKILL + 1 : base2;
|
||||||
if (effect_value < 0 && new_bonus->DamageModifier2[skill] > effect_value)
|
if (effect_value < 0 && new_bonus->DamageModifier2[skill] > effect_value)
|
||||||
new_bonus->DamageModifier2[skill] = effect_value;
|
new_bonus->DamageModifier2[skill] = effect_value;
|
||||||
else if (effect_value > 0 && new_bonus->DamageModifier2[skill] < effect_value)
|
else if (effect_value > 0 && new_bonus->DamageModifier2[skill] < effect_value)
|
||||||
@ -2207,9 +2207,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
case SE_MinDamageModifier:
|
case SE_MinDamageModifier:
|
||||||
{
|
{
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
int skill = base2 == ALL_SKILLS ? HIGHEST_SKILL + 1 : base2;
|
int skill = base2 == ALL_SKILLS ? EQEmu::skills::HIGHEST_SKILL + 1 : base2;
|
||||||
if (effect_value < 0 && new_bonus->MinDamageModifier[skill] > effect_value)
|
if (effect_value < 0 && new_bonus->MinDamageModifier[skill] > effect_value)
|
||||||
new_bonus->MinDamageModifier[skill] = effect_value;
|
new_bonus->MinDamageModifier[skill] = effect_value;
|
||||||
else if (effect_value > 0 && new_bonus->MinDamageModifier[skill] < effect_value)
|
else if (effect_value > 0 && new_bonus->MinDamageModifier[skill] < effect_value)
|
||||||
@ -2284,14 +2284,14 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
case SE_Accuracy:
|
case SE_Accuracy:
|
||||||
{
|
{
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
if ((effect_value < 0) && (new_bonus->Accuracy[HIGHEST_SKILL+1] > effect_value))
|
if ((effect_value < 0) && (new_bonus->Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] > effect_value))
|
||||||
new_bonus->Accuracy[HIGHEST_SKILL+1] = effect_value;
|
new_bonus->Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] = effect_value;
|
||||||
|
|
||||||
else if (!new_bonus->Accuracy[HIGHEST_SKILL+1] ||
|
else if (!new_bonus->Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] ||
|
||||||
((new_bonus->Accuracy[HIGHEST_SKILL+1] > 0) && (new_bonus->Accuracy[HIGHEST_SKILL+1] < effect_value)))
|
((new_bonus->Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] > 0) && (new_bonus->Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] < effect_value)))
|
||||||
new_bonus->Accuracy[HIGHEST_SKILL+1] = effect_value;
|
new_bonus->Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] = effect_value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2310,19 +2310,19 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
case SE_SkillDamageTaken:
|
case SE_SkillDamageTaken:
|
||||||
{
|
{
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
//When using npc_spells_effects if MAX value set, use stackable quest based modifier.
|
//When using npc_spells_effects if MAX value set, use stackable quest based modifier.
|
||||||
if (IsAISpellEffect && max){
|
if (IsAISpellEffect && max){
|
||||||
if(base2 == ALL_SKILLS)
|
if(base2 == ALL_SKILLS)
|
||||||
SkillDmgTaken_Mod[HIGHEST_SKILL+1] = effect_value;
|
SkillDmgTaken_Mod[EQEmu::skills::HIGHEST_SKILL + 1] = effect_value;
|
||||||
else
|
else
|
||||||
SkillDmgTaken_Mod[base2] = effect_value;
|
SkillDmgTaken_Mod[base2] = effect_value;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
if(base2 == ALL_SKILLS)
|
if(base2 == ALL_SKILLS)
|
||||||
new_bonus->SkillDmgTaken[HIGHEST_SKILL+1] += effect_value;
|
new_bonus->SkillDmgTaken[EQEmu::skills::HIGHEST_SKILL + 1] += effect_value;
|
||||||
else
|
else
|
||||||
new_bonus->SkillDmgTaken[base2] += effect_value;
|
new_bonus->SkillDmgTaken[base2] += effect_value;
|
||||||
|
|
||||||
@ -2431,10 +2431,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
case SE_CriticalDamageMob:
|
case SE_CriticalDamageMob:
|
||||||
{
|
{
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
if(base2 == ALL_SKILLS)
|
if(base2 == ALL_SKILLS)
|
||||||
new_bonus->CritDmgMob[HIGHEST_SKILL+1] += effect_value;
|
new_bonus->CritDmgMob[EQEmu::skills::HIGHEST_SKILL + 1] += effect_value;
|
||||||
else
|
else
|
||||||
new_bonus->CritDmgMob[base2] += effect_value;
|
new_bonus->CritDmgMob[base2] += effect_value;
|
||||||
break;
|
break;
|
||||||
@ -2450,10 +2450,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
case SE_SkillDamageAmount:
|
case SE_SkillDamageAmount:
|
||||||
{
|
{
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
if(base2 == ALL_SKILLS)
|
if(base2 == ALL_SKILLS)
|
||||||
new_bonus->SkillDamageAmount[HIGHEST_SKILL+1] += effect_value;
|
new_bonus->SkillDamageAmount[EQEmu::skills::HIGHEST_SKILL + 1] += effect_value;
|
||||||
else
|
else
|
||||||
new_bonus->SkillDamageAmount[base2] += effect_value;
|
new_bonus->SkillDamageAmount[base2] += effect_value;
|
||||||
break;
|
break;
|
||||||
@ -2558,10 +2558,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
case SE_SkillDamageAmount2:
|
case SE_SkillDamageAmount2:
|
||||||
{
|
{
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
if(base2 == ALL_SKILLS)
|
if(base2 == ALL_SKILLS)
|
||||||
new_bonus->SkillDamageAmount2[HIGHEST_SKILL+1] += effect_value;
|
new_bonus->SkillDamageAmount2[EQEmu::skills::HIGHEST_SKILL + 1] += effect_value;
|
||||||
else
|
else
|
||||||
new_bonus->SkillDamageAmount2[base2] += effect_value;
|
new_bonus->SkillDamageAmount2[base2] += effect_value;
|
||||||
break;
|
break;
|
||||||
@ -3096,9 +3096,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
|
|
||||||
case SE_LimitToSkill:{
|
case SE_LimitToSkill:{
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
if (effect_value <= HIGHEST_SKILL){
|
if (effect_value <= EQEmu::skills::HIGHEST_SKILL){
|
||||||
new_bonus->LimitToSkill[effect_value] = true;
|
new_bonus->LimitToSkill[effect_value] = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -3155,7 +3155,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
|
|
||||||
case SE_ReduceTradeskillFail:{
|
case SE_ReduceTradeskillFail:{
|
||||||
|
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
new_bonus->ReduceTradeskillFail[base2] += effect_value;
|
new_bonus->ReduceTradeskillFail[base2] += effect_value;
|
||||||
@ -3168,7 +3168,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_RaiseSkillCap: {
|
case SE_RaiseSkillCap: {
|
||||||
if (base2 > HIGHEST_SKILL)
|
if (base2 > EQEmu::skills::HIGHEST_SKILL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (new_bonus->RaiseSkillCap[base2] < effect_value)
|
if (new_bonus->RaiseSkillCap[base2] < effect_value)
|
||||||
@ -3866,7 +3866,7 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
|
|||||||
|
|
||||||
case SE_CriticalHitChance:
|
case SE_CriticalHitChance:
|
||||||
{
|
{
|
||||||
for(int e = 0; e < HIGHEST_SKILL+1; e++)
|
for (int e = 0; e < EQEmu::skills::HIGHEST_SKILL + 1; e++)
|
||||||
{
|
{
|
||||||
spellbonuses.CriticalHitChance[e] = effect_value;
|
spellbonuses.CriticalHitChance[e] = effect_value;
|
||||||
aabonuses.CriticalHitChance[e] = effect_value;
|
aabonuses.CriticalHitChance[e] = effect_value;
|
||||||
@ -3984,7 +3984,7 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
|
|||||||
|
|
||||||
case SE_HitChance:
|
case SE_HitChance:
|
||||||
{
|
{
|
||||||
for(int e = 0; e < HIGHEST_SKILL+1; e++)
|
for (int e = 0; e < EQEmu::skills::HIGHEST_SKILL + 1; e++)
|
||||||
{
|
{
|
||||||
spellbonuses.HitChanceEffect[e] = effect_value;
|
spellbonuses.HitChanceEffect[e] = effect_value;
|
||||||
aabonuses.HitChanceEffect[e] = effect_value;
|
aabonuses.HitChanceEffect[e] = effect_value;
|
||||||
@ -3995,7 +3995,7 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
|
|||||||
|
|
||||||
case SE_DamageModifier:
|
case SE_DamageModifier:
|
||||||
{
|
{
|
||||||
for(int e = 0; e < HIGHEST_SKILL+1; e++)
|
for (int e = 0; e < EQEmu::skills::HIGHEST_SKILL + 1; e++)
|
||||||
{
|
{
|
||||||
spellbonuses.DamageModifier[e] = effect_value;
|
spellbonuses.DamageModifier[e] = effect_value;
|
||||||
aabonuses.DamageModifier[e] = effect_value;
|
aabonuses.DamageModifier[e] = effect_value;
|
||||||
@ -4006,7 +4006,7 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
|
|||||||
|
|
||||||
case SE_DamageModifier2:
|
case SE_DamageModifier2:
|
||||||
{
|
{
|
||||||
for(int e = 0; e < HIGHEST_SKILL+1; e++)
|
for (int e = 0; e < EQEmu::skills::HIGHEST_SKILL + 1; e++)
|
||||||
{
|
{
|
||||||
spellbonuses.DamageModifier2[e] = effect_value;
|
spellbonuses.DamageModifier2[e] = effect_value;
|
||||||
aabonuses.DamageModifier2[e] = effect_value;
|
aabonuses.DamageModifier2[e] = effect_value;
|
||||||
@ -4017,7 +4017,7 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
|
|||||||
|
|
||||||
case SE_MinDamageModifier:
|
case SE_MinDamageModifier:
|
||||||
{
|
{
|
||||||
for(int e = 0; e < HIGHEST_SKILL+1; e++)
|
for (int e = 0; e < EQEmu::skills::HIGHEST_SKILL + 1; e++)
|
||||||
{
|
{
|
||||||
spellbonuses.MinDamageModifier[e] = effect_value;
|
spellbonuses.MinDamageModifier[e] = effect_value;
|
||||||
aabonuses.MinDamageModifier[e] = effect_value;
|
aabonuses.MinDamageModifier[e] = effect_value;
|
||||||
@ -4058,10 +4058,10 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
|
|||||||
|
|
||||||
case SE_Accuracy:
|
case SE_Accuracy:
|
||||||
{
|
{
|
||||||
spellbonuses.Accuracy[HIGHEST_SKILL+1] = effect_value;
|
spellbonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] = effect_value;
|
||||||
itembonuses.Accuracy[HIGHEST_SKILL+1] = effect_value;
|
itembonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] = effect_value;
|
||||||
|
|
||||||
for(int e = 0; e < HIGHEST_SKILL+1; e++)
|
for (int e = 0; e < EQEmu::skills::HIGHEST_SKILL + 1; e++)
|
||||||
{
|
{
|
||||||
aabonuses.Accuracy[e] = effect_value;
|
aabonuses.Accuracy[e] = effect_value;
|
||||||
}
|
}
|
||||||
@ -4088,7 +4088,7 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
|
|||||||
|
|
||||||
case SE_SkillDamageTaken:
|
case SE_SkillDamageTaken:
|
||||||
{
|
{
|
||||||
for(int e = 0; e < HIGHEST_SKILL+1; e++)
|
for (int e = 0; e < EQEmu::skills::HIGHEST_SKILL + 1; e++)
|
||||||
{
|
{
|
||||||
spellbonuses.SkillDmgTaken[e] = effect_value;
|
spellbonuses.SkillDmgTaken[e] = effect_value;
|
||||||
aabonuses.SkillDmgTaken[e] = effect_value;
|
aabonuses.SkillDmgTaken[e] = effect_value;
|
||||||
@ -4193,7 +4193,7 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
|
|||||||
|
|
||||||
case SE_CriticalDamageMob:
|
case SE_CriticalDamageMob:
|
||||||
{
|
{
|
||||||
for(int e = 0; e < HIGHEST_SKILL+1; e++)
|
for (int e = 0; e < EQEmu::skills::HIGHEST_SKILL + 1; e++)
|
||||||
{
|
{
|
||||||
spellbonuses.CritDmgMob[e] = effect_value;
|
spellbonuses.CritDmgMob[e] = effect_value;
|
||||||
aabonuses.CritDmgMob[e] = effect_value;
|
aabonuses.CritDmgMob[e] = effect_value;
|
||||||
@ -4204,7 +4204,7 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
|
|||||||
|
|
||||||
case SE_SkillDamageAmount:
|
case SE_SkillDamageAmount:
|
||||||
{
|
{
|
||||||
for(int e = 0; e < HIGHEST_SKILL+1; e++)
|
for (int e = 0; e < EQEmu::skills::HIGHEST_SKILL + 1; e++)
|
||||||
{
|
{
|
||||||
spellbonuses.SkillDamageAmount[e] = effect_value;
|
spellbonuses.SkillDamageAmount[e] = effect_value;
|
||||||
aabonuses.SkillDamageAmount[e] = effect_value;
|
aabonuses.SkillDamageAmount[e] = effect_value;
|
||||||
@ -4255,7 +4255,7 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
|
|||||||
|
|
||||||
case SE_SkillDamageAmount2:
|
case SE_SkillDamageAmount2:
|
||||||
{
|
{
|
||||||
for(int e = 0; e < HIGHEST_SKILL+1; e++)
|
for (int e = 0; e < EQEmu::skills::HIGHEST_SKILL + 1; e++)
|
||||||
{
|
{
|
||||||
spellbonuses.SkillDamageAmount2[e] = effect_value;
|
spellbonuses.SkillDamageAmount2[e] = effect_value;
|
||||||
aabonuses.SkillDamageAmount2[e] = effect_value;
|
aabonuses.SkillDamageAmount2[e] = effect_value;
|
||||||
|
|||||||
207
zone/bot.cpp
207
zone/bot.cpp
@ -23,6 +23,7 @@
|
|||||||
#include "doors.h"
|
#include "doors.h"
|
||||||
#include "quest_parser_collection.h"
|
#include "quest_parser_collection.h"
|
||||||
#include "../common/string_util.h"
|
#include "../common/string_util.h"
|
||||||
|
#include "../common/say_link.h"
|
||||||
|
|
||||||
extern volatile bool is_zone_loaded;
|
extern volatile bool is_zone_loaded;
|
||||||
|
|
||||||
@ -1139,16 +1140,16 @@ int32 Bot::acmod() {
|
|||||||
void Bot::GenerateArmorClass() {
|
void Bot::GenerateArmorClass() {
|
||||||
/// new formula
|
/// new formula
|
||||||
int avoidance = 0;
|
int avoidance = 0;
|
||||||
avoidance = (acmod() + ((GetSkill(SkillDefense) * 16) / 9));
|
avoidance = (acmod() + ((GetSkill(EQEmu::skills::SkillDefense) * 16) / 9));
|
||||||
if(avoidance < 0)
|
if(avoidance < 0)
|
||||||
avoidance = 0;
|
avoidance = 0;
|
||||||
|
|
||||||
int mitigation = 0;
|
int mitigation = 0;
|
||||||
if(GetClass() == WIZARD || GetClass() == MAGICIAN || GetClass() == NECROMANCER || GetClass() == ENCHANTER) {
|
if(GetClass() == WIZARD || GetClass() == MAGICIAN || GetClass() == NECROMANCER || GetClass() == ENCHANTER) {
|
||||||
mitigation = (GetSkill(SkillDefense) / 4 + (itembonuses.AC + 1));
|
mitigation = (GetSkill(EQEmu::skills::SkillDefense) / 4 + (itembonuses.AC + 1));
|
||||||
mitigation -= 4;
|
mitigation -= 4;
|
||||||
} else {
|
} else {
|
||||||
mitigation = (GetSkill(SkillDefense) / 3 + ((itembonuses.AC * 4) / 3));
|
mitigation = (GetSkill(EQEmu::skills::SkillDefense) / 3 + ((itembonuses.AC * 4) / 3));
|
||||||
if(GetClass() == MONK)
|
if(GetClass() == MONK)
|
||||||
mitigation += (GetLevel() * 13 / 10); //the 13/10 might be wrong, but it is close...
|
mitigation += (GetLevel() * 13 / 10); //the 13/10 might be wrong, but it is close...
|
||||||
}
|
}
|
||||||
@ -1173,36 +1174,36 @@ void Bot::GenerateArmorClass() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint16 Bot::GetPrimarySkillValue() {
|
uint16 Bot::GetPrimarySkillValue() {
|
||||||
SkillUseTypes skill = HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
|
EQEmu::skills::SkillType skill = EQEmu::skills::HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
|
||||||
bool equiped = m_inv.GetItem(EQEmu::legacy::SlotPrimary);
|
bool equiped = m_inv.GetItem(EQEmu::legacy::SlotPrimary);
|
||||||
if(!equiped)
|
if(!equiped)
|
||||||
skill = SkillHandtoHand;
|
skill = EQEmu::skills::SkillHandtoHand;
|
||||||
else {
|
else {
|
||||||
uint8 type = m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
uint8 type = m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case EQEmu::item::ItemType1HSlash:
|
case EQEmu::item::ItemType1HSlash:
|
||||||
skill = Skill1HSlashing;
|
skill = EQEmu::skills::Skill1HSlashing;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType2HSlash:
|
case EQEmu::item::ItemType2HSlash:
|
||||||
skill = Skill2HSlashing;
|
skill = EQEmu::skills::Skill2HSlashing;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType1HPiercing:
|
case EQEmu::item::ItemType1HPiercing:
|
||||||
skill = Skill1HPiercing;
|
skill = EQEmu::skills::Skill1HPiercing;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType1HBlunt:
|
case EQEmu::item::ItemType1HBlunt:
|
||||||
skill = Skill1HBlunt;
|
skill = EQEmu::skills::Skill1HBlunt;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType2HBlunt:
|
case EQEmu::item::ItemType2HBlunt:
|
||||||
skill = Skill2HBlunt;
|
skill = EQEmu::skills::Skill2HBlunt;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType2HPiercing:
|
case EQEmu::item::ItemType2HPiercing:
|
||||||
skill = Skill2HPiercing;
|
skill = EQEmu::skills::Skill2HPiercing;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemTypeMartial:
|
case EQEmu::item::ItemTypeMartial:
|
||||||
skill = SkillHandtoHand;
|
skill = EQEmu::skills::SkillHandtoHand;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
skill = SkillHandtoHand;
|
skill = EQEmu::skills::SkillHandtoHand;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1210,7 +1211,7 @@ uint16 Bot::GetPrimarySkillValue() {
|
|||||||
return GetSkill(skill);
|
return GetSkill(skill);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 Bot::MaxSkill(SkillUseTypes skillid, uint16 class_, uint16 level) const {
|
uint16 Bot::MaxSkill(EQEmu::skills::SkillType skillid, uint16 class_, uint16 level) const {
|
||||||
return(database.GetSkillCap(class_, skillid, level));
|
return(database.GetSkillCap(class_, skillid, level));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1218,7 +1219,7 @@ uint32 Bot::GetTotalATK() {
|
|||||||
uint32 AttackRating = 0;
|
uint32 AttackRating = 0;
|
||||||
uint32 WornCap = itembonuses.ATK;
|
uint32 WornCap = itembonuses.ATK;
|
||||||
if(IsBot()) {
|
if(IsBot()) {
|
||||||
AttackRating = ((WornCap * 1.342) + (GetSkill(SkillOffense) * 1.345) + ((GetSTR() - 66) * 0.9) + (GetPrimarySkillValue() * 2.69));
|
AttackRating = ((WornCap * 1.342) + (GetSkill(EQEmu::skills::SkillOffense) * 1.345) + ((GetSTR() - 66) * 0.9) + (GetPrimarySkillValue() * 2.69));
|
||||||
AttackRating += aabonuses.ATK + GroupLeadershipAAOffenseEnhancement();
|
AttackRating += aabonuses.ATK + GroupLeadershipAAOffenseEnhancement();
|
||||||
if (AttackRating < 10)
|
if (AttackRating < 10)
|
||||||
AttackRating = 10;
|
AttackRating = 10;
|
||||||
@ -1233,7 +1234,7 @@ uint32 Bot::GetTotalATK() {
|
|||||||
uint32 Bot::GetATKRating() {
|
uint32 Bot::GetATKRating() {
|
||||||
uint32 AttackRating = 0;
|
uint32 AttackRating = 0;
|
||||||
if(IsBot()) {
|
if(IsBot()) {
|
||||||
AttackRating = (GetSkill(SkillOffense) * 1.345) + ((GetSTR() - 66) * 0.9) + (GetPrimarySkillValue() * 2.69);
|
AttackRating = (GetSkill(EQEmu::skills::SkillOffense) * 1.345) + ((GetSTR() - 66) * 0.9) + (GetPrimarySkillValue() * 2.69);
|
||||||
if (AttackRating < 10)
|
if (AttackRating < 10)
|
||||||
AttackRating = 10;
|
AttackRating = 10;
|
||||||
}
|
}
|
||||||
@ -1914,7 +1915,7 @@ void Bot::BotRangedAttack(Mob* other) {
|
|||||||
if(!IsAttackAllowed(other) || IsCasting() || DivineAura() || IsStunned() || IsMezzed() || (GetAppearance() == eaDead))
|
if(!IsAttackAllowed(other) || IsCasting() || DivineAura() || IsStunned() || IsMezzed() || (GetAppearance() == eaDead))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SendItemAnimation(other, Ammo, SkillArchery);
|
SendItemAnimation(other, Ammo, EQEmu::skills::SkillArchery);
|
||||||
//DoArcheryAttackDmg(GetTarget(), rangedItem, ammoItem);
|
//DoArcheryAttackDmg(GetTarget(), rangedItem, ammoItem);
|
||||||
DoArcheryAttackDmg(other, rangedItem, ammoItem); // watch
|
DoArcheryAttackDmg(other, rangedItem, ammoItem); // watch
|
||||||
|
|
||||||
@ -1959,12 +1960,12 @@ bool Bot::CheckBotDoubleAttack(bool tripleAttack) {
|
|||||||
//Check for bonuses that give you a double attack chance regardless of skill (ie Bestial Frenzy/Harmonious Attack AA)
|
//Check for bonuses that give you a double attack chance regardless of skill (ie Bestial Frenzy/Harmonious Attack AA)
|
||||||
uint32 bonusGiveDA = (aabonuses.GiveDoubleAttack + spellbonuses.GiveDoubleAttack + itembonuses.GiveDoubleAttack);
|
uint32 bonusGiveDA = (aabonuses.GiveDoubleAttack + spellbonuses.GiveDoubleAttack + itembonuses.GiveDoubleAttack);
|
||||||
// If you don't have the double attack skill, return
|
// If you don't have the double attack skill, return
|
||||||
if(!GetSkill(SkillDoubleAttack) && !(GetClass() == BARD || GetClass() == BEASTLORD))
|
if (!GetSkill(EQEmu::skills::SkillDoubleAttack) && !(GetClass() == BARD || GetClass() == BEASTLORD))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// You start with no chance of double attacking
|
// You start with no chance of double attacking
|
||||||
float chance = 0.0f;
|
float chance = 0.0f;
|
||||||
uint16 skill = GetSkill(SkillDoubleAttack);
|
uint16 skill = GetSkill(EQEmu::skills::SkillDoubleAttack);
|
||||||
int32 bonusDA = (aabonuses.DoubleAttackChance + spellbonuses.DoubleAttackChance + itembonuses.DoubleAttackChance);
|
int32 bonusDA = (aabonuses.DoubleAttackChance + spellbonuses.DoubleAttackChance + itembonuses.DoubleAttackChance);
|
||||||
//Use skill calculations otherwise, if you only have AA applied GiveDoubleAttack chance then use that value as the base.
|
//Use skill calculations otherwise, if you only have AA applied GiveDoubleAttack chance then use that value as the base.
|
||||||
if (skill)
|
if (skill)
|
||||||
@ -1989,13 +1990,13 @@ bool Bot::CheckBotDoubleAttack(bool tripleAttack) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes skillinuse, int16 chance_mod, int16 focus, bool CanRiposte, int ReuseTime) {
|
void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, EQEmu::skills::SkillType skillinuse, int16 chance_mod, int16 focus, bool CanRiposte, int ReuseTime) {
|
||||||
if (!CanDoSpecialAttack(other))
|
if (!CanDoSpecialAttack(other))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//For spells using skill value 98 (feral swipe ect) server sets this to 67 automatically.
|
//For spells using skill value 98 (feral swipe ect) server sets this to 67 automatically.
|
||||||
if (skillinuse == SkillBegging)
|
if (skillinuse == EQEmu::skills::SkillBegging)
|
||||||
skillinuse = SkillOffense;
|
skillinuse = EQEmu::skills::SkillOffense;
|
||||||
|
|
||||||
int damage = 0;
|
int damage = 0;
|
||||||
uint32 hate = 0;
|
uint32 hate = 0;
|
||||||
@ -2052,7 +2053,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
|
|||||||
else
|
else
|
||||||
damage = -5;
|
damage = -5;
|
||||||
|
|
||||||
if(skillinuse == SkillBash){
|
if (skillinuse == EQEmu::skills::SkillBash){
|
||||||
const ItemInst* inst = GetBotItem(EQEmu::legacy::SlotSecondary);
|
const ItemInst* inst = GetBotItem(EQEmu::legacy::SlotSecondary);
|
||||||
const EQEmu::Item_Struct* botweapon = 0;
|
const EQEmu::Item_Struct* botweapon = 0;
|
||||||
if(inst)
|
if(inst)
|
||||||
@ -2069,8 +2070,8 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
|
|||||||
other->AddToHateList(this, hate);
|
other->AddToHateList(this, hate);
|
||||||
|
|
||||||
bool CanSkillProc = true;
|
bool CanSkillProc = true;
|
||||||
if (skillinuse == SkillOffense){ //Hack to allow damage to display.
|
if (skillinuse == EQEmu::skills::SkillOffense){ //Hack to allow damage to display.
|
||||||
skillinuse = SkillTigerClaw; //'strike' your opponent - Arbitrary choice for message.
|
skillinuse = EQEmu::skills::SkillTigerClaw; //'strike' your opponent - Arbitrary choice for message.
|
||||||
CanSkillProc = false; //Disable skill procs
|
CanSkillProc = false; //Disable skill procs
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2081,7 +2082,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
|
|||||||
if (damage > 0)
|
if (damage > 0)
|
||||||
CheckNumHitsRemaining(NumHit::OutgoingHitSuccess);
|
CheckNumHitsRemaining(NumHit::OutgoingHitSuccess);
|
||||||
|
|
||||||
if((skillinuse == SkillDragonPunch) && GetAA(aaDragonPunch) && zone->random.Int(0, 99) < 25){
|
if ((skillinuse == EQEmu::skills::SkillDragonPunch) && GetAA(aaDragonPunch) && zone->random.Int(0, 99) < 25){
|
||||||
SpellFinished(904, other, 10, 0, -1, spells[904].ResistDiff);
|
SpellFinished(904, other, 10, 0, -1, spells[904].ResistDiff);
|
||||||
other->Stun(100);
|
other->Stun(100);
|
||||||
}
|
}
|
||||||
@ -2093,23 +2094,23 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
|
|||||||
TrySkillProc(other, skillinuse, ReuseTime, true);
|
TrySkillProc(other, skillinuse, ReuseTime, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::ApplySpecialAttackMod(SkillUseTypes skill, int32 &dmg, int32 &mindmg) {
|
void Bot::ApplySpecialAttackMod(EQEmu::skills::SkillType skill, int32 &dmg, int32 &mindmg) {
|
||||||
int item_slot = -1;
|
int item_slot = -1;
|
||||||
//1: Apply bonus from AC (BOOT/SHIELD/HANDS) est. 40AC=6dmg
|
//1: Apply bonus from AC (BOOT/SHIELD/HANDS) est. 40AC=6dmg
|
||||||
switch (skill) {
|
switch (skill) {
|
||||||
case SkillFlyingKick:
|
case EQEmu::skills::SkillFlyingKick:
|
||||||
case SkillRoundKick:
|
case EQEmu::skills::SkillRoundKick:
|
||||||
case SkillKick:
|
case EQEmu::skills::SkillKick:
|
||||||
item_slot = EQEmu::legacy::SlotFeet;
|
item_slot = EQEmu::legacy::SlotFeet;
|
||||||
break;
|
break;
|
||||||
case SkillBash:
|
case EQEmu::skills::SkillBash:
|
||||||
item_slot = EQEmu::legacy::SlotSecondary;
|
item_slot = EQEmu::legacy::SlotSecondary;
|
||||||
break;
|
break;
|
||||||
case SkillDragonPunch:
|
case EQEmu::skills::SkillDragonPunch:
|
||||||
case SkillEagleStrike:
|
case EQEmu::skills::SkillEagleStrike:
|
||||||
case SkillTigerClaw:
|
case EQEmu::skills::SkillTigerClaw:
|
||||||
item_slot = EQEmu::legacy::SlotHands;
|
item_slot = EQEmu::legacy::SlotHands;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item_slot >= EQEmu::legacy::EQUIPMENT_BEGIN){
|
if (item_slot >= EQEmu::legacy::EQUIPMENT_BEGIN){
|
||||||
@ -2518,7 +2519,7 @@ void Bot::AI_Process() {
|
|||||||
if (bIsFist || !weapon->IsType2HWeapon()) {
|
if (bIsFist || !weapon->IsType2HWeapon()) {
|
||||||
float DualWieldProbability = 0.0f;
|
float DualWieldProbability = 0.0f;
|
||||||
int32 Ambidexterity = (aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity);
|
int32 Ambidexterity = (aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity);
|
||||||
DualWieldProbability = ((GetSkill(SkillDualWield) + GetLevel() + Ambidexterity) / 400.0f); // 78.0 max
|
DualWieldProbability = ((GetSkill(EQEmu::skills::SkillDualWield) + GetLevel() + Ambidexterity) / 400.0f); // 78.0 max
|
||||||
int32 DWBonus = (spellbonuses.DualWieldChance + itembonuses.DualWieldChance);
|
int32 DWBonus = (spellbonuses.DualWieldChance + itembonuses.DualWieldChance);
|
||||||
DualWieldProbability += (DualWieldProbability * float(DWBonus) / 100.0f);
|
DualWieldProbability += (DualWieldProbability * float(DWBonus) / 100.0f);
|
||||||
float random = zone->random.Real(0, 1);
|
float random = zone->random.Real(0, 1);
|
||||||
@ -2739,7 +2740,7 @@ void Bot::PetAIProcess() {
|
|||||||
// Ok now, let's check pet's offhand.
|
// Ok now, let's check pet's offhand.
|
||||||
if (botPet->GetAttackDWTimer().Check() && botPet->GetOwnerID() && botPet->GetOwner() && ((botPet->GetOwner()->GetClass() == MAGICIAN) || (botPet->GetOwner()->GetClass() == NECROMANCER) || (botPet->GetOwner()->GetClass() == SHADOWKNIGHT) || (botPet->GetOwner()->GetClass() == BEASTLORD))) {
|
if (botPet->GetAttackDWTimer().Check() && botPet->GetOwnerID() && botPet->GetOwner() && ((botPet->GetOwner()->GetClass() == MAGICIAN) || (botPet->GetOwner()->GetClass() == NECROMANCER) || (botPet->GetOwner()->GetClass() == SHADOWKNIGHT) || (botPet->GetOwner()->GetClass() == BEASTLORD))) {
|
||||||
if(botPet->GetOwner()->GetLevel() >= 24) {
|
if(botPet->GetOwner()->GetLevel() >= 24) {
|
||||||
float DualWieldProbability = ((botPet->GetSkill(SkillDualWield) + botPet->GetLevel()) / 400.0f);
|
float DualWieldProbability = ((botPet->GetSkill(EQEmu::skills::SkillDualWield) + botPet->GetLevel()) / 400.0f);
|
||||||
DualWieldProbability -= zone->random.Real(0, 1);
|
DualWieldProbability -= zone->random.Real(0, 1);
|
||||||
if(DualWieldProbability < 0) {
|
if(DualWieldProbability < 0) {
|
||||||
botPet->Attack(botPet->GetTarget(), EQEmu::legacy::SlotSecondary);
|
botPet->Attack(botPet->GetTarget(), EQEmu::legacy::SlotSecondary);
|
||||||
@ -3586,7 +3587,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) {
|
bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill) {
|
||||||
if(!NPC::Death(killerMob, damage, spell_id, attack_skill))
|
if(!NPC::Death(killerMob, damage, spell_id, attack_skill))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -3661,7 +3662,7 @@ bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, SkillUseTypes att
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, int special) {
|
void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, int special) {
|
||||||
if(spell_id == 0)
|
if(spell_id == 0)
|
||||||
spell_id = SPELL_UNKNOWN;
|
spell_id = SPELL_UNKNOWN;
|
||||||
|
|
||||||
@ -3758,7 +3759,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
|||||||
|
|
||||||
// calculate attack_skill and skillinuse depending on hand and weapon
|
// calculate attack_skill and skillinuse depending on hand and weapon
|
||||||
// also send Packet to near clients
|
// also send Packet to near clients
|
||||||
SkillUseTypes skillinuse;
|
EQEmu::skills::SkillType skillinuse;
|
||||||
AttackAnimation(skillinuse, Hand, weapon);
|
AttackAnimation(skillinuse, Hand, weapon);
|
||||||
Log.Out(Logs::Detail, Logs::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse);
|
Log.Out(Logs::Detail, Logs::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse);
|
||||||
/// Now figure out damage
|
/// Now figure out damage
|
||||||
@ -4776,7 +4777,7 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) {
|
|||||||
int Bot::GetHandToHandDamage(void) {
|
int Bot::GetHandToHandDamage(void) {
|
||||||
if (RuleB(Combat, UseRevampHandToHand)) {
|
if (RuleB(Combat, UseRevampHandToHand)) {
|
||||||
// everyone uses this in the revamp!
|
// everyone uses this in the revamp!
|
||||||
int skill = GetSkill(SkillHandtoHand);
|
int skill = GetSkill(EQEmu::skills::SkillHandtoHand);
|
||||||
int epic = 0;
|
int epic = 0;
|
||||||
if (CastToNPC()->GetEquipment(EQEmu::legacy::MaterialHands) == 10652 && GetLevel() > 46)
|
if (CastToNPC()->GetEquipment(EQEmu::legacy::MaterialHands) == 10652 && GetLevel() > 46)
|
||||||
epic = 280;
|
epic = 280;
|
||||||
@ -4813,7 +4814,7 @@ int Bot::GetHandToHandDamage(void) {
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) {
|
bool Bot::TryFinishingBlow(Mob *defender, EQEmu::skills::SkillType skillinuse) {
|
||||||
if (!defender)
|
if (!defender)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -4855,12 +4856,12 @@ void Bot::DoRiposte(Mob* defender) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage, int32 min_damage, int32 hate_override,int ReuseTime, bool HitChance) {
|
void Bot::DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32 max_damage, int32 min_damage, int32 hate_override, int ReuseTime, bool HitChance) {
|
||||||
int32 hate = max_damage;
|
int32 hate = max_damage;
|
||||||
if(hate_override > -1)
|
if(hate_override > -1)
|
||||||
hate = hate_override;
|
hate = hate_override;
|
||||||
|
|
||||||
if(skill == SkillBash) {
|
if (skill == EQEmu::skills::SkillBash) {
|
||||||
const ItemInst* inst = GetBotItem(EQEmu::legacy::SlotSecondary);
|
const ItemInst* inst = GetBotItem(EQEmu::legacy::SlotSecondary);
|
||||||
const EQEmu::Item_Struct* botweapon = 0;
|
const EQEmu::Item_Struct* botweapon = 0;
|
||||||
if(inst)
|
if(inst)
|
||||||
@ -4876,7 +4877,7 @@ void Bot::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage,
|
|||||||
|
|
||||||
min_damage += (min_damage * GetMeleeMinDamageMod_SE(skill) / 100);
|
min_damage += (min_damage * GetMeleeMinDamageMod_SE(skill) / 100);
|
||||||
int hand = EQEmu::legacy::SlotPrimary;
|
int hand = EQEmu::legacy::SlotPrimary;
|
||||||
if (skill == SkillThrowing || skill == SkillArchery)
|
if (skill == EQEmu::skills::SkillThrowing || skill == EQEmu::skills::SkillArchery)
|
||||||
hand = EQEmu::legacy::SlotRange;
|
hand = EQEmu::legacy::SlotRange;
|
||||||
if (who->AvoidDamage(this, max_damage, hand)) {
|
if (who->AvoidDamage(this, max_damage, hand)) {
|
||||||
if (max_damage == -3)
|
if (max_damage == -3)
|
||||||
@ -4953,7 +4954,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
|
|||||||
} else {
|
} else {
|
||||||
RogueBackstab(other);
|
RogueBackstab(other);
|
||||||
if (level > 54) {
|
if (level > 54) {
|
||||||
float DoubleAttackProbability = ((GetSkill(SkillDoubleAttack) + GetLevel()) / 500.0f);
|
float DoubleAttackProbability = ((GetSkill(EQEmu::skills::SkillDoubleAttack) + GetLevel()) / 500.0f);
|
||||||
if(zone->random.Real(0, 1) < DoubleAttackProbability) {
|
if(zone->random.Real(0, 1) < DoubleAttackProbability) {
|
||||||
if(other->GetHP() > 0)
|
if(other->GetHP() > 0)
|
||||||
RogueBackstab(other,false,ReuseTime);
|
RogueBackstab(other,false,ReuseTime);
|
||||||
@ -4966,7 +4967,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
|
|||||||
} else if(aabonuses.FrontalBackstabMinDmg || itembonuses.FrontalBackstabMinDmg || spellbonuses.FrontalBackstabMinDmg) {
|
} else if(aabonuses.FrontalBackstabMinDmg || itembonuses.FrontalBackstabMinDmg || spellbonuses.FrontalBackstabMinDmg) {
|
||||||
RogueBackstab(other, true);
|
RogueBackstab(other, true);
|
||||||
if (level > 54) {
|
if (level > 54) {
|
||||||
float DoubleAttackProbability = ((GetSkill(SkillDoubleAttack) + GetLevel()) / 500.0f);
|
float DoubleAttackProbability = ((GetSkill(EQEmu::skills::SkillDoubleAttack) + GetLevel()) / 500.0f);
|
||||||
if(zone->random.Real(0, 1) < DoubleAttackProbability)
|
if(zone->random.Real(0, 1) < DoubleAttackProbability)
|
||||||
if(other->GetHP() > 0)
|
if(other->GetHP() > 0)
|
||||||
RogueBackstab(other,true, ReuseTime);
|
RogueBackstab(other,true, ReuseTime);
|
||||||
@ -5002,11 +5003,11 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) {
|
|||||||
|
|
||||||
if(primaryweapondamage > 0) {
|
if(primaryweapondamage > 0) {
|
||||||
if(level > 25) {
|
if(level > 25) {
|
||||||
max_hit = (((((2 * backstab_dmg) * GetDamageTable(SkillBackstab) / 100) * 10 * GetSkill(SkillBackstab) / 355) + ((level - 25) / 3) + 1) * ((100 + RuleI(Combat, BackstabBonus)) / 100));
|
max_hit = (((((2 * backstab_dmg) * GetDamageTable(EQEmu::skills::SkillBackstab) / 100) * 10 * GetSkill(EQEmu::skills::SkillBackstab) / 355) + ((level - 25) / 3) + 1) * ((100 + RuleI(Combat, BackstabBonus)) / 100));
|
||||||
hate = (20 * backstab_dmg * GetSkill(SkillBackstab) / 355);
|
hate = (20 * backstab_dmg * GetSkill(EQEmu::skills::SkillBackstab) / 355);
|
||||||
} else {
|
} else {
|
||||||
max_hit = (((((2 * backstab_dmg) * GetDamageTable(SkillBackstab) / 100) * 10 * GetSkill(SkillBackstab) / 355) + 1) * ((100 + RuleI(Combat, BackstabBonus)) / 100));
|
max_hit = (((((2 * backstab_dmg) * GetDamageTable(EQEmu::skills::SkillBackstab) / 100) * 10 * GetSkill(EQEmu::skills::SkillBackstab) / 355) + 1) * ((100 + RuleI(Combat, BackstabBonus)) / 100));
|
||||||
hate = (20 * backstab_dmg * GetSkill(SkillBackstab) / 355);
|
hate = (20 * backstab_dmg * GetSkill(EQEmu::skills::SkillBackstab) / 355);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (level < 51)
|
if (level < 51)
|
||||||
@ -5014,7 +5015,7 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) {
|
|||||||
else
|
else
|
||||||
min_hit = ((level * ( level * 5 - 105)) / 100);
|
min_hit = ((level * ( level * 5 - 105)) / 100);
|
||||||
|
|
||||||
if(!other->CheckHitChance(this, SkillBackstab, 0))
|
if (!other->CheckHitChance(this, EQEmu::skills::SkillBackstab, 0))
|
||||||
ndamage = 0;
|
ndamage = 0;
|
||||||
else {
|
else {
|
||||||
if (min_damage) {
|
if (min_damage) {
|
||||||
@ -5029,7 +5030,7 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) {
|
|||||||
} else
|
} else
|
||||||
ndamage = -5;
|
ndamage = -5;
|
||||||
|
|
||||||
DoSpecialAttackDamage(other, SkillBackstab, ndamage, min_hit, hate, ReuseTime);
|
DoSpecialAttackDamage(other, EQEmu::skills::SkillBackstab, ndamage, min_hit, hate, ReuseTime);
|
||||||
DoAnim(anim1HPiercing);
|
DoAnim(anim1HPiercing);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5037,9 +5038,9 @@ void Bot::RogueAssassinate(Mob* other) {
|
|||||||
ItemInst* botweaponInst = GetBotItem(EQEmu::legacy::SlotPrimary);
|
ItemInst* botweaponInst = GetBotItem(EQEmu::legacy::SlotPrimary);
|
||||||
if(botweaponInst) {
|
if(botweaponInst) {
|
||||||
if(GetWeaponDamage(other, botweaponInst))
|
if(GetWeaponDamage(other, botweaponInst))
|
||||||
other->Damage(this, 32000, SPELL_UNKNOWN, SkillBackstab);
|
other->Damage(this, 32000, SPELL_UNKNOWN, EQEmu::skills::SkillBackstab);
|
||||||
else
|
else
|
||||||
other->Damage(this, -5, SPELL_UNKNOWN, SkillBackstab);
|
other->Damage(this, -5, SPELL_UNKNOWN, EQEmu::skills::SkillBackstab);
|
||||||
}
|
}
|
||||||
|
|
||||||
DoAnim(anim1HPiercing);
|
DoAnim(anim1HPiercing);
|
||||||
@ -5104,54 +5105,54 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
|||||||
canBash = true;
|
canBash = true;
|
||||||
|
|
||||||
if(!canBash || zone->random.Int(0, 100) > 25)
|
if(!canBash || zone->random.Int(0, 100) > 25)
|
||||||
skill_to_use = SkillKick;
|
skill_to_use = EQEmu::skills::SkillKick;
|
||||||
else
|
else
|
||||||
skill_to_use = SkillBash;
|
skill_to_use = EQEmu::skills::SkillBash;
|
||||||
}
|
}
|
||||||
case RANGER:
|
case RANGER:
|
||||||
case BEASTLORD:
|
case BEASTLORD:
|
||||||
skill_to_use = SkillKick;
|
skill_to_use = EQEmu::skills::SkillKick;
|
||||||
break;
|
break;
|
||||||
case BERSERKER:
|
case BERSERKER:
|
||||||
skill_to_use = SkillFrenzy;
|
skill_to_use = EQEmu::skills::SkillFrenzy;
|
||||||
break;
|
break;
|
||||||
case CLERIC:
|
case CLERIC:
|
||||||
case SHADOWKNIGHT:
|
case SHADOWKNIGHT:
|
||||||
case PALADIN:
|
case PALADIN:
|
||||||
if(level >= RuleI(Combat, NPCBashKickLevel)){
|
if(level >= RuleI(Combat, NPCBashKickLevel)){
|
||||||
if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::legacy::SlotSecondary) && m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::legacy::SlotPrimary) && m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
|
if ((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) || (m_inv.GetItem(EQEmu::legacy::SlotSecondary) && m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType == EQEmu::item::ItemTypeShield) || (m_inv.GetItem(EQEmu::legacy::SlotPrimary) && m_inv.GetItem(EQEmu::legacy::SlotPrimary)->GetItem()->IsType2HWeapon() && GetAA(aa2HandBash) >= 1))
|
||||||
skill_to_use = SkillBash;
|
skill_to_use = EQEmu::skills::SkillBash;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MONK:
|
case MONK:
|
||||||
if(GetLevel() >= 30)
|
if(GetLevel() >= 30)
|
||||||
skill_to_use = SkillFlyingKick;
|
skill_to_use = EQEmu::skills::SkillFlyingKick;
|
||||||
else if(GetLevel() >= 25)
|
else if(GetLevel() >= 25)
|
||||||
skill_to_use = SkillDragonPunch;
|
skill_to_use = EQEmu::skills::SkillDragonPunch;
|
||||||
else if(GetLevel() >= 20)
|
else if(GetLevel() >= 20)
|
||||||
skill_to_use = SkillEagleStrike;
|
skill_to_use = EQEmu::skills::SkillEagleStrike;
|
||||||
else if(GetLevel() >= 10)
|
else if(GetLevel() >= 10)
|
||||||
skill_to_use = SkillTigerClaw;
|
skill_to_use = EQEmu::skills::SkillTigerClaw;
|
||||||
else if(GetLevel() >= 5)
|
else if(GetLevel() >= 5)
|
||||||
skill_to_use = SkillRoundKick;
|
skill_to_use = EQEmu::skills::SkillRoundKick;
|
||||||
else
|
else
|
||||||
skill_to_use = SkillKick;
|
skill_to_use = EQEmu::skills::SkillKick;
|
||||||
break;
|
break;
|
||||||
case ROGUE:
|
case ROGUE:
|
||||||
skill_to_use = SkillBackstab;
|
skill_to_use = EQEmu::skills::SkillBackstab;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(skill_to_use == -1)
|
if(skill_to_use == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(skill_to_use == SkillBash) {
|
if (skill_to_use == EQEmu::skills::SkillBash) {
|
||||||
if (target != this) {
|
if (target != this) {
|
||||||
DoAnim(animTailRake);
|
DoAnim(animTailRake);
|
||||||
if (GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotShoulders)) <= 0)
|
if (GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotSecondary)) <= 0 && GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotShoulders)) <= 0)
|
||||||
dmg = -5;
|
dmg = -5;
|
||||||
else {
|
else {
|
||||||
if(!target->CheckHitChance(this, SkillBash, 0))
|
if (!target->CheckHitChance(this, EQEmu::skills::SkillBash, 0))
|
||||||
dmg = 0;
|
dmg = 0;
|
||||||
else {
|
else {
|
||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
@ -5161,16 +5162,16 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
reuse = (BashReuseTime * 1000);
|
reuse = (BashReuseTime * 1000);
|
||||||
DoSpecialAttackDamage(target, SkillBash, dmg, 1, -1,reuse);
|
DoSpecialAttackDamage(target, EQEmu::skills::SkillBash, dmg, 1, -1, reuse);
|
||||||
did_attack = true;
|
did_attack = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(skill_to_use == SkillFrenzy) {
|
if (skill_to_use == EQEmu::skills::SkillFrenzy) {
|
||||||
int AtkRounds = 3;
|
int AtkRounds = 3;
|
||||||
int skillmod = 0;
|
int skillmod = 0;
|
||||||
if(MaxSkill(SkillFrenzy) > 0)
|
if (MaxSkill(EQEmu::skills::SkillFrenzy) > 0)
|
||||||
skillmod = (100 * GetSkill(SkillFrenzy)/MaxSkill(SkillFrenzy));
|
skillmod = (100 * GetSkill(EQEmu::skills::SkillFrenzy) / MaxSkill(EQEmu::skills::SkillFrenzy));
|
||||||
|
|
||||||
int32 max_dmg = (26 + ((((GetLevel() - 6) * 2) * skillmod) / 100)) * ((100 + RuleI(Combat, FrenzyBonus)) / 100);
|
int32 max_dmg = (26 + ((((GetLevel() - 6) * 2) * skillmod) / 100)) * ((100 + RuleI(Combat, FrenzyBonus)) / 100);
|
||||||
int32 min_dmg = 0;
|
int32 min_dmg = 0;
|
||||||
@ -5188,20 +5189,20 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
|||||||
did_attack = true;
|
did_attack = true;
|
||||||
while(AtkRounds > 0) {
|
while(AtkRounds > 0) {
|
||||||
if (GetTarget() && (AtkRounds == 1 || zone->random.Int(0, 100) < 75)) {
|
if (GetTarget() && (AtkRounds == 1 || zone->random.Int(0, 100) < 75)) {
|
||||||
DoSpecialAttackDamage(GetTarget(), SkillFrenzy, max_dmg, min_dmg, max_dmg, reuse, true);
|
DoSpecialAttackDamage(GetTarget(), EQEmu::skills::SkillFrenzy, max_dmg, min_dmg, max_dmg, reuse, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
AtkRounds--;
|
AtkRounds--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(skill_to_use == SkillKick) {
|
if (skill_to_use == EQEmu::skills::SkillKick) {
|
||||||
if(target != this) {
|
if(target != this) {
|
||||||
DoAnim(animKick);
|
DoAnim(animKick);
|
||||||
if (GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotFeet)) <= 0)
|
if (GetWeaponDamage(target, GetBotItem(EQEmu::legacy::SlotFeet)) <= 0)
|
||||||
dmg = -5;
|
dmg = -5;
|
||||||
else {
|
else {
|
||||||
if(!target->CheckHitChance(this, SkillKick, 0))
|
if (!target->CheckHitChance(this, EQEmu::skills::SkillKick, 0))
|
||||||
dmg = 0;
|
dmg = 0;
|
||||||
else {
|
else {
|
||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
@ -5211,17 +5212,17 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
reuse = (KickReuseTime * 1000);
|
reuse = (KickReuseTime * 1000);
|
||||||
DoSpecialAttackDamage(target, SkillKick, dmg, 1, -1, reuse);
|
DoSpecialAttackDamage(target, EQEmu::skills::SkillKick, dmg, 1, -1, reuse);
|
||||||
did_attack = true;
|
did_attack = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(skill_to_use == SkillFlyingKick || skill_to_use == SkillDragonPunch || skill_to_use == SkillEagleStrike || skill_to_use == SkillTigerClaw || skill_to_use == SkillRoundKick) {
|
if (skill_to_use == EQEmu::skills::SkillFlyingKick || skill_to_use == EQEmu::skills::SkillDragonPunch || skill_to_use == EQEmu::skills::SkillEagleStrike || skill_to_use == EQEmu::skills::SkillTigerClaw || skill_to_use == EQEmu::skills::SkillRoundKick) {
|
||||||
reuse = (MonkSpecialAttack(target, skill_to_use) - 1);
|
reuse = (MonkSpecialAttack(target, skill_to_use) - 1);
|
||||||
MonkSpecialAttack(target, skill_to_use);
|
MonkSpecialAttack(target, skill_to_use);
|
||||||
uint32 bDoubleSpecialAttack = (itembonuses.DoubleSpecialAttack + spellbonuses.DoubleSpecialAttack + aabonuses.DoubleSpecialAttack);
|
uint32 bDoubleSpecialAttack = (itembonuses.DoubleSpecialAttack + spellbonuses.DoubleSpecialAttack + aabonuses.DoubleSpecialAttack);
|
||||||
if(bDoubleSpecialAttack && (bDoubleSpecialAttack >= 100 || bDoubleSpecialAttack > zone->random.Int(0, 100))) {
|
if(bDoubleSpecialAttack && (bDoubleSpecialAttack >= 100 || bDoubleSpecialAttack > zone->random.Int(0, 100))) {
|
||||||
int MonkSPA [5] = { SkillFlyingKick, SkillDragonPunch, SkillEagleStrike, SkillTigerClaw, SkillRoundKick };
|
int MonkSPA[5] = { EQEmu::skills::SkillFlyingKick, EQEmu::skills::SkillDragonPunch, EQEmu::skills::SkillEagleStrike, EQEmu::skills::SkillTigerClaw, EQEmu::skills::SkillRoundKick };
|
||||||
MonkSpecialAttack(target, MonkSPA[zone->random.Int(0, 4)]);
|
MonkSpecialAttack(target, MonkSPA[zone->random.Int(0, 4)]);
|
||||||
int TripleChance = 25;
|
int TripleChance = 25;
|
||||||
if (bDoubleSpecialAttack > 100)
|
if (bDoubleSpecialAttack > 100)
|
||||||
@ -5235,7 +5236,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
|||||||
did_attack = true;
|
did_attack = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(skill_to_use == SkillBackstab) {
|
if (skill_to_use == EQEmu::skills::SkillBackstab) {
|
||||||
reuse = (BackstabReuseTime * 1000);
|
reuse = (BackstabReuseTime * 1000);
|
||||||
did_attack = true;
|
did_attack = true;
|
||||||
if (IsRiposte)
|
if (IsRiposte)
|
||||||
@ -5246,9 +5247,9 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
|
|||||||
classattack_timer.Start(reuse / HasteModifier);
|
classattack_timer.Start(reuse / HasteModifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) {
|
bool Bot::TryHeadShot(Mob* defender, EQEmu::skills::SkillType skillInUse) {
|
||||||
bool Result = false;
|
bool Result = false;
|
||||||
if(defender && (defender->GetBodyType() == BT_Humanoid) && (skillInUse == SkillArchery) && (GetClass() == RANGER) && (GetLevel() >= 62)) {
|
if (defender && (defender->GetBodyType() == BT_Humanoid) && (skillInUse == EQEmu::skills::SkillArchery) && (GetClass() == RANGER) && (GetLevel() >= 62)) {
|
||||||
int defenderLevel = defender->GetLevel();
|
int defenderLevel = defender->GetLevel();
|
||||||
int rangerLevel = GetLevel();
|
int rangerLevel = GetLevel();
|
||||||
if(GetAA(aaHeadshot) && ((defenderLevel - 46) <= GetAA(aaHeadshot) * 2)) {
|
if(GetAA(aaHeadshot) && ((defenderLevel - 46) <= GetAA(aaHeadshot) * 2)) {
|
||||||
@ -5515,7 +5516,7 @@ void Bot::SetAttackTimer() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GetSkill(SkillDualWield)) {
|
if (!GetSkill(EQEmu::skills::SkillDualWield)) {
|
||||||
attack_dw_timer.Disable();
|
attack_dw_timer.Disable();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -6731,7 +6732,7 @@ int32 Bot::CalcManaRegen() {
|
|||||||
if (IsSitting()) {
|
if (IsSitting()) {
|
||||||
BuffFadeBySitModifier();
|
BuffFadeBySitModifier();
|
||||||
if(botclass != WARRIOR && botclass != MONK && botclass != ROGUE && botclass != BERSERKER) {
|
if(botclass != WARRIOR && botclass != MONK && botclass != ROGUE && botclass != BERSERKER) {
|
||||||
regen = ((((GetSkill(SkillMeditate) / 10) + (level - (level / 4))) / 4) + 4);
|
regen = ((((GetSkill(EQEmu::skills::SkillMeditate) / 10) + (level - (level / 4))) / 4) + 4);
|
||||||
regen += (spellbonuses.ManaRegen + itembonuses.ManaRegen);
|
regen += (spellbonuses.ManaRegen + itembonuses.ManaRegen);
|
||||||
} else
|
} else
|
||||||
regen = (2 + spellbonuses.ManaRegen + itembonuses.ManaRegen);
|
regen = (2 + spellbonuses.ManaRegen + itembonuses.ManaRegen);
|
||||||
@ -7202,11 +7203,11 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
|
|||||||
if(inst) {
|
if(inst) {
|
||||||
item = inst->GetItem();
|
item = inst->GetItem();
|
||||||
if(item) {
|
if(item) {
|
||||||
strcpy(insr->itemnames[SoF::inventory::SlotPowerSource], item->Name);
|
strcpy(insr->itemnames[SoF::invslot::PossessionsPowerSource], item->Name);
|
||||||
insr->itemicons[SoF::inventory::SlotPowerSource] = item->Icon;
|
insr->itemicons[SoF::invslot::PossessionsPowerSource] = item->Icon;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
insr->itemicons[SoF::inventory::SlotPowerSource] = 0xFFFFFFFF;
|
insr->itemicons[SoF::invslot::PossessionsPowerSource] = 0xFFFFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
inst = inspectedBot->GetBotItem(EQEmu::legacy::SlotAmmo);
|
inst = inspectedBot->GetBotItem(EQEmu::legacy::SlotAmmo);
|
||||||
@ -7214,11 +7215,11 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
|
|||||||
if(inst) {
|
if(inst) {
|
||||||
item = inst->GetItem();
|
item = inst->GetItem();
|
||||||
if(item) {
|
if(item) {
|
||||||
strcpy(insr->itemnames[SoF::inventory::SlotAmmo], item->Name);
|
strcpy(insr->itemnames[SoF::invslot::PossessionsAmmo], item->Name);
|
||||||
insr->itemicons[SoF::inventory::SlotAmmo] = item->Icon;
|
insr->itemicons[SoF::invslot::PossessionsAmmo] = item->Icon;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
insr->itemicons[SoF::inventory::SlotAmmo] = 0xFFFFFFFF;
|
insr->itemicons[SoF::invslot::PossessionsAmmo] = 0xFFFFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(insr->text, inspectedBot->GetInspectMessage().text);
|
strcpy(insr->text, inspectedBot->GetInspectMessage().text);
|
||||||
@ -7527,7 +7528,7 @@ void Bot::AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->SkillModValue != 0 && item->SkillModType <= HIGHEST_SKILL){
|
if (item->SkillModValue != 0 && item->SkillModType <= EQEmu::skills::HIGHEST_SKILL){
|
||||||
if ((item->SkillModValue > 0 && newbon->skillmod[item->SkillModType] < item->SkillModValue) ||
|
if ((item->SkillModValue > 0 && newbon->skillmod[item->SkillModType] < item->SkillModValue) ||
|
||||||
(item->SkillModValue < 0 && newbon->skillmod[item->SkillModType] > item->SkillModValue))
|
(item->SkillModValue < 0 && newbon->skillmod[item->SkillModType] > item->SkillModValue))
|
||||||
{
|
{
|
||||||
@ -7535,7 +7536,7 @@ void Bot::AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->ExtraDmgSkill != 0 && item->ExtraDmgSkill <= HIGHEST_SKILL) {
|
if (item->ExtraDmgSkill != 0 && item->ExtraDmgSkill <= EQEmu::skills::HIGHEST_SKILL) {
|
||||||
if((newbon->SkillDamageAmount[item->ExtraDmgSkill] + item->ExtraDmgAmt) > RuleI(Character, ItemExtraDmgCap))
|
if((newbon->SkillDamageAmount[item->ExtraDmgSkill] + item->ExtraDmgAmt) > RuleI(Character, ItemExtraDmgCap))
|
||||||
newbon->SkillDamageAmount[item->ExtraDmgSkill] = RuleI(Character, ItemExtraDmgCap);
|
newbon->SkillDamageAmount[item->ExtraDmgSkill] = RuleI(Character, ItemExtraDmgCap);
|
||||||
else
|
else
|
||||||
@ -7598,7 +7599,7 @@ void Bot::CalcBotStats(bool showtext) {
|
|||||||
// Test Code
|
// Test Code
|
||||||
if(GetClass() == BARD)
|
if(GetClass() == BARD)
|
||||||
GetBotOwner()->Message(15, "Bard Skills-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i",
|
GetBotOwner()->Message(15, "Bard Skills-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i",
|
||||||
GetSkill(SkillBrassInstruments), GetSkill(SkillPercussionInstruments), GetSkill(SkillSinging), GetSkill(SkillStringedInstruments), GetSkill(SkillWindInstruments));
|
GetSkill(EQEmu::skills::SkillBrassInstruments), GetSkill(EQEmu::skills::SkillPercussionInstruments), GetSkill(EQEmu::skills::SkillSinging), GetSkill(EQEmu::skills::SkillStringedInstruments), GetSkill(EQEmu::skills::SkillWindInstruments));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if(this->Save())
|
/*if(this->Save())
|
||||||
@ -7617,11 +7618,11 @@ void Bot::CalcBotStats(bool showtext) {
|
|||||||
// Test Code
|
// Test Code
|
||||||
if(GetClass() == BARD) {
|
if(GetClass() == BARD) {
|
||||||
GetBotOwner()->Message(15, "Bard Skills-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i",
|
GetBotOwner()->Message(15, "Bard Skills-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i",
|
||||||
GetSkill(SkillBrassInstruments) + GetBrassMod(),
|
GetSkill(EQEmu::skills::SkillBrassInstruments) + GetBrassMod(),
|
||||||
GetSkill(SkillPercussionInstruments) + GetPercMod(),
|
GetSkill(EQEmu::skills::SkillPercussionInstruments) + GetPercMod(),
|
||||||
GetSkill(SkillSinging) + GetSingMod(),
|
GetSkill(EQEmu::skills::SkillSinging) + GetSingMod(),
|
||||||
GetSkill(SkillStringedInstruments) + GetStringMod(),
|
GetSkill(EQEmu::skills::SkillStringedInstruments) + GetStringMod(),
|
||||||
GetSkill(SkillWindInstruments) + GetWindMod());
|
GetSkill(EQEmu::skills::SkillWindInstruments) + GetWindMod());
|
||||||
GetBotOwner()->Message(15, "Bard Skill Mods-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i", GetBrassMod(), GetPercMod(), GetSingMod(), GetStringMod(), GetWindMod());
|
GetBotOwner()->Message(15, "Bard Skill Mods-- Brass: %i, Percussion: %i, Singing: %i, Stringed: %i, Wind: %i", GetBrassMod(), GetPercMod(), GetSingMod(), GetStringMod(), GetWindMod());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
20
zone/bot.h
20
zone/bot.h
@ -205,8 +205,8 @@ public:
|
|||||||
Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double totalPlayTime, uint32 lastZoneId, NPCType npcTypeData);
|
Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double totalPlayTime, uint32 lastZoneId, NPCType npcTypeData);
|
||||||
|
|
||||||
//abstract virtual function implementations requird by base abstract class
|
//abstract virtual function implementations requird by base abstract class
|
||||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill);
|
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
|
||||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
|
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
|
||||||
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||||
ExtraAttackOptions *opts = nullptr, int special = 0);
|
ExtraAttackOptions *opts = nullptr, int special = 0);
|
||||||
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
||||||
@ -239,23 +239,23 @@ public:
|
|||||||
uint16 BotGetSpellPriority(int spellslot) { return AIspells[spellslot].priority; }
|
uint16 BotGetSpellPriority(int spellslot) { return AIspells[spellslot].priority; }
|
||||||
virtual float GetProcChances(float ProcBonus, uint16 hand);
|
virtual float GetProcChances(float ProcBonus, uint16 hand);
|
||||||
virtual int GetHandToHandDamage(void);
|
virtual int GetHandToHandDamage(void);
|
||||||
virtual bool TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse);
|
virtual bool TryFinishingBlow(Mob *defender, EQEmu::skills::SkillType skillinuse);
|
||||||
virtual void DoRiposte(Mob* defender);
|
virtual void DoRiposte(Mob* defender);
|
||||||
inline virtual int32 GetATK() const { return ATK + itembonuses.ATK + spellbonuses.ATK + ((GetSTR() + GetSkill(SkillOffense)) * 9 / 10); }
|
inline virtual int32 GetATK() const { return ATK + itembonuses.ATK + spellbonuses.ATK + ((GetSTR() + GetSkill(EQEmu::skills::SkillOffense)) * 9 / 10); }
|
||||||
inline virtual int32 GetATKBonus() const { return itembonuses.ATK + spellbonuses.ATK; }
|
inline virtual int32 GetATKBonus() const { return itembonuses.ATK + spellbonuses.ATK; }
|
||||||
uint32 GetTotalATK();
|
uint32 GetTotalATK();
|
||||||
uint32 GetATKRating();
|
uint32 GetATKRating();
|
||||||
uint16 GetPrimarySkillValue();
|
uint16 GetPrimarySkillValue();
|
||||||
uint16 MaxSkill(SkillUseTypes skillid, uint16 class_, uint16 level) const;
|
uint16 MaxSkill(EQEmu::skills::SkillType skillid, uint16 class_, uint16 level) const;
|
||||||
inline uint16 MaxSkill(SkillUseTypes skillid) const { return MaxSkill(skillid, GetClass(), GetLevel()); }
|
inline uint16 MaxSkill(EQEmu::skills::SkillType skillid) const { return MaxSkill(skillid, GetClass(), GetLevel()); }
|
||||||
virtual void DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage, int32 min_damage = 1, int32 hate_override = -1, int ReuseTime = 10, bool HitChance=false);
|
virtual void DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32 max_damage, int32 min_damage = 1, int32 hate_override = -1, int ReuseTime = 10, bool HitChance = false);
|
||||||
virtual void TryBackstab(Mob *other,int ReuseTime = 10);
|
virtual void TryBackstab(Mob *other,int ReuseTime = 10);
|
||||||
virtual void RogueBackstab(Mob* other, bool min_damage = false, int ReuseTime = 10);
|
virtual void RogueBackstab(Mob* other, bool min_damage = false, int ReuseTime = 10);
|
||||||
virtual void RogueAssassinate(Mob* other);
|
virtual void RogueAssassinate(Mob* other);
|
||||||
virtual void DoClassAttacks(Mob *target, bool IsRiposte=false);
|
virtual void DoClassAttacks(Mob *target, bool IsRiposte=false);
|
||||||
virtual bool TryHeadShot(Mob* defender, SkillUseTypes skillInUse);
|
virtual bool TryHeadShot(Mob* defender, EQEmu::skills::SkillType skillInUse);
|
||||||
virtual void DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes skillinuse, int16 chance_mod=0, int16 focus=0, bool CanRiposte=false, int ReuseTime =0);
|
virtual void DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, EQEmu::skills::SkillType skillinuse, int16 chance_mod = 0, int16 focus = 0, bool CanRiposte = false, int ReuseTime = 0);
|
||||||
virtual void ApplySpecialAttackMod(SkillUseTypes skill, int32 &dmg, int32 &mindmg);
|
virtual void ApplySpecialAttackMod(EQEmu::skills::SkillType skill, int32 &dmg, int32 &mindmg);
|
||||||
bool CanDoSpecialAttack(Mob *other);
|
bool CanDoSpecialAttack(Mob *other);
|
||||||
virtual int32 CheckAggroAmount(uint16 spellid);
|
virtual int32 CheckAggroAmount(uint16 spellid);
|
||||||
virtual void CalcBonuses();
|
virtual void CalcBonuses();
|
||||||
|
|||||||
@ -54,6 +54,7 @@
|
|||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
#include "../common/serverinfo.h"
|
#include "../common/serverinfo.h"
|
||||||
#include "../common/string_util.h"
|
#include "../common/string_util.h"
|
||||||
|
#include "../common/say_link.h"
|
||||||
#include "../common/eqemu_logsys.h"
|
#include "../common/eqemu_logsys.h"
|
||||||
|
|
||||||
|
|
||||||
@ -335,11 +336,11 @@ public:
|
|||||||
while (spells[spell_id].typedescnum == 27) {
|
while (spells[spell_id].typedescnum == 27) {
|
||||||
if (!spells[spell_id].goodEffect)
|
if (!spells[spell_id].goodEffect)
|
||||||
break;
|
break;
|
||||||
if (spells[spell_id].skill != SkillOffense && spells[spell_id].skill != SkillDefense)
|
if (spells[spell_id].skill != EQEmu::skills::SkillOffense && spells[spell_id].skill != EQEmu::skills::SkillDefense)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
entry_prototype = new STStanceEntry();
|
entry_prototype = new STStanceEntry();
|
||||||
if (spells[spell_id].skill == SkillOffense)
|
if (spells[spell_id].skill == EQEmu::skills::SkillOffense)
|
||||||
entry_prototype->SafeCastToStance()->stance_type = BCEnum::StT_Aggressive;
|
entry_prototype->SafeCastToStance()->stance_type = BCEnum::StT_Aggressive;
|
||||||
else
|
else
|
||||||
entry_prototype->SafeCastToStance()->stance_type = BCEnum::StT_Defensive;
|
entry_prototype->SafeCastToStance()->stance_type = BCEnum::StT_Defensive;
|
||||||
@ -2388,7 +2389,7 @@ namespace ActionableBots
|
|||||||
sbl.remove_if([bot_owner](Bot* l) { return (!l->IsBotArcher()); });
|
sbl.remove_if([bot_owner](Bot* l) { return (!l->IsBotArcher()); });
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Filter_ByHighestSkill(Client* bot_owner, std::list<Bot*>& sbl, SkillUseTypes skill_type, float& skill_value) {
|
static void Filter_ByHighestSkill(Client* bot_owner, std::list<Bot*>& sbl, EQEmu::skills::SkillType skill_type, float& skill_value) {
|
||||||
sbl.remove_if([bot_owner](Bot* l) { return (!MyBots::IsMyBot(bot_owner, l)); });
|
sbl.remove_if([bot_owner](Bot* l) { return (!MyBots::IsMyBot(bot_owner, l)); });
|
||||||
skill_value = 0.0f;
|
skill_value = 0.0f;
|
||||||
|
|
||||||
@ -2425,7 +2426,7 @@ namespace ActionableBots
|
|||||||
sbl.remove_if([bot_owner](const Bot* l) { return (l->GetClass() == ROGUE && l->GetLevel() < 5); });
|
sbl.remove_if([bot_owner](const Bot* l) { return (l->GetClass() == ROGUE && l->GetLevel() < 5); });
|
||||||
sbl.remove_if([bot_owner](const Bot* l) { return (l->GetClass() == BARD && l->GetLevel() < 40); });
|
sbl.remove_if([bot_owner](const Bot* l) { return (l->GetClass() == BARD && l->GetLevel() < 40); });
|
||||||
|
|
||||||
ActionableBots::Filter_ByHighestSkill(bot_owner, sbl, SkillPickLock, pick_lock_value);
|
ActionableBots::Filter_ByHighestSkill(bot_owner, sbl, EQEmu::skills::SkillPickLock, pick_lock_value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -3906,7 +3907,7 @@ void bot_command_taunt(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
int taunting_count = 0;
|
int taunting_count = 0;
|
||||||
for (auto bot_iter : sbl) {
|
for (auto bot_iter : sbl) {
|
||||||
if (!bot_iter->GetSkill(SkillTaunt))
|
if (!bot_iter->GetSkill(EQEmu::skills::SkillTaunt))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (toggle_taunt)
|
if (toggle_taunt)
|
||||||
|
|||||||
107
zone/client.cpp
107
zone/client.cpp
@ -1433,8 +1433,8 @@ bool Client::UpdateLDoNPoints(int32 points, uint32 theme)
|
|||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::SetSkill(SkillUseTypes skillid, uint16 value) {
|
void Client::SetSkill(EQEmu::skills::SkillType skillid, uint16 value) {
|
||||||
if (skillid > HIGHEST_SKILL)
|
if (skillid > EQEmu::skills::HIGHEST_SKILL)
|
||||||
return;
|
return;
|
||||||
m_pp.skills[skillid] = value; // We need to be able to #setskill 254 and 255 to reset skills
|
m_pp.skills[skillid] = value; // We need to be able to #setskill 254 and 255 to reset skills
|
||||||
|
|
||||||
@ -1470,8 +1470,8 @@ void Client::IncreaseLanguageSkill(int skill_id, int value) {
|
|||||||
Message_StringID( MT_Skills, LANG_SKILL_IMPROVED ); //Notify client
|
Message_StringID( MT_Skills, LANG_SKILL_IMPROVED ); //Notify client
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::AddSkill(SkillUseTypes skillid, uint16 value) {
|
void Client::AddSkill(EQEmu::skills::SkillType skillid, uint16 value) {
|
||||||
if (skillid > HIGHEST_SKILL)
|
if (skillid > EQEmu::skills::HIGHEST_SKILL)
|
||||||
return;
|
return;
|
||||||
value = GetRawSkill(skillid) + value;
|
value = GetRawSkill(skillid) + value;
|
||||||
uint16 max = GetMaxSkillAfterSpecializationRules(skillid, MaxSkill(skillid));
|
uint16 max = GetMaxSkillAfterSpecializationRules(skillid, MaxSkill(skillid));
|
||||||
@ -2289,12 +2289,12 @@ uint64 Client::GetAllMoney() {
|
|||||||
(static_cast<uint64>(m_pp.platinum_shared) * 1000)))));
|
(static_cast<uint64>(m_pp.platinum_shared) * 1000)))));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::CheckIncreaseSkill(SkillUseTypes skillid, Mob *against_who, int chancemodi) {
|
bool Client::CheckIncreaseSkill(EQEmu::skills::SkillType skillid, Mob *against_who, int chancemodi) {
|
||||||
if (IsDead() || IsUnconscious())
|
if (IsDead() || IsUnconscious())
|
||||||
return false;
|
return false;
|
||||||
if (IsAIControlled()) // no skillups while chamred =p
|
if (IsAIControlled()) // no skillups while chamred =p
|
||||||
return false;
|
return false;
|
||||||
if (skillid > HIGHEST_SKILL)
|
if (skillid > EQEmu::skills::HIGHEST_SKILL)
|
||||||
return false;
|
return false;
|
||||||
int skillval = GetRawSkill(skillid);
|
int skillval = GetRawSkill(skillid);
|
||||||
int maxskill = GetMaxSkillAfterSpecializationRules(skillid, MaxSkill(skillid));
|
int maxskill = GetMaxSkillAfterSpecializationRules(skillid, MaxSkill(skillid));
|
||||||
@ -2359,34 +2359,34 @@ void Client::CheckLanguageSkillIncrease(uint8 langid, uint8 TeacherSkill) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::HasSkill(SkillUseTypes skill_id) const {
|
bool Client::HasSkill(EQEmu::skills::SkillType skill_id) const {
|
||||||
return((GetSkill(skill_id) > 0) && CanHaveSkill(skill_id));
|
return((GetSkill(skill_id) > 0) && CanHaveSkill(skill_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::CanHaveSkill(SkillUseTypes skill_id) const {
|
bool Client::CanHaveSkill(EQEmu::skills::SkillType skill_id) const {
|
||||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && class_ == BERSERKER && skill_id == Skill1HPiercing)
|
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && class_ == BERSERKER && skill_id == EQEmu::skills::Skill1HPiercing)
|
||||||
skill_id = Skill2HPiercing;
|
skill_id = EQEmu::skills::Skill2HPiercing;
|
||||||
|
|
||||||
return(database.GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)) > 0);
|
return(database.GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)) > 0);
|
||||||
//if you don't have it by max level, then odds are you never will?
|
//if you don't have it by max level, then odds are you never will?
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 Client::MaxSkill(SkillUseTypes skillid, uint16 class_, uint16 level) const {
|
uint16 Client::MaxSkill(EQEmu::skills::SkillType skillid, uint16 class_, uint16 level) const {
|
||||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && class_ == BERSERKER && skillid == Skill1HPiercing)
|
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && class_ == BERSERKER && skillid == EQEmu::skills::Skill1HPiercing)
|
||||||
skillid = Skill2HPiercing;
|
skillid = EQEmu::skills::Skill2HPiercing;
|
||||||
|
|
||||||
return(database.GetSkillCap(class_, skillid, level));
|
return(database.GetSkillCap(class_, skillid, level));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Client::SkillTrainLevel(SkillUseTypes skillid, uint16 class_)
|
uint8 Client::SkillTrainLevel(EQEmu::skills::SkillType skillid, uint16 class_)
|
||||||
{
|
{
|
||||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && class_ == BERSERKER && skillid == Skill1HPiercing)
|
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && class_ == BERSERKER && skillid == EQEmu::skills::Skill1HPiercing)
|
||||||
skillid = Skill2HPiercing;
|
skillid = EQEmu::skills::Skill2HPiercing;
|
||||||
|
|
||||||
return(database.GetTrainLevel(class_, skillid, RuleI(Character, MaxLevel)));
|
return(database.GetTrainLevel(class_, skillid, RuleI(Character, MaxLevel)));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 Client::GetMaxSkillAfterSpecializationRules(SkillUseTypes skillid, uint16 maxSkill)
|
uint16 Client::GetMaxSkillAfterSpecializationRules(EQEmu::skills::SkillType skillid, uint16 maxSkill)
|
||||||
{
|
{
|
||||||
uint16 Result = maxSkill;
|
uint16 Result = maxSkill;
|
||||||
|
|
||||||
@ -2396,13 +2396,13 @@ uint16 Client::GetMaxSkillAfterSpecializationRules(SkillUseTypes skillid, uint16
|
|||||||
|
|
||||||
uint16 MaxSpecializations = GetAA(aaSecondaryForte) ? 2 : 1;
|
uint16 MaxSpecializations = GetAA(aaSecondaryForte) ? 2 : 1;
|
||||||
|
|
||||||
if(skillid >= SkillSpecializeAbjure && skillid <= SkillSpecializeEvocation)
|
if (skillid >= EQEmu::skills::SkillSpecializeAbjure && skillid <= EQEmu::skills::SkillSpecializeEvocation)
|
||||||
{
|
{
|
||||||
bool HasPrimarySpecSkill = false;
|
bool HasPrimarySpecSkill = false;
|
||||||
|
|
||||||
int NumberOfPrimarySpecSkills = 0;
|
int NumberOfPrimarySpecSkills = 0;
|
||||||
|
|
||||||
for(int i = SkillSpecializeAbjure; i <= SkillSpecializeEvocation; ++i)
|
for (int i = EQEmu::skills::SkillSpecializeAbjure; i <= EQEmu::skills::SkillSpecializeEvocation; ++i)
|
||||||
{
|
{
|
||||||
if(m_pp.skills[i] > 50)
|
if(m_pp.skills[i] > 50)
|
||||||
{
|
{
|
||||||
@ -2459,8 +2459,8 @@ uint16 Client::GetMaxSkillAfterSpecializationRules(SkillUseTypes skillid, uint16
|
|||||||
Message(13, "Your spell casting specializations skills have been reset. "
|
Message(13, "Your spell casting specializations skills have been reset. "
|
||||||
"Only %i primary specialization skill is allowed.", MaxSpecializations);
|
"Only %i primary specialization skill is allowed.", MaxSpecializations);
|
||||||
|
|
||||||
for(int i = SkillSpecializeAbjure; i <= SkillSpecializeEvocation; ++i)
|
for (int i = EQEmu::skills::SkillSpecializeAbjure; i <= EQEmu::skills::SkillSpecializeEvocation; ++i)
|
||||||
SetSkill((SkillUseTypes)i, 1);
|
SetSkill((EQEmu::skills::SkillType)i, 1);
|
||||||
|
|
||||||
Save();
|
Save();
|
||||||
|
|
||||||
@ -2643,14 +2643,14 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail)
|
|||||||
bind_out->type = 1; // Done
|
bind_out->type = 1; // Done
|
||||||
QueuePacket(outapp);
|
QueuePacket(outapp);
|
||||||
bind_out->type = 0;
|
bind_out->type = 0;
|
||||||
CheckIncreaseSkill(SkillBindWound, nullptr, 5);
|
CheckIncreaseSkill(EQEmu::skills::SkillBindWound, nullptr, 5);
|
||||||
|
|
||||||
int maxHPBonus = spellbonuses.MaxBindWound + itembonuses.MaxBindWound +
|
int maxHPBonus = spellbonuses.MaxBindWound + itembonuses.MaxBindWound +
|
||||||
aabonuses.MaxBindWound;
|
aabonuses.MaxBindWound;
|
||||||
|
|
||||||
int max_percent = 50 + 10 * maxHPBonus;
|
int max_percent = 50 + 10 * maxHPBonus;
|
||||||
|
|
||||||
if (GetClass() == MONK && GetSkill(SkillBindWound) > 200) {
|
if (GetClass() == MONK && GetSkill(EQEmu::skills::SkillBindWound) > 200) {
|
||||||
max_percent = 70 + 10 * maxHPBonus;
|
max_percent = 70 + 10 * maxHPBonus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2663,10 +2663,11 @@ bool Client::BindWound(Mob *bindmob, bool start, bool fail)
|
|||||||
// 0.120 per skill point, 0.60 per skill level, minimum 3 max 30
|
// 0.120 per skill point, 0.60 per skill level, minimum 3 max 30
|
||||||
int bindhps = 3;
|
int bindhps = 3;
|
||||||
|
|
||||||
if (GetSkill(SkillBindWound) > 200) {
|
if (GetSkill(EQEmu::skills::SkillBindWound) > 200) {
|
||||||
bindhps += GetSkill(SkillBindWound) * 4 / 10;
|
bindhps += GetSkill(EQEmu::skills::SkillBindWound) * 4 / 10;
|
||||||
} else if (GetSkill(SkillBindWound) >= 10) {
|
}
|
||||||
bindhps += GetSkill(SkillBindWound) / 4;
|
else if (GetSkill(EQEmu::skills::SkillBindWound) >= 10) {
|
||||||
|
bindhps += GetSkill(EQEmu::skills::SkillBindWound) / 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implementation of aaMithanielsBinding is a guess (the multiplier)
|
// Implementation of aaMithanielsBinding is a guess (the multiplier)
|
||||||
@ -3774,7 +3775,7 @@ void Client::SendPickPocketResponse(Mob *from, uint32 amt, int type, const EQEmu
|
|||||||
pick_out->coin = amt;
|
pick_out->coin = amt;
|
||||||
pick_out->from = GetID();
|
pick_out->from = GetID();
|
||||||
pick_out->to = from->GetID();
|
pick_out->to = from->GetID();
|
||||||
pick_out->myskill = GetSkill(SkillPickPockets);
|
pick_out->myskill = GetSkill(EQEmu::skills::SkillPickPockets);
|
||||||
|
|
||||||
if ((type >= PickPocketPlatinum) && (type <= PickPocketCopper) && (amt == 0))
|
if ((type >= PickPocketPlatinum) && (type <= PickPocketCopper) && (amt == 0))
|
||||||
type = PickPocketFailed;
|
type = PickPocketFailed;
|
||||||
@ -4196,11 +4197,11 @@ bool Client::GroupFollow(Client* inviter) {
|
|||||||
|
|
||||||
uint16 Client::GetPrimarySkillValue()
|
uint16 Client::GetPrimarySkillValue()
|
||||||
{
|
{
|
||||||
SkillUseTypes skill = HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
|
EQEmu::skills::SkillType skill = EQEmu::skills::HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
|
||||||
bool equiped = m_inv.GetItem(EQEmu::legacy::SlotPrimary);
|
bool equiped = m_inv.GetItem(EQEmu::legacy::SlotPrimary);
|
||||||
|
|
||||||
if (!equiped)
|
if (!equiped)
|
||||||
skill = SkillHandtoHand;
|
skill = EQEmu::skills::SkillHandtoHand;
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
|
||||||
@ -4208,31 +4209,31 @@ uint16 Client::GetPrimarySkillValue()
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case EQEmu::item::ItemType1HSlash: // 1H Slashing
|
case EQEmu::item::ItemType1HSlash: // 1H Slashing
|
||||||
skill = Skill1HSlashing;
|
skill = EQEmu::skills::Skill1HSlashing;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType2HSlash: // 2H Slashing
|
case EQEmu::item::ItemType2HSlash: // 2H Slashing
|
||||||
skill = Skill2HSlashing;
|
skill = EQEmu::skills::Skill2HSlashing;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType1HPiercing: // Piercing
|
case EQEmu::item::ItemType1HPiercing: // Piercing
|
||||||
skill = Skill1HPiercing;
|
skill = EQEmu::skills::Skill1HPiercing;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType1HBlunt: // 1H Blunt
|
case EQEmu::item::ItemType1HBlunt: // 1H Blunt
|
||||||
skill = Skill1HBlunt;
|
skill = EQEmu::skills::Skill1HBlunt;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType2HBlunt: // 2H Blunt
|
case EQEmu::item::ItemType2HBlunt: // 2H Blunt
|
||||||
skill = Skill2HBlunt;
|
skill = EQEmu::skills::Skill2HBlunt;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemType2HPiercing: // 2H Piercing
|
case EQEmu::item::ItemType2HPiercing: // 2H Piercing
|
||||||
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
|
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
|
||||||
skill = Skill1HPiercing;
|
skill = EQEmu::skills::Skill1HPiercing;
|
||||||
else
|
else
|
||||||
skill = Skill2HPiercing;
|
skill = EQEmu::skills::Skill2HPiercing;
|
||||||
break;
|
break;
|
||||||
case EQEmu::item::ItemTypeMartial: // Hand to Hand
|
case EQEmu::item::ItemTypeMartial: // Hand to Hand
|
||||||
skill = SkillHandtoHand;
|
skill = EQEmu::skills::SkillHandtoHand;
|
||||||
break;
|
break;
|
||||||
default: // All other types default to Hand to Hand
|
default: // All other types default to Hand to Hand
|
||||||
skill = SkillHandtoHand;
|
skill = EQEmu::skills::SkillHandtoHand;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4246,7 +4247,7 @@ uint32 Client::GetTotalATK()
|
|||||||
uint32 WornCap = itembonuses.ATK;
|
uint32 WornCap = itembonuses.ATK;
|
||||||
|
|
||||||
if(IsClient()) {
|
if(IsClient()) {
|
||||||
AttackRating = ((WornCap * 1.342) + (GetSkill(SkillOffense) * 1.345) + ((GetSTR() - 66) * 0.9) + (GetPrimarySkillValue() * 2.69));
|
AttackRating = ((WornCap * 1.342) + (GetSkill(EQEmu::skills::SkillOffense) * 1.345) + ((GetSTR() - 66) * 0.9) + (GetPrimarySkillValue() * 2.69));
|
||||||
AttackRating += aabonuses.ATK + GroupLeadershipAAOffenseEnhancement();
|
AttackRating += aabonuses.ATK + GroupLeadershipAAOffenseEnhancement();
|
||||||
|
|
||||||
if (AttackRating < 10)
|
if (AttackRating < 10)
|
||||||
@ -4264,7 +4265,7 @@ uint32 Client::GetATKRating()
|
|||||||
{
|
{
|
||||||
uint32 AttackRating = 0;
|
uint32 AttackRating = 0;
|
||||||
if(IsClient()) {
|
if(IsClient()) {
|
||||||
AttackRating = (GetSkill(SkillOffense) * 1.345) + ((GetSTR() - 66) * 0.9) + (GetPrimarySkillValue() * 2.69);
|
AttackRating = (GetSkill(EQEmu::skills::SkillOffense) * 1.345) + ((GetSTR() - 66) * 0.9) + (GetPrimarySkillValue() * 2.69);
|
||||||
|
|
||||||
if (AttackRating < 10)
|
if (AttackRating < 10)
|
||||||
AttackRating = 10;
|
AttackRating = 10;
|
||||||
@ -4639,7 +4640,7 @@ void Client::HandleLDoNOpen(NPC *target)
|
|||||||
AddEXP(target->GetLevel()*target->GetLevel()*2625/10, GetLevelCon(target->GetLevel()));
|
AddEXP(target->GetLevel()*target->GetLevel()*2625/10, GetLevelCon(target->GetLevel()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
target->Death(this, 0, SPELL_UNKNOWN, SkillHandtoHand);
|
target->Death(this, 0, SPELL_UNKNOWN, EQEmu::skills::SkillHandtoHand);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4952,14 +4953,14 @@ void Client::ShowSkillsWindow()
|
|||||||
{
|
{
|
||||||
const char *WindowTitle = "Skills";
|
const char *WindowTitle = "Skills";
|
||||||
std::string WindowText;
|
std::string WindowText;
|
||||||
std::map<SkillUseTypes, std::string> Skills = EQEmu::GetSkillUseTypesMap();
|
std::map<EQEmu::skills::SkillType, std::string> Skills = EQEmu::skills::GetSkillTypeMap();
|
||||||
|
|
||||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
|
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
|
||||||
Skills[Skill1HPiercing] = "Piercing";
|
Skills[EQEmu::skills::Skill1HPiercing] = "Piercing";
|
||||||
|
|
||||||
// print out all available skills
|
// print out all available skills
|
||||||
for (auto skills_iter : Skills) {
|
for (auto skills_iter : Skills) {
|
||||||
if (skills_iter.first == Skill2HPiercing && ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
|
if (skills_iter.first == EQEmu::skills::Skill2HPiercing && ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
|
||||||
continue;
|
continue;
|
||||||
if (!GetSkill(skills_iter.first) && !MaxSkill(skills_iter.first))
|
if (!GetSkill(skills_iter.first) && !MaxSkill(skills_iter.first))
|
||||||
continue;
|
continue;
|
||||||
@ -5721,11 +5722,11 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
|
|||||||
if(item) {
|
if(item) {
|
||||||
// we shouldn't do this..but, that's the way it's coded atm...
|
// we shouldn't do this..but, that's the way it's coded atm...
|
||||||
// (this type of action should be handled exclusively in the client translator)
|
// (this type of action should be handled exclusively in the client translator)
|
||||||
strcpy(insr->itemnames[SoF::inventory::SlotPowerSource], item->Name);
|
strcpy(insr->itemnames[SoF::invslot::PossessionsPowerSource], item->Name);
|
||||||
insr->itemicons[SoF::inventory::SlotPowerSource] = item->Icon;
|
insr->itemicons[SoF::invslot::PossessionsPowerSource] = item->Icon;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
insr->itemicons[SoF::inventory::SlotPowerSource] = 0xFFFFFFFF;
|
insr->itemicons[SoF::invslot::PossessionsPowerSource] = 0xFFFFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
inst = requestee->GetInv().GetItem(EQEmu::legacy::SlotAmmo);
|
inst = requestee->GetInv().GetItem(EQEmu::legacy::SlotAmmo);
|
||||||
@ -5733,11 +5734,11 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
|
|||||||
if(inst) {
|
if(inst) {
|
||||||
item = inst->GetItem();
|
item = inst->GetItem();
|
||||||
if(item) {
|
if(item) {
|
||||||
strcpy(insr->itemnames[SoF::inventory::SlotAmmo], item->Name);
|
strcpy(insr->itemnames[SoF::invslot::PossessionsAmmo], item->Name);
|
||||||
insr->itemicons[SoF::inventory::SlotAmmo] = item->Icon;
|
insr->itemicons[SoF::invslot::PossessionsAmmo] = item->Icon;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
insr->itemicons[SoF::inventory::SlotAmmo] = 0xFFFFFFFF;
|
insr->itemicons[SoF::invslot::PossessionsAmmo] = 0xFFFFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(insr->text, requestee->GetInspectMessage().text);
|
strcpy(insr->text, requestee->GetInspectMessage().text);
|
||||||
@ -6750,7 +6751,7 @@ void Client::SendStatsWindow(Client* client, bool use_window)
|
|||||||
};
|
};
|
||||||
|
|
||||||
std::string skill_mods = "";
|
std::string skill_mods = "";
|
||||||
for(int j = 0; j <= HIGHEST_SKILL; j++) {
|
for (int j = 0; j <= EQEmu::skills::HIGHEST_SKILL; j++) {
|
||||||
if(itembonuses.skillmod[j] > 0)
|
if(itembonuses.skillmod[j] > 0)
|
||||||
skill_mods += indP + skill_list[j] + " : +" + itoa(itembonuses.skillmod[j]) + "%<br>";
|
skill_mods += indP + skill_list[j] + " : +" + itoa(itembonuses.skillmod[j]) + "%<br>";
|
||||||
else if(itembonuses.skillmod[j] < 0)
|
else if(itembonuses.skillmod[j] < 0)
|
||||||
@ -6758,7 +6759,7 @@ void Client::SendStatsWindow(Client* client, bool use_window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string skill_dmgs = "";
|
std::string skill_dmgs = "";
|
||||||
for(int j = 0; j <= HIGHEST_SKILL; j++) {
|
for (int j = 0; j <= EQEmu::skills::HIGHEST_SKILL; j++) {
|
||||||
if((itembonuses.SkillDamageAmount[j] + spellbonuses.SkillDamageAmount[j]) > 0)
|
if((itembonuses.SkillDamageAmount[j] + spellbonuses.SkillDamageAmount[j]) > 0)
|
||||||
skill_dmgs += indP + skill_list[j] + " : +" + itoa(itembonuses.SkillDamageAmount[j] + spellbonuses.SkillDamageAmount[j]) + "<br>";
|
skill_dmgs += indP + skill_list[j] + " : +" + itoa(itembonuses.SkillDamageAmount[j] + spellbonuses.SkillDamageAmount[j]) + "<br>";
|
||||||
else if((itembonuses.SkillDamageAmount[j] + spellbonuses.SkillDamageAmount[j]) < 0)
|
else if((itembonuses.SkillDamageAmount[j] + spellbonuses.SkillDamageAmount[j]) < 0)
|
||||||
|
|||||||
@ -220,8 +220,8 @@ public:
|
|||||||
~Client();
|
~Client();
|
||||||
|
|
||||||
//abstract virtual function implementations required by base abstract class
|
//abstract virtual function implementations required by base abstract class
|
||||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill);
|
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
|
||||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
|
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
|
||||||
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||||
ExtraAttackOptions *opts = nullptr, int special = 0);
|
ExtraAttackOptions *opts = nullptr, int special = 0);
|
||||||
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
||||||
@ -306,7 +306,7 @@ public:
|
|||||||
void VoiceMacroReceived(uint32 Type, char *Target, uint32 MacroNumber);
|
void VoiceMacroReceived(uint32 Type, char *Target, uint32 MacroNumber);
|
||||||
void SendSound();
|
void SendSound();
|
||||||
void LearnRecipe(uint32 recipeID);
|
void LearnRecipe(uint32 recipeID);
|
||||||
bool CanIncreaseTradeskill(SkillUseTypes tradeskill);
|
bool CanIncreaseTradeskill(EQEmu::skills::SkillType tradeskill);
|
||||||
|
|
||||||
EQApplicationPacket* ReturnItemPacket(int16 slot_id, const ItemInst* inst, ItemPacketType packet_type);
|
EQApplicationPacket* ReturnItemPacket(int16 slot_id, const ItemInst* inst, ItemPacketType packet_type);
|
||||||
|
|
||||||
@ -418,7 +418,7 @@ public:
|
|||||||
virtual void CalcBonuses();
|
virtual void CalcBonuses();
|
||||||
//these are all precalculated now
|
//these are all precalculated now
|
||||||
inline virtual int32 GetAC() const { return AC; }
|
inline virtual int32 GetAC() const { return AC; }
|
||||||
inline virtual int32 GetATK() const { return ATK + itembonuses.ATK + spellbonuses.ATK + ((GetSTR() + GetSkill(SkillOffense)) * 9 / 10); }
|
inline virtual int32 GetATK() const { return ATK + itembonuses.ATK + spellbonuses.ATK + ((GetSTR() + GetSkill(EQEmu::skills::SkillOffense)) * 9 / 10); }
|
||||||
inline virtual int32 GetATKBonus() const { return itembonuses.ATK + spellbonuses.ATK; }
|
inline virtual int32 GetATKBonus() const { return itembonuses.ATK + spellbonuses.ATK; }
|
||||||
inline virtual int GetHaste() const { return Haste; }
|
inline virtual int GetHaste() const { return Haste; }
|
||||||
int GetRawACNoShield(int &shield_ac) const;
|
int GetRawACNoShield(int &shield_ac) const;
|
||||||
@ -682,31 +682,31 @@ public:
|
|||||||
uint16 GetSkillPoints() { return m_pp.points;}
|
uint16 GetSkillPoints() { return m_pp.points;}
|
||||||
void SetSkillPoints(int inp) { m_pp.points = inp;}
|
void SetSkillPoints(int inp) { m_pp.points = inp;}
|
||||||
|
|
||||||
void IncreaseSkill(int skill_id, int value = 1) { if (skill_id <= HIGHEST_SKILL) { m_pp.skills[skill_id] += value; } }
|
void IncreaseSkill(int skill_id, int value = 1) { if (skill_id <= EQEmu::skills::HIGHEST_SKILL) { m_pp.skills[skill_id] += value; } }
|
||||||
void IncreaseLanguageSkill(int skill_id, int value = 1);
|
void IncreaseLanguageSkill(int skill_id, int value = 1);
|
||||||
virtual uint16 GetSkill(SkillUseTypes skill_id) const {if (skill_id <= HIGHEST_SKILL) {return(itembonuses.skillmod[skill_id] > 0 ? (itembonuses.skillmodmax[skill_id] > 0 ? std::min(m_pp.skills[skill_id] + itembonuses.skillmodmax[skill_id], m_pp.skills[skill_id] * (100 + itembonuses.skillmod[skill_id]) / 100) : m_pp.skills[skill_id] * (100 + itembonuses.skillmod[skill_id]) / 100) : m_pp.skills[skill_id]);} return 0;}
|
virtual uint16 GetSkill(EQEmu::skills::SkillType skill_id) const { if (skill_id <= EQEmu::skills::HIGHEST_SKILL) { return(itembonuses.skillmod[skill_id] > 0 ? (itembonuses.skillmodmax[skill_id] > 0 ? std::min(m_pp.skills[skill_id] + itembonuses.skillmodmax[skill_id], m_pp.skills[skill_id] * (100 + itembonuses.skillmod[skill_id]) / 100) : m_pp.skills[skill_id] * (100 + itembonuses.skillmod[skill_id]) / 100) : m_pp.skills[skill_id]); } return 0; }
|
||||||
uint32 GetRawSkill(SkillUseTypes skill_id) const { if (skill_id <= HIGHEST_SKILL) { return(m_pp.skills[skill_id]); } return 0; }
|
uint32 GetRawSkill(EQEmu::skills::SkillType skill_id) const { if (skill_id <= EQEmu::skills::HIGHEST_SKILL) { return(m_pp.skills[skill_id]); } return 0; }
|
||||||
bool HasSkill(SkillUseTypes skill_id) const;
|
bool HasSkill(EQEmu::skills::SkillType skill_id) const;
|
||||||
bool CanHaveSkill(SkillUseTypes skill_id) const;
|
bool CanHaveSkill(EQEmu::skills::SkillType skill_id) const;
|
||||||
void SetSkill(SkillUseTypes skill_num, uint16 value);
|
void SetSkill(EQEmu::skills::SkillType skill_num, uint16 value);
|
||||||
void AddSkill(SkillUseTypes skillid, uint16 value);
|
void AddSkill(EQEmu::skills::SkillType skillid, uint16 value);
|
||||||
void CheckSpecializeIncrease(uint16 spell_id);
|
void CheckSpecializeIncrease(uint16 spell_id);
|
||||||
void CheckSongSkillIncrease(uint16 spell_id);
|
void CheckSongSkillIncrease(uint16 spell_id);
|
||||||
bool CheckIncreaseSkill(SkillUseTypes skillid, Mob *against_who, int chancemodi = 0);
|
bool CheckIncreaseSkill(EQEmu::skills::SkillType skillid, Mob *against_who, int chancemodi = 0);
|
||||||
void CheckLanguageSkillIncrease(uint8 langid, uint8 TeacherSkill);
|
void CheckLanguageSkillIncrease(uint8 langid, uint8 TeacherSkill);
|
||||||
void SetLanguageSkill(int langid, int value);
|
void SetLanguageSkill(int langid, int value);
|
||||||
void SetHoTT(uint32 mobid);
|
void SetHoTT(uint32 mobid);
|
||||||
void ShowSkillsWindow();
|
void ShowSkillsWindow();
|
||||||
void SendStatsWindow(Client* client, bool use_window);
|
void SendStatsWindow(Client* client, bool use_window);
|
||||||
|
|
||||||
uint16 MaxSkill(SkillUseTypes skillid, uint16 class_, uint16 level) const;
|
uint16 MaxSkill(EQEmu::skills::SkillType skillid, uint16 class_, uint16 level) const;
|
||||||
inline uint16 MaxSkill(SkillUseTypes skillid) const { return MaxSkill(skillid, GetClass(), GetLevel()); }
|
inline uint16 MaxSkill(EQEmu::skills::SkillType skillid) const { return MaxSkill(skillid, GetClass(), GetLevel()); }
|
||||||
uint8 SkillTrainLevel(SkillUseTypes skillid, uint16 class_);
|
uint8 SkillTrainLevel(EQEmu::skills::SkillType skillid, uint16 class_);
|
||||||
|
|
||||||
void TradeskillSearchResults(const std::string &query, unsigned long objtype, unsigned long someid);
|
void TradeskillSearchResults(const std::string &query, unsigned long objtype, unsigned long someid);
|
||||||
void SendTradeskillDetails(uint32 recipe_id);
|
void SendTradeskillDetails(uint32 recipe_id);
|
||||||
bool TradeskillExecute(DBTradeskillRecipe_Struct *spec);
|
bool TradeskillExecute(DBTradeskillRecipe_Struct *spec);
|
||||||
void CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float skillup_modifier, uint16 success_modifier, SkillUseTypes tradeskill);
|
void CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float skillup_modifier, uint16 success_modifier, EQEmu::skills::SkillType tradeskill);
|
||||||
|
|
||||||
void GMKill();
|
void GMKill();
|
||||||
inline bool IsMedding() const {return medding;}
|
inline bool IsMedding() const {return medding;}
|
||||||
@ -928,7 +928,7 @@ public:
|
|||||||
int GetNextAvailableSpellBookSlot(int starting_slot = 0);
|
int GetNextAvailableSpellBookSlot(int starting_slot = 0);
|
||||||
inline uint32 GetSpellByBookSlot(int book_slot) { return m_pp.spell_book[book_slot]; }
|
inline uint32 GetSpellByBookSlot(int book_slot) { return m_pp.spell_book[book_slot]; }
|
||||||
inline bool HasSpellScribed(int spellid) { return (FindSpellBookSlotBySpellID(spellid) != -1 ? true : false); }
|
inline bool HasSpellScribed(int spellid) { return (FindSpellBookSlotBySpellID(spellid) != -1 ? true : false); }
|
||||||
uint16 GetMaxSkillAfterSpecializationRules(SkillUseTypes skillid, uint16 maxSkill);
|
uint16 GetMaxSkillAfterSpecializationRules(EQEmu::skills::SkillType skillid, uint16 maxSkill);
|
||||||
void SendPopupToClient(const char *Title, const char *Text, uint32 PopupID = 0, uint32 Buttons = 0, uint32 Duration = 0);
|
void SendPopupToClient(const char *Title, const char *Text, uint32 PopupID = 0, uint32 Buttons = 0, uint32 Duration = 0);
|
||||||
void SendWindow(uint32 PopupID, uint32 NegativeID, uint32 Buttons, const char *ButtonName0, const char *ButtonName1, uint32 Duration, int title_type, Client* target, const char *Title, const char *Text, ...);
|
void SendWindow(uint32 PopupID, uint32 NegativeID, uint32 Buttons, const char *ButtonName0, const char *ButtonName1, uint32 Duration, int title_type, Client* target, const char *Title, const char *Text, ...);
|
||||||
bool PendingTranslocate;
|
bool PendingTranslocate;
|
||||||
@ -1176,13 +1176,14 @@ public:
|
|||||||
int32 GetActCHA() { return( std::min(GetMaxCHA(), GetCHA()) ); }
|
int32 GetActCHA() { return( std::min(GetMaxCHA(), GetCHA()) ); }
|
||||||
void LoadAccountFlags();
|
void LoadAccountFlags();
|
||||||
void SetAccountFlag(std::string flag, std::string val);
|
void SetAccountFlag(std::string flag, std::string val);
|
||||||
std::string GetAccountFlag(std::string flag); float GetDamageMultiplier(SkillUseTypes);
|
std::string GetAccountFlag(std::string flag);
|
||||||
|
float GetDamageMultiplier(EQEmu::skills::SkillType how_long_has_this_been_missing);
|
||||||
void Consume(const EQEmu::Item_Struct *item, uint8 type, int16 slot, bool auto_consume);
|
void Consume(const EQEmu::Item_Struct *item, uint8 type, int16 slot, bool auto_consume);
|
||||||
void PlayMP3(const char* fname);
|
void PlayMP3(const char* fname);
|
||||||
void ExpeditionSay(const char *str, int ExpID);
|
void ExpeditionSay(const char *str, int ExpID);
|
||||||
int mod_client_damage(int damage, SkillUseTypes skillinuse, int hand, const ItemInst* weapon, Mob* other);
|
int mod_client_damage(int damage, EQEmu::skills::SkillType skillinuse, int hand, const ItemInst* weapon, Mob* other);
|
||||||
bool mod_client_message(char* message, uint8 chan_num);
|
bool mod_client_message(char* message, uint8 chan_num);
|
||||||
bool mod_can_increase_skill(SkillUseTypes skillid, Mob* against_who);
|
bool mod_can_increase_skill(EQEmu::skills::SkillType skillid, Mob* against_who);
|
||||||
int16 mod_increase_skill_chance(int16 chance, Mob* against_who);
|
int16 mod_increase_skill_chance(int16 chance, Mob* against_who);
|
||||||
int mod_bindwound_percent(int max_percent, Mob* bindmob);
|
int mod_bindwound_percent(int max_percent, Mob* bindmob);
|
||||||
int mod_bindwound_hp(int bindhps, Mob* bindmob);
|
int mod_bindwound_hp(int bindhps, Mob* bindmob);
|
||||||
|
|||||||
@ -1032,7 +1032,7 @@ int32 Client::acmod()
|
|||||||
int32 Client::CalcAC()
|
int32 Client::CalcAC()
|
||||||
{
|
{
|
||||||
// new formula
|
// new formula
|
||||||
int avoidance = (acmod() + ((GetSkill(SkillDefense) + itembonuses.HeroicAGI / 10) * 16) / 9);
|
int avoidance = (acmod() + ((GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) * 16) / 9);
|
||||||
if (avoidance < 0) {
|
if (avoidance < 0) {
|
||||||
avoidance = 0;
|
avoidance = 0;
|
||||||
}
|
}
|
||||||
@ -1040,13 +1040,13 @@ int32 Client::CalcAC()
|
|||||||
if (m_pp.class_ == WIZARD || m_pp.class_ == MAGICIAN || m_pp.class_ == NECROMANCER || m_pp.class_ == ENCHANTER) {
|
if (m_pp.class_ == WIZARD || m_pp.class_ == MAGICIAN || m_pp.class_ == NECROMANCER || m_pp.class_ == ENCHANTER) {
|
||||||
//something is wrong with this, naked casters have the wrong natural AC
|
//something is wrong with this, naked casters have the wrong natural AC
|
||||||
// mitigation = (spellbonuses.AC/3) + (GetSkill(DEFENSE)/2) + (itembonuses.AC+1);
|
// mitigation = (spellbonuses.AC/3) + (GetSkill(DEFENSE)/2) + (itembonuses.AC+1);
|
||||||
mitigation = (GetSkill(SkillDefense) + itembonuses.HeroicAGI / 10) / 4 + (itembonuses.AC + 1);
|
mitigation = (GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 4 + (itembonuses.AC + 1);
|
||||||
//this might be off by 4..
|
//this might be off by 4..
|
||||||
mitigation -= 4;
|
mitigation -= 4;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// mitigation = (spellbonuses.AC/4) + (GetSkill(DEFENSE)/3) + ((itembonuses.AC*4)/3);
|
// mitigation = (spellbonuses.AC/4) + (GetSkill(DEFENSE)/3) + ((itembonuses.AC*4)/3);
|
||||||
mitigation = (GetSkill(SkillDefense) + itembonuses.HeroicAGI / 10) / 3 + ((itembonuses.AC * 4) / 3);
|
mitigation = (GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 3 + ((itembonuses.AC * 4) / 3);
|
||||||
if (m_pp.class_ == MONK) {
|
if (m_pp.class_ == MONK) {
|
||||||
mitigation += GetLevel() * 13 / 10; //the 13/10 might be wrong, but it is close...
|
mitigation += GetLevel() * 13 / 10; //the 13/10 might be wrong, but it is close...
|
||||||
}
|
}
|
||||||
@ -1085,11 +1085,11 @@ int32 Client::GetACMit()
|
|||||||
{
|
{
|
||||||
int mitigation = 0;
|
int mitigation = 0;
|
||||||
if (m_pp.class_ == WIZARD || m_pp.class_ == MAGICIAN || m_pp.class_ == NECROMANCER || m_pp.class_ == ENCHANTER) {
|
if (m_pp.class_ == WIZARD || m_pp.class_ == MAGICIAN || m_pp.class_ == NECROMANCER || m_pp.class_ == ENCHANTER) {
|
||||||
mitigation = (GetSkill(SkillDefense) + itembonuses.HeroicAGI / 10) / 4 + (itembonuses.AC + 1);
|
mitigation = (GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 4 + (itembonuses.AC + 1);
|
||||||
mitigation -= 4;
|
mitigation -= 4;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mitigation = (GetSkill(SkillDefense) + itembonuses.HeroicAGI / 10) / 3 + ((itembonuses.AC * 4) / 3);
|
mitigation = (GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 3 + ((itembonuses.AC * 4) / 3);
|
||||||
if (m_pp.class_ == MONK) {
|
if (m_pp.class_ == MONK) {
|
||||||
mitigation += GetLevel() * 13 / 10; //the 13/10 might be wrong, but it is close...
|
mitigation += GetLevel() * 13 / 10; //the 13/10 might be wrong, but it is close...
|
||||||
}
|
}
|
||||||
@ -1109,7 +1109,7 @@ int32 Client::GetACMit()
|
|||||||
|
|
||||||
int32 Client::GetACAvoid()
|
int32 Client::GetACAvoid()
|
||||||
{
|
{
|
||||||
int32 avoidance = (acmod() + ((GetSkill(SkillDefense) + itembonuses.HeroicAGI / 10) * 16) / 9);
|
int32 avoidance = (acmod() + ((GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) * 16) / 9);
|
||||||
if (avoidance < 0) {
|
if (avoidance < 0) {
|
||||||
avoidance = 0;
|
avoidance = 0;
|
||||||
}
|
}
|
||||||
@ -1247,8 +1247,8 @@ int32 Client::CalcBaseManaRegen()
|
|||||||
uint8 clevel = GetLevel();
|
uint8 clevel = GetLevel();
|
||||||
int32 regen = 0;
|
int32 regen = 0;
|
||||||
if (IsSitting() || (GetHorseId() != 0)) {
|
if (IsSitting() || (GetHorseId() != 0)) {
|
||||||
if (HasSkill(SkillMeditate)) {
|
if (HasSkill(EQEmu::skills::SkillMeditate)) {
|
||||||
regen = (((GetSkill(SkillMeditate) / 10) + (clevel - (clevel / 4))) / 4) + 4;
|
regen = (((GetSkill(EQEmu::skills::SkillMeditate) / 10) + (clevel - (clevel / 4))) / 4) + 4;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
regen = 2;
|
regen = 2;
|
||||||
@ -1267,11 +1267,11 @@ int32 Client::CalcManaRegen()
|
|||||||
//this should be changed so we dont med while camping, etc...
|
//this should be changed so we dont med while camping, etc...
|
||||||
if (IsSitting() || (GetHorseId() != 0)) {
|
if (IsSitting() || (GetHorseId() != 0)) {
|
||||||
BuffFadeBySitModifier();
|
BuffFadeBySitModifier();
|
||||||
if (HasSkill(SkillMeditate)) {
|
if (HasSkill(EQEmu::skills::SkillMeditate)) {
|
||||||
this->medding = true;
|
this->medding = true;
|
||||||
regen = (((GetSkill(SkillMeditate) / 10) + (clevel - (clevel / 4))) / 4) + 4;
|
regen = (((GetSkill(EQEmu::skills::SkillMeditate) / 10) + (clevel - (clevel / 4))) / 4) + 4;
|
||||||
regen += spellbonuses.ManaRegen + itembonuses.ManaRegen;
|
regen += spellbonuses.ManaRegen + itembonuses.ManaRegen;
|
||||||
CheckIncreaseSkill(SkillMeditate, nullptr, -5);
|
CheckIncreaseSkill(EQEmu::skills::SkillMeditate, nullptr, -5);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
regen = 2 + spellbonuses.ManaRegen + itembonuses.ManaRegen;
|
regen = 2 + spellbonuses.ManaRegen + itembonuses.ManaRegen;
|
||||||
@ -1355,7 +1355,7 @@ uint32 Client::CalcCurrentWeight()
|
|||||||
This is the ONLY instance I have seen where the client is hard coded to particular Item IDs to set a certain property for an item. It is very odd.
|
This is the ONLY instance I have seen where the client is hard coded to particular Item IDs to set a certain property for an item. It is very odd.
|
||||||
*/
|
*/
|
||||||
// SoD+ client has no weight for coin
|
// SoD+ client has no weight for coin
|
||||||
if (EQEmu::limits::CoinHasWeight(EQEmu::versions::ConvertClientVersionToInventoryVersion(ClientVersion()))) {
|
if (EQEmu::profile::CoinHasWeight(EQEmu::versions::ConvertClientVersionToInventoryVersion(ClientVersion()))) {
|
||||||
Total += (m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4;
|
Total += (m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4;
|
||||||
}
|
}
|
||||||
float Packrat = (float)spellbonuses.Packrat + (float)aabonuses.Packrat + (float)itembonuses.Packrat;
|
float Packrat = (float)spellbonuses.Packrat + (float)aabonuses.Packrat + (float)itembonuses.Packrat;
|
||||||
@ -2046,10 +2046,10 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const
|
|||||||
// clickies (Symphony of Battle) that have a song skill don't get AA bonus for some reason
|
// clickies (Symphony of Battle) that have a song skill don't get AA bonus for some reason
|
||||||
// but clickies that are songs (selo's on Composers Greaves) do get AA mod as well
|
// but clickies that are songs (selo's on Composers Greaves) do get AA mod as well
|
||||||
switch (spells[spell_id].skill) {
|
switch (spells[spell_id].skill) {
|
||||||
case SkillPercussionInstruments:
|
case EQEmu::skills::SkillPercussionInstruments:
|
||||||
if (itembonuses.percussionMod == 0 && spellbonuses.percussionMod == 0)
|
if (itembonuses.percussionMod == 0 && spellbonuses.percussionMod == 0)
|
||||||
effectmod = 10;
|
effectmod = 10;
|
||||||
else if (GetSkill(SkillPercussionInstruments) == 0)
|
else if (GetSkill(EQEmu::skills::SkillPercussionInstruments) == 0)
|
||||||
effectmod = 10;
|
effectmod = 10;
|
||||||
else if (itembonuses.percussionMod > spellbonuses.percussionMod)
|
else if (itembonuses.percussionMod > spellbonuses.percussionMod)
|
||||||
effectmod = itembonuses.percussionMod;
|
effectmod = itembonuses.percussionMod;
|
||||||
@ -2058,10 +2058,10 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const
|
|||||||
if (IsBardSong(spell_id))
|
if (IsBardSong(spell_id))
|
||||||
effectmod += aabonuses.percussionMod;
|
effectmod += aabonuses.percussionMod;
|
||||||
break;
|
break;
|
||||||
case SkillStringedInstruments:
|
case EQEmu::skills::SkillStringedInstruments:
|
||||||
if (itembonuses.stringedMod == 0 && spellbonuses.stringedMod == 0)
|
if (itembonuses.stringedMod == 0 && spellbonuses.stringedMod == 0)
|
||||||
effectmod = 10;
|
effectmod = 10;
|
||||||
else if (GetSkill(SkillStringedInstruments) == 0)
|
else if (GetSkill(EQEmu::skills::SkillStringedInstruments) == 0)
|
||||||
effectmod = 10;
|
effectmod = 10;
|
||||||
else if (itembonuses.stringedMod > spellbonuses.stringedMod)
|
else if (itembonuses.stringedMod > spellbonuses.stringedMod)
|
||||||
effectmod = itembonuses.stringedMod;
|
effectmod = itembonuses.stringedMod;
|
||||||
@ -2070,10 +2070,10 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const
|
|||||||
if (IsBardSong(spell_id))
|
if (IsBardSong(spell_id))
|
||||||
effectmod += aabonuses.stringedMod;
|
effectmod += aabonuses.stringedMod;
|
||||||
break;
|
break;
|
||||||
case SkillWindInstruments:
|
case EQEmu::skills::SkillWindInstruments:
|
||||||
if (itembonuses.windMod == 0 && spellbonuses.windMod == 0)
|
if (itembonuses.windMod == 0 && spellbonuses.windMod == 0)
|
||||||
effectmod = 10;
|
effectmod = 10;
|
||||||
else if (GetSkill(SkillWindInstruments) == 0)
|
else if (GetSkill(EQEmu::skills::SkillWindInstruments) == 0)
|
||||||
effectmod = 10;
|
effectmod = 10;
|
||||||
else if (itembonuses.windMod > spellbonuses.windMod)
|
else if (itembonuses.windMod > spellbonuses.windMod)
|
||||||
effectmod = itembonuses.windMod;
|
effectmod = itembonuses.windMod;
|
||||||
@ -2082,10 +2082,10 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const
|
|||||||
if (IsBardSong(spell_id))
|
if (IsBardSong(spell_id))
|
||||||
effectmod += aabonuses.windMod;
|
effectmod += aabonuses.windMod;
|
||||||
break;
|
break;
|
||||||
case SkillBrassInstruments:
|
case EQEmu::skills::SkillBrassInstruments:
|
||||||
if (itembonuses.brassMod == 0 && spellbonuses.brassMod == 0)
|
if (itembonuses.brassMod == 0 && spellbonuses.brassMod == 0)
|
||||||
effectmod = 10;
|
effectmod = 10;
|
||||||
else if (GetSkill(SkillBrassInstruments) == 0)
|
else if (GetSkill(EQEmu::skills::SkillBrassInstruments) == 0)
|
||||||
effectmod = 10;
|
effectmod = 10;
|
||||||
else if (itembonuses.brassMod > spellbonuses.brassMod)
|
else if (itembonuses.brassMod > spellbonuses.brassMod)
|
||||||
effectmod = itembonuses.brassMod;
|
effectmod = itembonuses.brassMod;
|
||||||
@ -2094,7 +2094,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const
|
|||||||
if (IsBardSong(spell_id))
|
if (IsBardSong(spell_id))
|
||||||
effectmod += aabonuses.brassMod;
|
effectmod += aabonuses.brassMod;
|
||||||
break;
|
break;
|
||||||
case SkillSinging:
|
case EQEmu::skills::SkillSinging:
|
||||||
if (itembonuses.singingMod == 0 && spellbonuses.singingMod == 0)
|
if (itembonuses.singingMod == 0 && spellbonuses.singingMod == 0)
|
||||||
effectmod = 10;
|
effectmod = 10;
|
||||||
else if (itembonuses.singingMod > spellbonuses.singingMod)
|
else if (itembonuses.singingMod > spellbonuses.singingMod)
|
||||||
|
|||||||
@ -2830,10 +2830,10 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app)
|
|||||||
{
|
{
|
||||||
if ((PrimaryWeapon && PrimaryWeapon->GetItem()->ItemType == EQEmu::item::ItemType1HPiercing) ||
|
if ((PrimaryWeapon && PrimaryWeapon->GetItem()->ItemType == EQEmu::item::ItemType1HPiercing) ||
|
||||||
(SecondaryWeapon && SecondaryWeapon->GetItem()->ItemType == EQEmu::item::ItemType1HPiercing)) {
|
(SecondaryWeapon && SecondaryWeapon->GetItem()->ItemType == EQEmu::item::ItemType1HPiercing)) {
|
||||||
float SuccessChance = (GetSkill(SkillApplyPoison) + GetLevel()) / 400.0f;
|
float SuccessChance = (GetSkill(EQEmu::skills::SkillApplyPoison) + GetLevel()) / 400.0f;
|
||||||
double ChanceRoll = zone->random.Real(0, 1);
|
double ChanceRoll = zone->random.Real(0, 1);
|
||||||
|
|
||||||
CheckIncreaseSkill(SkillApplyPoison, nullptr, 10);
|
CheckIncreaseSkill(EQEmu::skills::SkillApplyPoison, nullptr, 10);
|
||||||
|
|
||||||
if (ChanceRoll < SuccessChance) {
|
if (ChanceRoll < SuccessChance) {
|
||||||
ApplyPoisonSuccessResult = 1;
|
ApplyPoisonSuccessResult = 1;
|
||||||
@ -3630,7 +3630,7 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!HasSkill(SkillBegging) || !GetTarget())
|
if (!HasSkill(EQEmu::skills::SkillBegging) || !GetTarget())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (GetTarget()->GetClass() == LDON_TREASURE)
|
if (GetTarget()->GetClass() == LDON_TREASURE)
|
||||||
@ -3668,7 +3668,7 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 CurrentSkill = GetSkill(SkillBegging);
|
uint16 CurrentSkill = GetSkill(EQEmu::skills::SkillBegging);
|
||||||
|
|
||||||
float ChanceToBeg = ((float)(CurrentSkill / 700.0f) + 0.15f) * 100;
|
float ChanceToBeg = ((float)(CurrentSkill / 700.0f) + 0.15f) * 100;
|
||||||
|
|
||||||
@ -3690,7 +3690,7 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
QueuePacket(outapp);
|
QueuePacket(outapp);
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
CheckIncreaseSkill(SkillBegging, nullptr, -10);
|
CheckIncreaseSkill(EQEmu::skills::SkillBegging, nullptr, -10);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::Handle_OP_Bind_Wound(const EQApplicationPacket *app)
|
void Client::Handle_OP_Bind_Wound(const EQApplicationPacket *app)
|
||||||
@ -4526,7 +4526,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
if(IsTracking() && ((m_Position.x!=ppu->x_pos) || (m_Position.y!=ppu->y_pos))){
|
if(IsTracking() && ((m_Position.x!=ppu->x_pos) || (m_Position.y!=ppu->y_pos))){
|
||||||
if(zone->random.Real(0, 100) < 70)//should be good
|
if(zone->random.Real(0, 100) < 70)//should be good
|
||||||
CheckIncreaseSkill(SkillTracking, nullptr, -20);
|
CheckIncreaseSkill(EQEmu::skills::SkillTracking, nullptr, -20);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Break Hide if moving without sneaking and set rewind timer if moved
|
// Break Hide if moving without sneaking and set rewind timer if moved
|
||||||
@ -4581,7 +4581,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(zone->watermap && zone->watermap->InLiquid(glm::vec3(m_Position)))
|
if(zone->watermap && zone->watermap->InLiquid(glm::vec3(m_Position)))
|
||||||
CheckIncreaseSkill(SkillSwimming, nullptr, -17);
|
CheckIncreaseSkill(EQEmu::skills::SkillSwimming, nullptr, -17);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -5070,7 +5070,7 @@ void Client::Handle_OP_Death(const EQApplicationPacket *app)
|
|||||||
Death_Struct* ds = (Death_Struct*)app->pBuffer;
|
Death_Struct* ds = (Death_Struct*)app->pBuffer;
|
||||||
|
|
||||||
//I think this attack_skill value is really a value from SkillDamageTypes...
|
//I think this attack_skill value is really a value from SkillDamageTypes...
|
||||||
if (ds->attack_skill > HIGHEST_SKILL) {
|
if (ds->attack_skill > EQEmu::skills::HIGHEST_SKILL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5078,7 +5078,7 @@ void Client::Handle_OP_Death(const EQApplicationPacket *app)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Mob* killer = entity_list.GetMob(ds->killer_id);
|
Mob* killer = entity_list.GetMob(ds->killer_id);
|
||||||
Death(killer, ds->damage, ds->spell_id, (SkillUseTypes)ds->attack_skill);
|
Death(killer, ds->damage, ds->spell_id, (EQEmu::skills::SkillType)ds->attack_skill);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5139,9 +5139,9 @@ void Client::Handle_OP_DeleteItem(const EQApplicationPacket *app)
|
|||||||
const ItemInst *inst = GetInv().GetItem(alc->from_slot);
|
const ItemInst *inst = GetInv().GetItem(alc->from_slot);
|
||||||
if (inst && inst->GetItem()->ItemType == EQEmu::item::ItemTypeAlcohol) {
|
if (inst && inst->GetItem()->ItemType == EQEmu::item::ItemTypeAlcohol) {
|
||||||
entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), inst->GetItem()->Name);
|
entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), inst->GetItem()->Name);
|
||||||
CheckIncreaseSkill(SkillAlcoholTolerance, nullptr, 25);
|
CheckIncreaseSkill(EQEmu::skills::SkillAlcoholTolerance, nullptr, 25);
|
||||||
|
|
||||||
int16 AlcoholTolerance = GetSkill(SkillAlcoholTolerance);
|
int16 AlcoholTolerance = GetSkill(EQEmu::skills::SkillAlcoholTolerance);
|
||||||
int16 IntoxicationIncrease;
|
int16 IntoxicationIncrease;
|
||||||
|
|
||||||
if (ClientVersion() < EQEmu::versions::ClientVersion::SoD)
|
if (ClientVersion() < EQEmu::versions::ClientVersion::SoD)
|
||||||
@ -5209,7 +5209,7 @@ void Client::Handle_OP_DeleteSpell(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app)
|
void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app)
|
||||||
{
|
{
|
||||||
if (!HasSkill(SkillDisarmTraps))
|
if (!HasSkill(EQEmu::skills::SkillDisarmTraps))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!p_timers.Expired(&database, pTimerDisarmTraps, false)) {
|
if (!p_timers.Expired(&database, pTimerDisarmTraps, false)) {
|
||||||
@ -5217,7 +5217,7 @@ void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int reuse = DisarmTrapsReuseTime - GetSkillReuseTime(SkillDisarmTraps);
|
int reuse = DisarmTrapsReuseTime - GetSkillReuseTime(EQEmu::skills::SkillDisarmTraps);
|
||||||
|
|
||||||
if (reuse < 1)
|
if (reuse < 1)
|
||||||
reuse = 1;
|
reuse = 1;
|
||||||
@ -5227,7 +5227,7 @@ void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app)
|
|||||||
Trap* trap = entity_list.FindNearbyTrap(this, 60);
|
Trap* trap = entity_list.FindNearbyTrap(this, 60);
|
||||||
if (trap && trap->detected)
|
if (trap && trap->detected)
|
||||||
{
|
{
|
||||||
int uskill = GetSkill(SkillDisarmTraps);
|
int uskill = GetSkill(EQEmu::skills::SkillDisarmTraps);
|
||||||
if ((zone->random.Int(0, 49) + uskill) >= (zone->random.Int(0, 49) + trap->skill))
|
if ((zone->random.Int(0, 49) + uskill) >= (zone->random.Int(0, 49) + trap->skill))
|
||||||
{
|
{
|
||||||
Message(MT_Skills, "You disarm a trap.");
|
Message(MT_Skills, "You disarm a trap.");
|
||||||
@ -5245,7 +5245,7 @@ void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app)
|
|||||||
Message(MT_Skills, "You failed to disarm a trap.");
|
Message(MT_Skills, "You failed to disarm a trap.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CheckIncreaseSkill(SkillDisarmTraps, nullptr);
|
CheckIncreaseSkill(EQEmu::skills::SkillDisarmTraps, nullptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Message(MT_Skills, "You did not find any traps close enough to disarm.");
|
Message(MT_Skills, "You did not find any traps close enough to disarm.");
|
||||||
@ -5527,7 +5527,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
if (GetHP() <= 0) {
|
if (GetHP() <= 0) {
|
||||||
mod_client_death_env();
|
mod_client_death_env();
|
||||||
Death(0, 32000, SPELL_UNKNOWN, SkillHandtoHand);
|
Death(0, 32000, SPELL_UNKNOWN, EQEmu::skills::SkillHandtoHand);
|
||||||
}
|
}
|
||||||
SendHPUpdate();
|
SendHPUpdate();
|
||||||
return;
|
return;
|
||||||
@ -5571,7 +5571,7 @@ void Client::Handle_OP_FeignDeath(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int reuse = FeignDeathReuseTime;
|
int reuse = FeignDeathReuseTime;
|
||||||
reuse -= GetSkillReuseTime(SkillFeignDeath);
|
reuse -= GetSkillReuseTime(EQEmu::skills::SkillFeignDeath);
|
||||||
|
|
||||||
if (reuse < 1)
|
if (reuse < 1)
|
||||||
reuse = 1;
|
reuse = 1;
|
||||||
@ -5580,8 +5580,8 @@ void Client::Handle_OP_FeignDeath(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
//BreakInvis();
|
//BreakInvis();
|
||||||
|
|
||||||
uint16 primfeign = GetSkill(SkillFeignDeath);
|
uint16 primfeign = GetSkill(EQEmu::skills::SkillFeignDeath);
|
||||||
uint16 secfeign = GetSkill(SkillFeignDeath);
|
uint16 secfeign = GetSkill(EQEmu::skills::SkillFeignDeath);
|
||||||
if (primfeign > 100) {
|
if (primfeign > 100) {
|
||||||
primfeign = 100;
|
primfeign = 100;
|
||||||
secfeign = secfeign - 100;
|
secfeign = secfeign - 100;
|
||||||
@ -5599,7 +5599,7 @@ void Client::Handle_OP_FeignDeath(const EQApplicationPacket *app)
|
|||||||
SetFeigned(true);
|
SetFeigned(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckIncreaseSkill(SkillFeignDeath, nullptr, 5);
|
CheckIncreaseSkill(EQEmu::skills::SkillFeignDeath, nullptr, 5);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7859,7 +7859,7 @@ void Client::Handle_OP_Heartbeat(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
void Client::Handle_OP_Hide(const EQApplicationPacket *app)
|
void Client::Handle_OP_Hide(const EQApplicationPacket *app)
|
||||||
{
|
{
|
||||||
if (!HasSkill(SkillHide) && GetSkill(SkillHide) == 0)
|
if (!HasSkill(EQEmu::skills::SkillHide) && GetSkill(EQEmu::skills::SkillHide) == 0)
|
||||||
{
|
{
|
||||||
//Can not be able to train hide but still have it from racial though
|
//Can not be able to train hide but still have it from racial though
|
||||||
return; //You cannot hide if you do not have hide
|
return; //You cannot hide if you do not have hide
|
||||||
@ -7869,16 +7869,16 @@ void Client::Handle_OP_Hide(const EQApplicationPacket *app)
|
|||||||
Message(13, "Ability recovery time not yet met.");
|
Message(13, "Ability recovery time not yet met.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int reuse = HideReuseTime - GetSkillReuseTime(SkillHide);
|
int reuse = HideReuseTime - GetSkillReuseTime(EQEmu::skills::SkillHide);
|
||||||
|
|
||||||
if (reuse < 1)
|
if (reuse < 1)
|
||||||
reuse = 1;
|
reuse = 1;
|
||||||
|
|
||||||
p_timers.Start(pTimerHide, reuse - 1);
|
p_timers.Start(pTimerHide, reuse - 1);
|
||||||
|
|
||||||
float hidechance = ((GetSkill(SkillHide) / 250.0f) + .25) * 100;
|
float hidechance = ((GetSkill(EQEmu::skills::SkillHide) / 250.0f) + .25) * 100;
|
||||||
float random = zone->random.Real(0, 100);
|
float random = zone->random.Real(0, 100);
|
||||||
CheckIncreaseSkill(SkillHide, nullptr, 5);
|
CheckIncreaseSkill(EQEmu::skills::SkillHide, nullptr, 5);
|
||||||
if (random < hidechance) {
|
if (random < hidechance) {
|
||||||
auto outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
auto outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
||||||
SpawnAppearance_Struct* sa_out = (SpawnAppearance_Struct*)outapp->pBuffer;
|
SpawnAppearance_Struct* sa_out = (SpawnAppearance_Struct*)outapp->pBuffer;
|
||||||
@ -7901,7 +7901,7 @@ void Client::Handle_OP_Hide(const EQApplicationPacket *app)
|
|||||||
Mob *evadetar = GetTarget();
|
Mob *evadetar = GetTarget();
|
||||||
if (!auto_attack && (evadetar && evadetar->CheckAggro(this)
|
if (!auto_attack && (evadetar && evadetar->CheckAggro(this)
|
||||||
&& evadetar->IsNPC())) {
|
&& evadetar->IsNPC())) {
|
||||||
if (zone->random.Int(0, 260) < (int)GetSkill(SkillHide)) {
|
if (zone->random.Int(0, 260) < (int)GetSkill(EQEmu::skills::SkillHide)) {
|
||||||
msg->string_id = EVADE_SUCCESS;
|
msg->string_id = EVADE_SUCCESS;
|
||||||
RogueEvade(evadetar);
|
RogueEvade(evadetar);
|
||||||
}
|
}
|
||||||
@ -8023,10 +8023,10 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
if (item) {
|
if (item) {
|
||||||
// another one..I did these, didn't I!!?
|
// another one..I did these, didn't I!!?
|
||||||
strcpy(insr->itemnames[SoF::inventory::SlotAmmo], item->Name);
|
strcpy(insr->itemnames[SoF::invslot::PossessionsAmmo], item->Name);
|
||||||
insr->itemicons[SoF::inventory::SlotAmmo] = item->Icon;
|
insr->itemicons[SoF::invslot::PossessionsAmmo] = item->Icon;
|
||||||
}
|
}
|
||||||
else { insr->itemicons[SoF::inventory::SlotAmmo] = 0xFFFFFFFF; }
|
else { insr->itemicons[SoF::invslot::PossessionsAmmo] = 0xFFFFFFFF; }
|
||||||
|
|
||||||
InspectMessage_Struct* newmessage = (InspectMessage_Struct*)insr->text;
|
InspectMessage_Struct* newmessage = (InspectMessage_Struct*)insr->text;
|
||||||
InspectMessage_Struct& playermessage = this->GetInspectMessage();
|
InspectMessage_Struct& playermessage = this->GetInspectMessage();
|
||||||
@ -8689,14 +8689,14 @@ void Client::Handle_OP_LDoNDisarmTraps(const EQApplicationPacket *app)
|
|||||||
Mob * target = GetTarget();
|
Mob * target = GetTarget();
|
||||||
if (target->IsNPC())
|
if (target->IsNPC())
|
||||||
{
|
{
|
||||||
if (HasSkill(SkillDisarmTraps))
|
if (HasSkill(EQEmu::skills::SkillDisarmTraps))
|
||||||
{
|
{
|
||||||
if (DistanceSquaredNoZ(m_Position, target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
if (DistanceSquaredNoZ(m_Position, target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||||
{
|
{
|
||||||
Message(13, "%s is too far away.", target->GetCleanName());
|
Message(13, "%s is too far away.", target->GetCleanName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HandleLDoNDisarm(target->CastToNPC(), GetSkill(SkillDisarmTraps), LDoNTypeMechanical);
|
HandleLDoNDisarm(target->CastToNPC(), GetSkill(EQEmu::skills::SkillDisarmTraps), LDoNTypeMechanical);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Message(13, "You do not have the disarm trap skill.");
|
Message(13, "You do not have the disarm trap skill.");
|
||||||
@ -8722,14 +8722,14 @@ void Client::Handle_OP_LDoNPickLock(const EQApplicationPacket *app)
|
|||||||
Mob * target = GetTarget();
|
Mob * target = GetTarget();
|
||||||
if (target->IsNPC())
|
if (target->IsNPC())
|
||||||
{
|
{
|
||||||
if (HasSkill(SkillPickLock))
|
if (HasSkill(EQEmu::skills::SkillPickLock))
|
||||||
{
|
{
|
||||||
if (DistanceSquaredNoZ(m_Position, target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
if (DistanceSquaredNoZ(m_Position, target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||||
{
|
{
|
||||||
Message(13, "%s is too far away.", target->GetCleanName());
|
Message(13, "%s is too far away.", target->GetCleanName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HandleLDoNPickLock(target->CastToNPC(), GetSkill(SkillPickLock), LDoNTypeMechanical);
|
HandleLDoNPickLock(target->CastToNPC(), GetSkill(EQEmu::skills::SkillPickLock), LDoNTypeMechanical);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Message(13, "You do not have the pick locks skill.");
|
Message(13, "You do not have the pick locks skill.");
|
||||||
@ -8741,14 +8741,14 @@ void Client::Handle_OP_LDoNSenseTraps(const EQApplicationPacket *app)
|
|||||||
Mob * target = GetTarget();
|
Mob * target = GetTarget();
|
||||||
if (target->IsNPC())
|
if (target->IsNPC())
|
||||||
{
|
{
|
||||||
if (HasSkill(SkillSenseTraps))
|
if (HasSkill(EQEmu::skills::SkillSenseTraps))
|
||||||
{
|
{
|
||||||
if (DistanceSquaredNoZ(m_Position, target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
if (DistanceSquaredNoZ(m_Position, target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||||
{
|
{
|
||||||
Message(13, "%s is too far away.", target->GetCleanName());
|
Message(13, "%s is too far away.", target->GetCleanName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HandleLDoNSenseTraps(target->CastToNPC(), GetSkill(SkillSenseTraps), LDoNTypeMechanical);
|
HandleLDoNSenseTraps(target->CastToNPC(), GetSkill(EQEmu::skills::SkillSenseTraps), LDoNTypeMechanical);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Message(13, "You do not have the sense traps skill.");
|
Message(13, "You do not have the sense traps skill.");
|
||||||
@ -9251,7 +9251,7 @@ void Client::Handle_OP_MemorizeSpell(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
void Client::Handle_OP_Mend(const EQApplicationPacket *app)
|
void Client::Handle_OP_Mend(const EQApplicationPacket *app)
|
||||||
{
|
{
|
||||||
if (!HasSkill(SkillMend))
|
if (!HasSkill(EQEmu::skills::SkillMend))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!p_timers.Expired(&database, pTimerMend, false)) {
|
if (!p_timers.Expired(&database, pTimerMend, false)) {
|
||||||
@ -9262,7 +9262,7 @@ void Client::Handle_OP_Mend(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
int mendhp = GetMaxHP() / 4;
|
int mendhp = GetMaxHP() / 4;
|
||||||
int currenthp = GetHP();
|
int currenthp = GetHP();
|
||||||
if (zone->random.Int(0, 199) < (int)GetSkill(SkillMend)) {
|
if (zone->random.Int(0, 199) < (int)GetSkill(EQEmu::skills::SkillMend)) {
|
||||||
|
|
||||||
int criticalchance = spellbonuses.CriticalMend + itembonuses.CriticalMend + aabonuses.CriticalMend;
|
int criticalchance = spellbonuses.CriticalMend + itembonuses.CriticalMend + aabonuses.CriticalMend;
|
||||||
|
|
||||||
@ -9281,7 +9281,7 @@ void Client::Handle_OP_Mend(const EQApplicationPacket *app)
|
|||||||
0 skill - 25% chance to worsen
|
0 skill - 25% chance to worsen
|
||||||
20 skill - 23% chance to worsen
|
20 skill - 23% chance to worsen
|
||||||
50 skill - 16% chance to worsen */
|
50 skill - 16% chance to worsen */
|
||||||
if ((GetSkill(SkillMend) <= 75) && (zone->random.Int(GetSkill(SkillMend), 100) < 75) && (zone->random.Int(1, 3) == 1))
|
if ((GetSkill(EQEmu::skills::SkillMend) <= 75) && (zone->random.Int(GetSkill(EQEmu::skills::SkillMend), 100) < 75) && (zone->random.Int(1, 3) == 1))
|
||||||
{
|
{
|
||||||
SetHP(currenthp > mendhp ? (GetHP() - mendhp) : 1);
|
SetHP(currenthp > mendhp ? (GetHP() - mendhp) : 1);
|
||||||
SendHPUpdate();
|
SendHPUpdate();
|
||||||
@ -9291,7 +9291,7 @@ void Client::Handle_OP_Mend(const EQApplicationPacket *app)
|
|||||||
Message_StringID(4, MEND_FAIL);
|
Message_StringID(4, MEND_FAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckIncreaseSkill(SkillMend, nullptr, 10);
|
CheckIncreaseSkill(EQEmu::skills::SkillMend, nullptr, 10);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10440,7 +10440,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app)
|
|||||||
DumpPacket(app);
|
DumpPacket(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!HasSkill(SkillPickPockets))
|
if (!HasSkill(EQEmu::skills::SkillPickPockets))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -10465,7 +10465,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app)
|
|||||||
pick_out->coin = 0;
|
pick_out->coin = 0;
|
||||||
pick_out->from = victim->GetID();
|
pick_out->from = victim->GetID();
|
||||||
pick_out->to = GetID();
|
pick_out->to = GetID();
|
||||||
pick_out->myskill = GetSkill(SkillPickPockets);
|
pick_out->myskill = GetSkill(EQEmu::skills::SkillPickPockets);
|
||||||
pick_out->type = 0;
|
pick_out->type = 0;
|
||||||
//if we do not send this packet the client will lock up and require the player to relog.
|
//if we do not send this packet the client will lock up and require the player to relog.
|
||||||
QueuePacket(outapp);
|
QueuePacket(outapp);
|
||||||
@ -10478,7 +10478,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app)
|
|||||||
pick_out->coin = 0;
|
pick_out->coin = 0;
|
||||||
pick_out->from = victim->GetID();
|
pick_out->from = victim->GetID();
|
||||||
pick_out->to = GetID();
|
pick_out->to = GetID();
|
||||||
pick_out->myskill = GetSkill(SkillPickPockets);
|
pick_out->myskill = GetSkill(EQEmu::skills::SkillPickPockets);
|
||||||
pick_out->type = 0;
|
pick_out->type = 0;
|
||||||
//if we do not send this packet the client will lock up and require the player to relog.
|
//if we do not send this packet the client will lock up and require the player to relog.
|
||||||
QueuePacket(outapp);
|
QueuePacket(outapp);
|
||||||
@ -10494,7 +10494,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app)
|
|||||||
pick_out->coin = 0;
|
pick_out->coin = 0;
|
||||||
pick_out->from = victim->GetID();
|
pick_out->from = victim->GetID();
|
||||||
pick_out->to = GetID();
|
pick_out->to = GetID();
|
||||||
pick_out->myskill = GetSkill(SkillPickPockets);
|
pick_out->myskill = GetSkill(EQEmu::skills::SkillPickPockets);
|
||||||
pick_out->type = 0;
|
pick_out->type = 0;
|
||||||
//if we do not send this packet the client will lock up and require the player to relog.
|
//if we do not send this packet the client will lock up and require the player to relog.
|
||||||
QueuePacket(outapp);
|
QueuePacket(outapp);
|
||||||
@ -11739,8 +11739,8 @@ void Client::Handle_OP_Sacrifice(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
void Client::Handle_OP_SafeFallSuccess(const EQApplicationPacket *app) // bit of a misnomer, sent whenever safe fall is used (success of fail)
|
void Client::Handle_OP_SafeFallSuccess(const EQApplicationPacket *app) // bit of a misnomer, sent whenever safe fall is used (success of fail)
|
||||||
{
|
{
|
||||||
if (HasSkill(SkillSafeFall)) //this should only get called if the client has safe fall, but just in case...
|
if (HasSkill(EQEmu::skills::SkillSafeFall)) //this should only get called if the client has safe fall, but just in case...
|
||||||
CheckIncreaseSkill(SkillSafeFall, nullptr); //check for skill up
|
CheckIncreaseSkill(EQEmu::skills::SkillSafeFall, nullptr); //check for skill up
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::Handle_OP_SafePoint(const EQApplicationPacket *app)
|
void Client::Handle_OP_SafePoint(const EQApplicationPacket *app)
|
||||||
@ -11777,7 +11777,7 @@ void Client::Handle_OP_SelectTribute(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
void Client::Handle_OP_SenseHeading(const EQApplicationPacket *app)
|
void Client::Handle_OP_SenseHeading(const EQApplicationPacket *app)
|
||||||
{
|
{
|
||||||
if (!HasSkill(SkillSenseHeading))
|
if (!HasSkill(EQEmu::skills::SkillSenseHeading))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int chancemod=0;
|
int chancemod=0;
|
||||||
@ -11791,14 +11791,14 @@ void Client::Handle_OP_SenseHeading(const EQApplicationPacket *app)
|
|||||||
if (GetLevel() <= 8)
|
if (GetLevel() <= 8)
|
||||||
chancemod += (9-level) * 10;
|
chancemod += (9-level) * 10;
|
||||||
|
|
||||||
CheckIncreaseSkill(SkillSenseHeading, nullptr, chancemod);
|
CheckIncreaseSkill(EQEmu::skills::SkillSenseHeading, nullptr, chancemod);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app)
|
void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app)
|
||||||
{
|
{
|
||||||
if (!HasSkill(SkillSenseTraps))
|
if (!HasSkill(EQEmu::skills::SkillSenseTraps))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!p_timers.Expired(&database, pTimerSenseTraps, false)) {
|
if (!p_timers.Expired(&database, pTimerSenseTraps, false)) {
|
||||||
@ -11806,7 +11806,7 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int reuse = SenseTrapsReuseTime - GetSkillReuseTime(SkillSenseTraps);
|
int reuse = SenseTrapsReuseTime - GetSkillReuseTime(EQEmu::skills::SkillSenseTraps);
|
||||||
|
|
||||||
if (reuse < 1)
|
if (reuse < 1)
|
||||||
reuse = 1;
|
reuse = 1;
|
||||||
@ -11815,10 +11815,10 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
Trap* trap = entity_list.FindNearbyTrap(this, 800);
|
Trap* trap = entity_list.FindNearbyTrap(this, 800);
|
||||||
|
|
||||||
CheckIncreaseSkill(SkillSenseTraps, nullptr);
|
CheckIncreaseSkill(EQEmu::skills::SkillSenseTraps, nullptr);
|
||||||
|
|
||||||
if (trap && trap->skill > 0) {
|
if (trap && trap->skill > 0) {
|
||||||
int uskill = GetSkill(SkillSenseTraps);
|
int uskill = GetSkill(EQEmu::skills::SkillSenseTraps);
|
||||||
if ((zone->random.Int(0, 99) + uskill) >= (zone->random.Int(0, 99) + trap->skill*0.75))
|
if ((zone->random.Int(0, 99) + uskill) >= (zone->random.Int(0, 99) + trap->skill*0.75))
|
||||||
{
|
{
|
||||||
auto diff = trap->m_Position - glm::vec3(GetPosition());
|
auto diff = trap->m_Position - glm::vec3(GetPosition());
|
||||||
@ -12621,7 +12621,7 @@ void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
void Client::Handle_OP_Sneak(const EQApplicationPacket *app)
|
void Client::Handle_OP_Sneak(const EQApplicationPacket *app)
|
||||||
{
|
{
|
||||||
if (!HasSkill(SkillSneak) && GetSkill(SkillSneak) == 0) {
|
if (!HasSkill(EQEmu::skills::SkillSneak) && GetSkill(EQEmu::skills::SkillSneak) == 0) {
|
||||||
return; //You cannot sneak if you do not have sneak
|
return; //You cannot sneak if you do not have sneak
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12645,9 +12645,9 @@ void Client::Handle_OP_Sneak(const EQApplicationPacket *app)
|
|||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CheckIncreaseSkill(SkillSneak, nullptr, 5);
|
CheckIncreaseSkill(EQEmu::skills::SkillSneak, nullptr, 5);
|
||||||
}
|
}
|
||||||
float hidechance = ((GetSkill(SkillSneak) / 300.0f) + .25) * 100;
|
float hidechance = ((GetSkill(EQEmu::skills::SkillSneak) / 300.0f) + .25) * 100;
|
||||||
float random = zone->random.Real(0, 99);
|
float random = zone->random.Real(0, 99);
|
||||||
if (!was && random < hidechance) {
|
if (!was && random < hidechance) {
|
||||||
sneaking = true;
|
sneaking = true;
|
||||||
@ -12688,7 +12688,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app)
|
|||||||
if (sa->type == AT_Invis) {
|
if (sa->type == AT_Invis) {
|
||||||
if (sa->parameter != 0)
|
if (sa->parameter != 0)
|
||||||
{
|
{
|
||||||
if (!HasSkill(SkillHide) && GetSkill(SkillHide) == 0)
|
if (!HasSkill(EQEmu::skills::SkillHide) && GetSkill(EQEmu::skills::SkillHide) == 0)
|
||||||
{
|
{
|
||||||
if (ClientVersion() < EQEmu::versions::ClientVersion::SoF)
|
if (ClientVersion() < EQEmu::versions::ClientVersion::SoF)
|
||||||
{
|
{
|
||||||
@ -12790,7 +12790,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
if (sa->parameter != 0)
|
if (sa->parameter != 0)
|
||||||
{
|
{
|
||||||
if (!HasSkill(SkillSneak))
|
if (!HasSkill(EQEmu::skills::SkillSneak))
|
||||||
{
|
{
|
||||||
char *hack_str = nullptr;
|
char *hack_str = nullptr;
|
||||||
MakeAnyLenString(&hack_str, "Player sent OP_SpawnAppearance with AT_Sneak: %i", sa->parameter);
|
MakeAnyLenString(&hack_str, "Player sent OP_SpawnAppearance with AT_Sneak: %i", sa->parameter);
|
||||||
@ -13234,10 +13234,10 @@ void Client::Handle_OP_Track(const EQApplicationPacket *app)
|
|||||||
if (GetClass() != RANGER && GetClass() != DRUID && GetClass() != BARD)
|
if (GetClass() != RANGER && GetClass() != DRUID && GetClass() != BARD)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (GetSkill(SkillTracking) == 0)
|
if (GetSkill(EQEmu::skills::SkillTracking) == 0)
|
||||||
SetSkill(SkillTracking, 1);
|
SetSkill(EQEmu::skills::SkillTracking, 1);
|
||||||
else
|
else
|
||||||
CheckIncreaseSkill(SkillTracking, nullptr, 15);
|
CheckIncreaseSkill(EQEmu::skills::SkillTracking, nullptr, 15);
|
||||||
|
|
||||||
if (!entity_list.MakeTrackPacket(this))
|
if (!entity_list.MakeTrackPacket(this))
|
||||||
Log.Out(Logs::General, Logs::Error, "Unable to generate OP_Track packet requested by client.");
|
Log.Out(Logs::General, Logs::Error, "Unable to generate OP_Track packet requested by client.");
|
||||||
|
|||||||
@ -428,7 +428,7 @@ bool Client::Process() {
|
|||||||
//you can't see your target
|
//you can't see your target
|
||||||
}
|
}
|
||||||
else if(auto_attack_target->GetHP() > -10) {
|
else if(auto_attack_target->GetHP() > -10) {
|
||||||
CheckIncreaseSkill(SkillDualWield, auto_attack_target, -10);
|
CheckIncreaseSkill(EQEmu::skills::SkillDualWield, auto_attack_target, -10);
|
||||||
if (CheckDualWield()) {
|
if (CheckDualWield()) {
|
||||||
ItemInst *wpn = GetInv().GetItem(EQEmu::legacy::SlotSecondary);
|
ItemInst *wpn = GetInv().GetItem(EQEmu::legacy::SlotSecondary);
|
||||||
TryWeaponProc(wpn, auto_attack_target, EQEmu::legacy::SlotSecondary);
|
TryWeaponProc(wpn, auto_attack_target, EQEmu::legacy::SlotSecondary);
|
||||||
@ -1481,19 +1481,19 @@ void Client::OPGMTraining(const EQApplicationPacket *app)
|
|||||||
// if this for-loop acts up again (crashes linux), try enabling the before and after #pragmas
|
// if this for-loop acts up again (crashes linux), try enabling the before and after #pragmas
|
||||||
//#pragma GCC push_options
|
//#pragma GCC push_options
|
||||||
//#pragma GCC optimize ("O0")
|
//#pragma GCC optimize ("O0")
|
||||||
for (int sk = Skill1HBlunt; sk <= HIGHEST_SKILL; ++sk) {
|
for (int sk = EQEmu::skills::Skill1HBlunt; sk <= EQEmu::skills::HIGHEST_SKILL; ++sk) {
|
||||||
if(sk == SkillTinkering && GetRace() != GNOME) {
|
if (sk == EQEmu::skills::SkillTinkering && GetRace() != GNOME) {
|
||||||
gmtrain->skills[sk] = 0; //Non gnomes can't tinker!
|
gmtrain->skills[sk] = 0; //Non gnomes can't tinker!
|
||||||
} else {
|
} else {
|
||||||
gmtrain->skills[sk] = GetMaxSkillAfterSpecializationRules((SkillUseTypes)sk, MaxSkill((SkillUseTypes)sk, GetClass(), RuleI(Character, MaxLevel)));
|
gmtrain->skills[sk] = GetMaxSkillAfterSpecializationRules((EQEmu::skills::SkillType)sk, MaxSkill((EQEmu::skills::SkillType)sk, GetClass(), RuleI(Character, MaxLevel)));
|
||||||
//this is the highest level that the trainer can train you to, this is enforced clientside so we can't just
|
//this is the highest level that the trainer can train you to, this is enforced clientside so we can't just
|
||||||
//Set it to 1 with CanHaveSkill or you wont be able to train past 1.
|
//Set it to 1 with CanHaveSkill or you wont be able to train past 1.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && GetClass() == BERSERKER) {
|
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && GetClass() == BERSERKER) {
|
||||||
gmtrain->skills[Skill1HPiercing] = gmtrain->skills[Skill2HPiercing];
|
gmtrain->skills[EQEmu::skills::Skill1HPiercing] = gmtrain->skills[EQEmu::skills::Skill2HPiercing];
|
||||||
gmtrain->skills[Skill2HPiercing] = 0;
|
gmtrain->skills[EQEmu::skills::Skill2HPiercing] = 0;
|
||||||
}
|
}
|
||||||
//#pragma GCC pop_options
|
//#pragma GCC pop_options
|
||||||
|
|
||||||
@ -1578,14 +1578,14 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
|
|||||||
else if (gmskill->skillbank == 0x00)
|
else if (gmskill->skillbank == 0x00)
|
||||||
{
|
{
|
||||||
// normal skills go here
|
// normal skills go here
|
||||||
if (gmskill->skill_id > HIGHEST_SKILL)
|
if (gmskill->skill_id > EQEmu::skills::HIGHEST_SKILL)
|
||||||
{
|
{
|
||||||
std::cout << "Wrong Training Skill (abilities)" << std::endl;
|
std::cout << "Wrong Training Skill (abilities)" << std::endl;
|
||||||
DumpPacket(app);
|
DumpPacket(app);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SkillUseTypes skill = (SkillUseTypes) gmskill->skill_id;
|
EQEmu::skills::SkillType skill = (EQEmu::skills::SkillType)gmskill->skill_id;
|
||||||
|
|
||||||
if(!CanHaveSkill(skill)) {
|
if(!CanHaveSkill(skill)) {
|
||||||
Log.Out(Logs::Detail, Logs::Skills, "Tried to train skill %d, which is not allowed.", skill);
|
Log.Out(Logs::Detail, Logs::Skills, "Tried to train skill %d, which is not allowed.", skill);
|
||||||
@ -1610,27 +1610,27 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
|
|||||||
SetSkill(skill, t_level);
|
SetSkill(skill, t_level);
|
||||||
} else {
|
} else {
|
||||||
switch(skill) {
|
switch(skill) {
|
||||||
case SkillBrewing:
|
case EQEmu::skills::SkillBrewing:
|
||||||
case SkillMakePoison:
|
case EQEmu::skills::SkillMakePoison:
|
||||||
case SkillTinkering:
|
case EQEmu::skills::SkillTinkering:
|
||||||
case SkillResearch:
|
case EQEmu::skills::SkillResearch:
|
||||||
case SkillAlchemy:
|
case EQEmu::skills::SkillAlchemy:
|
||||||
case SkillBaking:
|
case EQEmu::skills::SkillBaking:
|
||||||
case SkillTailoring:
|
case EQEmu::skills::SkillTailoring:
|
||||||
case SkillBlacksmithing:
|
case EQEmu::skills::SkillBlacksmithing:
|
||||||
case SkillFletching:
|
case EQEmu::skills::SkillFletching:
|
||||||
case SkillJewelryMaking:
|
case EQEmu::skills::SkillJewelryMaking:
|
||||||
case SkillPottery:
|
case EQEmu::skills::SkillPottery:
|
||||||
if(skilllevel >= RuleI(Skills, MaxTrainTradeskills)) {
|
if(skilllevel >= RuleI(Skills, MaxTrainTradeskills)) {
|
||||||
Message_StringID(13, MORE_SKILLED_THAN_I, pTrainer->GetCleanName());
|
Message_StringID(13, MORE_SKILLED_THAN_I, pTrainer->GetCleanName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SkillSpecializeAbjure:
|
case EQEmu::skills::SkillSpecializeAbjure:
|
||||||
case SkillSpecializeAlteration:
|
case EQEmu::skills::SkillSpecializeAlteration:
|
||||||
case SkillSpecializeConjuration:
|
case EQEmu::skills::SkillSpecializeConjuration:
|
||||||
case SkillSpecializeDivination:
|
case EQEmu::skills::SkillSpecializeDivination:
|
||||||
case SkillSpecializeEvocation:
|
case EQEmu::skills::SkillSpecializeEvocation:
|
||||||
if(skilllevel >= RuleI(Skills, MaxTrainSpecializations)) {
|
if(skilllevel >= RuleI(Skills, MaxTrainSpecializations)) {
|
||||||
Message_StringID(13, MORE_SKILLED_THAN_I, pTrainer->GetCleanName());
|
Message_StringID(13, MORE_SKILLED_THAN_I, pTrainer->GetCleanName());
|
||||||
return;
|
return;
|
||||||
@ -1647,7 +1647,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gmskill->skill_id >= SkillSpecializeAbjure && gmskill->skill_id <= SkillSpecializeEvocation)
|
if (gmskill->skill_id >= EQEmu::skills::SkillSpecializeAbjure && gmskill->skill_id <= EQEmu::skills::SkillSpecializeEvocation)
|
||||||
{
|
{
|
||||||
int MaxSpecSkill = GetMaxSkillAfterSpecializationRules(skill, MaxSkillValue);
|
int MaxSpecSkill = GetMaxSkillAfterSpecializationRules(skill, MaxSkillValue);
|
||||||
if (skilllevel >= MaxSpecSkill)
|
if (skilllevel >= MaxSpecSkill)
|
||||||
@ -1685,7 +1685,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
|
|||||||
gmtsc->SkillID += 100;
|
gmtsc->SkillID += 100;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
gmtsc->NewSkill = (GetRawSkill((SkillUseTypes)gmtsc->SkillID) == 1);
|
gmtsc->NewSkill = (GetRawSkill((EQEmu::skills::SkillType)gmtsc->SkillID) == 1);
|
||||||
|
|
||||||
gmtsc->Cost = Cost;
|
gmtsc->Cost = Cost;
|
||||||
|
|
||||||
|
|||||||
@ -52,6 +52,7 @@
|
|||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
#include "../common/serverinfo.h"
|
#include "../common/serverinfo.h"
|
||||||
#include "../common/string_util.h"
|
#include "../common/string_util.h"
|
||||||
|
#include "../say_link.h"
|
||||||
#include "../common/eqemu_logsys.h"
|
#include "../common/eqemu_logsys.h"
|
||||||
|
|
||||||
|
|
||||||
@ -2129,7 +2130,7 @@ void command_showskills(Client *c, const Seperator *sep)
|
|||||||
t=c->GetTarget()->CastToClient();
|
t=c->GetTarget()->CastToClient();
|
||||||
|
|
||||||
c->Message(0, "Skills for %s", t->GetName());
|
c->Message(0, "Skills for %s", t->GetName());
|
||||||
for (SkillUseTypes i=Skill1HBlunt; i <= HIGHEST_SKILL; i=(SkillUseTypes)(i+1))
|
for (EQEmu::skills::SkillType i = EQEmu::skills::Skill1HBlunt; i <= EQEmu::skills::HIGHEST_SKILL; i = (EQEmu::skills::SkillType)(i + 1))
|
||||||
c->Message(0, "Skill [%d] is at [%d] - %u", i, t->GetSkill(i), t->GetRawSkill(i));
|
c->Message(0, "Skill [%d] is at [%d] - %u", i, t->GetSkill(i), t->GetRawSkill(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2277,20 +2278,20 @@ void command_setskill(Client *c, const Seperator *sep)
|
|||||||
c->Message(0, "Error: #setskill: Target must be a client.");
|
c->Message(0, "Error: #setskill: Target must be a client.");
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
!sep->IsNumber(1) || atoi(sep->arg[1]) < 0 || atoi(sep->arg[1]) > HIGHEST_SKILL ||
|
!sep->IsNumber(1) || atoi(sep->arg[1]) < 0 || atoi(sep->arg[1]) > EQEmu::skills::HIGHEST_SKILL ||
|
||||||
!sep->IsNumber(2) || atoi(sep->arg[2]) < 0 || atoi(sep->arg[2]) > HIGHEST_CAN_SET_SKILL
|
!sep->IsNumber(2) || atoi(sep->arg[2]) < 0 || atoi(sep->arg[2]) > HIGHEST_CAN_SET_SKILL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
c->Message(0, "Usage: #setskill skill x ");
|
c->Message(0, "Usage: #setskill skill x ");
|
||||||
c->Message(0, " skill = 0 to %d", HIGHEST_SKILL);
|
c->Message(0, " skill = 0 to %d", EQEmu::skills::HIGHEST_SKILL);
|
||||||
c->Message(0, " x = 0 to %d", HIGHEST_CAN_SET_SKILL);
|
c->Message(0, " x = 0 to %d", HIGHEST_CAN_SET_SKILL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Log.Out(Logs::General, Logs::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) );
|
Log.Out(Logs::General, Logs::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) );
|
||||||
int skill_num = atoi(sep->arg[1]);
|
int skill_num = atoi(sep->arg[1]);
|
||||||
uint16 skill_value = atoi(sep->arg[2]);
|
uint16 skill_value = atoi(sep->arg[2]);
|
||||||
if(skill_num <= HIGHEST_SKILL)
|
if (skill_num <= EQEmu::skills::HIGHEST_SKILL)
|
||||||
c->GetTarget()->CastToClient()->SetSkill((SkillUseTypes)skill_num, skill_value);
|
c->GetTarget()->CastToClient()->SetSkill((EQEmu::skills::SkillType)skill_num, skill_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2308,7 +2309,7 @@ void command_setskillall(Client *c, const Seperator *sep)
|
|||||||
if (c->Admin() >= commandSetSkillsOther || c->GetTarget()==c || c->GetTarget()==0) {
|
if (c->Admin() >= commandSetSkillsOther || c->GetTarget()==c || c->GetTarget()==0) {
|
||||||
Log.Out(Logs::General, Logs::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName());
|
Log.Out(Logs::General, Logs::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName());
|
||||||
uint16 level = atoi(sep->arg[1]);
|
uint16 level = atoi(sep->arg[1]);
|
||||||
for(SkillUseTypes skill_num=Skill1HBlunt;skill_num <= HIGHEST_SKILL;skill_num=(SkillUseTypes)(skill_num+1)) {
|
for (EQEmu::skills::SkillType skill_num = EQEmu::skills::Skill1HBlunt; skill_num <= EQEmu::skills::HIGHEST_SKILL; skill_num = (EQEmu::skills::SkillType)(skill_num + 1)) {
|
||||||
c->GetTarget()->CastToClient()->SetSkill(skill_num, level);
|
c->GetTarget()->CastToClient()->SetSkill(skill_num, level);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4197,7 +4198,7 @@ void command_damage(Client *c, const Seperator *sep)
|
|||||||
if (nkdmg > 2100000000)
|
if (nkdmg > 2100000000)
|
||||||
c->Message(0, "Enter a value less then 2,100,000,000.");
|
c->Message(0, "Enter a value less then 2,100,000,000.");
|
||||||
else
|
else
|
||||||
c->GetTarget()->Damage(c, nkdmg, SPELL_UNKNOWN, SkillHandtoHand, false);
|
c->GetTarget()->Damage(c, nkdmg, SPELL_UNKNOWN, EQEmu::skills::SkillHandtoHand, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9942,16 +9943,16 @@ void command_max_all_skills(Client *c, const Seperator *sep)
|
|||||||
{
|
{
|
||||||
if(c)
|
if(c)
|
||||||
{
|
{
|
||||||
for(int i = 0; i <= HIGHEST_SKILL; ++i)
|
for (int i = 0; i <= EQEmu::skills::HIGHEST_SKILL; ++i)
|
||||||
{
|
{
|
||||||
if(i >= SkillSpecializeAbjure && i <= SkillSpecializeEvocation)
|
if (i >= EQEmu::skills::SkillSpecializeAbjure && i <= EQEmu::skills::SkillSpecializeEvocation)
|
||||||
{
|
{
|
||||||
c->SetSkill((SkillUseTypes)i, 50);
|
c->SetSkill((EQEmu::skills::SkillType)i, 50);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int max_skill_level = database.GetSkillCap(c->GetClass(), (SkillUseTypes)i, c->GetLevel());
|
int max_skill_level = database.GetSkillCap(c->GetClass(), (EQEmu::skills::SkillType)i, c->GetLevel());
|
||||||
c->SetSkill((SkillUseTypes)i, max_skill_level);
|
c->SetSkill((EQEmu::skills::SkillType)i, max_skill_level);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10037,14 +10038,14 @@ void command_disarmtrap(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
if(target->IsNPC())
|
if(target->IsNPC())
|
||||||
{
|
{
|
||||||
if(c->HasSkill(SkillDisarmTraps))
|
if (c->HasSkill(EQEmu::skills::SkillDisarmTraps))
|
||||||
{
|
{
|
||||||
if(DistanceSquaredNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
if(DistanceSquaredNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||||
{
|
{
|
||||||
c->Message(13, "%s is too far away.", target->GetCleanName());
|
c->Message(13, "%s is too far away.", target->GetCleanName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
c->HandleLDoNDisarm(target->CastToNPC(), c->GetSkill(SkillDisarmTraps), LDoNTypeMechanical);
|
c->HandleLDoNDisarm(target->CastToNPC(), c->GetSkill(EQEmu::skills::SkillDisarmTraps), LDoNTypeMechanical);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
c->Message(13, "You do not have the disarm trap skill.");
|
c->Message(13, "You do not have the disarm trap skill.");
|
||||||
@ -10062,14 +10063,14 @@ void command_sensetrap(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
if(target->IsNPC())
|
if(target->IsNPC())
|
||||||
{
|
{
|
||||||
if(c->HasSkill(SkillSenseTraps))
|
if (c->HasSkill(EQEmu::skills::SkillSenseTraps))
|
||||||
{
|
{
|
||||||
if(DistanceSquaredNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
if(DistanceSquaredNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||||
{
|
{
|
||||||
c->Message(13, "%s is too far away.", target->GetCleanName());
|
c->Message(13, "%s is too far away.", target->GetCleanName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
c->HandleLDoNSenseTraps(target->CastToNPC(), c->GetSkill(SkillSenseTraps), LDoNTypeMechanical);
|
c->HandleLDoNSenseTraps(target->CastToNPC(), c->GetSkill(EQEmu::skills::SkillSenseTraps), LDoNTypeMechanical);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
c->Message(13, "You do not have the sense traps skill.");
|
c->Message(13, "You do not have the sense traps skill.");
|
||||||
@ -10087,14 +10088,14 @@ void command_picklock(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
if(target->IsNPC())
|
if(target->IsNPC())
|
||||||
{
|
{
|
||||||
if(c->HasSkill(SkillPickLock))
|
if (c->HasSkill(EQEmu::skills::SkillPickLock))
|
||||||
{
|
{
|
||||||
if(DistanceSquaredNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
if(DistanceSquaredNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||||
{
|
{
|
||||||
c->Message(13, "%s is too far away.", target->GetCleanName());
|
c->Message(13, "%s is too far away.", target->GetCleanName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
c->HandleLDoNPickLock(target->CastToNPC(), c->GetSkill(SkillPickLock), LDoNTypeMechanical);
|
c->HandleLDoNPickLock(target->CastToNPC(), c->GetSkill(EQEmu::skills::SkillPickLock), LDoNTypeMechanical);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
c->Message(13, "You do not have the pick locks skill.");
|
c->Message(13, "You do not have the pick locks skill.");
|
||||||
|
|||||||
@ -277,8 +277,8 @@ struct StatBonuses {
|
|||||||
int32 inhibitmelee;
|
int32 inhibitmelee;
|
||||||
float AggroRange; // when calculate just replace original value with this
|
float AggroRange; // when calculate just replace original value with this
|
||||||
float AssistRange;
|
float AssistRange;
|
||||||
int32 skillmod[HIGHEST_SKILL+1];
|
int32 skillmod[EQEmu::skills::HIGHEST_SKILL + 1];
|
||||||
int32 skillmodmax[HIGHEST_SKILL+1];
|
int32 skillmodmax[EQEmu::skills::HIGHEST_SKILL + 1];
|
||||||
int effective_casting_level;
|
int effective_casting_level;
|
||||||
int reflect_chance; // chance to reflect incoming spell
|
int reflect_chance; // chance to reflect incoming spell
|
||||||
uint32 singingMod;
|
uint32 singingMod;
|
||||||
@ -294,7 +294,7 @@ struct StatBonuses {
|
|||||||
int32 StrikeThrough; // PoP: Strike Through %
|
int32 StrikeThrough; // PoP: Strike Through %
|
||||||
int32 MeleeMitigation; //i = Shielding
|
int32 MeleeMitigation; //i = Shielding
|
||||||
int32 MeleeMitigationEffect; //i = Spell Effect Melee Mitigation
|
int32 MeleeMitigationEffect; //i = Spell Effect Melee Mitigation
|
||||||
int32 CriticalHitChance[HIGHEST_SKILL+2]; //i
|
int32 CriticalHitChance[EQEmu::skills::HIGHEST_SKILL + 2]; //i
|
||||||
int32 CriticalSpellChance; //i
|
int32 CriticalSpellChance; //i
|
||||||
int32 SpellCritDmgIncrease; //i
|
int32 SpellCritDmgIncrease; //i
|
||||||
int32 SpellCritDmgIncNoStack; // increase
|
int32 SpellCritDmgIncNoStack; // increase
|
||||||
@ -321,10 +321,10 @@ struct StatBonuses {
|
|||||||
int32 MeleeSkillCheck; //i
|
int32 MeleeSkillCheck; //i
|
||||||
uint8 MeleeSkillCheckSkill;
|
uint8 MeleeSkillCheckSkill;
|
||||||
int32 HitChance; //HitChance/15 == % increase i = Accuracy (Item: Accuracy)
|
int32 HitChance; //HitChance/15 == % increase i = Accuracy (Item: Accuracy)
|
||||||
int32 HitChanceEffect[HIGHEST_SKILL+2]; //Spell effect Chance to Hit, straight percent increase
|
int32 HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 2]; //Spell effect Chance to Hit, straight percent increase
|
||||||
int32 DamageModifier[HIGHEST_SKILL+2]; //i
|
int32 DamageModifier[EQEmu::skills::HIGHEST_SKILL + 2]; //i
|
||||||
int32 DamageModifier2[HIGHEST_SKILL+2]; //i
|
int32 DamageModifier2[EQEmu::skills::HIGHEST_SKILL + 2]; //i
|
||||||
int32 MinDamageModifier[HIGHEST_SKILL+2]; //i
|
int32 MinDamageModifier[EQEmu::skills::HIGHEST_SKILL + 2]; //i
|
||||||
int32 ProcChance; // ProcChance/10 == % increase i = CombatEffects
|
int32 ProcChance; // ProcChance/10 == % increase i = CombatEffects
|
||||||
int32 ProcChanceSPA; // ProcChance from spell effects
|
int32 ProcChanceSPA; // ProcChance from spell effects
|
||||||
int32 ExtraAttackChance;
|
int32 ExtraAttackChance;
|
||||||
@ -332,13 +332,13 @@ struct StatBonuses {
|
|||||||
int32 DivineSaveChance[2]; // Second Chance (base1 = chance, base2 = spell on trigger)
|
int32 DivineSaveChance[2]; // Second Chance (base1 = chance, base2 = spell on trigger)
|
||||||
uint32 DeathSave[4]; // Death Pact [0](value = 1 partial 2 = full) [1]=slot [2]=LvLimit [3]=HealAmt
|
uint32 DeathSave[4]; // Death Pact [0](value = 1 partial 2 = full) [1]=slot [2]=LvLimit [3]=HealAmt
|
||||||
int32 FlurryChance;
|
int32 FlurryChance;
|
||||||
int32 Accuracy[HIGHEST_SKILL+2]; //Accuracy/15 == % increase [Spell Effect: Accuracy)
|
int32 Accuracy[EQEmu::skills::HIGHEST_SKILL + 2]; //Accuracy/15 == % increase [Spell Effect: Accuracy)
|
||||||
int32 HundredHands; //extra haste, stacks with all other haste i
|
int32 HundredHands; //extra haste, stacks with all other haste i
|
||||||
int32 MeleeLifetap; //i
|
int32 MeleeLifetap; //i
|
||||||
int32 Vampirism; //i
|
int32 Vampirism; //i
|
||||||
int32 HealRate; // Spell effect that influences effectiveness of heals
|
int32 HealRate; // Spell effect that influences effectiveness of heals
|
||||||
int32 MaxHPChange; // Spell Effect
|
int32 MaxHPChange; // Spell Effect
|
||||||
int16 SkillDmgTaken[HIGHEST_SKILL+2]; // All Skills + -1
|
int16 SkillDmgTaken[EQEmu::skills::HIGHEST_SKILL + 2]; // All Skills + -1
|
||||||
int32 HealAmt; // Item Effect
|
int32 HealAmt; // Item Effect
|
||||||
int32 SpellDmg; // Item Effect
|
int32 SpellDmg; // Item Effect
|
||||||
int32 Clairvoyance; // Item Effect
|
int32 Clairvoyance; // Item Effect
|
||||||
@ -347,9 +347,9 @@ struct StatBonuses {
|
|||||||
uint32 SpellTriggers[MAX_SPELL_TRIGGER]; // Innate/Spell/Item Spells that trigger when you cast
|
uint32 SpellTriggers[MAX_SPELL_TRIGGER]; // Innate/Spell/Item Spells that trigger when you cast
|
||||||
uint32 SpellOnKill[MAX_SPELL_TRIGGER*3]; // Chance to proc after killing a mob
|
uint32 SpellOnKill[MAX_SPELL_TRIGGER*3]; // Chance to proc after killing a mob
|
||||||
uint32 SpellOnDeath[MAX_SPELL_TRIGGER*2]; // Chance to have effect cast when you die
|
uint32 SpellOnDeath[MAX_SPELL_TRIGGER*2]; // Chance to have effect cast when you die
|
||||||
int32 CritDmgMob[HIGHEST_SKILL+2]; // All Skills + -1
|
int32 CritDmgMob[EQEmu::skills::HIGHEST_SKILL + 2]; // All Skills + -1
|
||||||
int32 SkillReuseTime[HIGHEST_SKILL+1]; // Reduces skill timers
|
int32 SkillReuseTime[EQEmu::skills::HIGHEST_SKILL + 1]; // Reduces skill timers
|
||||||
int32 SkillDamageAmount[HIGHEST_SKILL+2]; // All Skills + -1
|
int32 SkillDamageAmount[EQEmu::skills::HIGHEST_SKILL + 2]; // All Skills + -1
|
||||||
int32 TwoHandBluntBlock; // chance to block when wielding two hand blunt weapon
|
int32 TwoHandBluntBlock; // chance to block when wielding two hand blunt weapon
|
||||||
uint32 ItemManaRegenCap; // Increases the amount of mana you have can over the cap(aa effect)
|
uint32 ItemManaRegenCap; // Increases the amount of mana you have can over the cap(aa effect)
|
||||||
int32 GravityEffect; // Indictor of spell effect
|
int32 GravityEffect; // Indictor of spell effect
|
||||||
@ -372,7 +372,7 @@ struct StatBonuses {
|
|||||||
uint8 FocusEffects[HIGHEST_FOCUS+1]; // Stores the focus effectid for each focustype you have.
|
uint8 FocusEffects[HIGHEST_FOCUS+1]; // Stores the focus effectid for each focustype you have.
|
||||||
int16 FocusEffectsWorn[HIGHEST_FOCUS+1]; // Optional to allow focus effects to be applied additively from worn slot
|
int16 FocusEffectsWorn[HIGHEST_FOCUS+1]; // Optional to allow focus effects to be applied additively from worn slot
|
||||||
bool NegateEffects; // Check if you contain a buff with negate effect. (only spellbonuses)
|
bool NegateEffects; // Check if you contain a buff with negate effect. (only spellbonuses)
|
||||||
int32 SkillDamageAmount2[HIGHEST_SKILL+2]; // Adds skill specific damage
|
int32 SkillDamageAmount2[EQEmu::skills::HIGHEST_SKILL + 2]; // Adds skill specific damage
|
||||||
uint32 NegateAttacks[3]; // 0 = bool HasEffect 1 = Buff Slot 2 = Max damage absorbed per hit
|
uint32 NegateAttacks[3]; // 0 = bool HasEffect 1 = Buff Slot 2 = Max damage absorbed per hit
|
||||||
uint32 MitigateMeleeRune[4]; // 0 = Mitigation value 1 = Buff Slot 2 = Max mitigation per hit 3 = Rune Amt
|
uint32 MitigateMeleeRune[4]; // 0 = Mitigation value 1 = Buff Slot 2 = Max mitigation per hit 3 = Rune Amt
|
||||||
uint32 MeleeThresholdGuard[3]; // 0 = Mitigation value 1 = Buff Slot 2 = Min damage to trigger.
|
uint32 MeleeThresholdGuard[3]; // 0 = Mitigation value 1 = Buff Slot 2 = Min damage to trigger.
|
||||||
@ -405,7 +405,7 @@ struct StatBonuses {
|
|||||||
int32 Metabolism; // Food/drink consumption rates.
|
int32 Metabolism; // Food/drink consumption rates.
|
||||||
bool Sanctuary; // Sanctuary effect, lowers place on hate list until cast on others.
|
bool Sanctuary; // Sanctuary effect, lowers place on hate list until cast on others.
|
||||||
int32 FactionModPct; // Modifies amount of faction gained.
|
int32 FactionModPct; // Modifies amount of faction gained.
|
||||||
bool LimitToSkill[HIGHEST_SKILL+2]; // Determines if we need to search for a skill proc.
|
bool LimitToSkill[EQEmu::skills::HIGHEST_SKILL + 2]; // Determines if we need to search for a skill proc.
|
||||||
uint32 SkillProc[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs.
|
uint32 SkillProc[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs.
|
||||||
uint32 SkillProcSuccess[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs_success.
|
uint32 SkillProcSuccess[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs_success.
|
||||||
uint32 PC_Pet_Rampage[2]; // 0= % chance to rampage, 1=damage modifier
|
uint32 PC_Pet_Rampage[2]; // 0= % chance to rampage, 1=damage modifier
|
||||||
@ -440,7 +440,7 @@ struct StatBonuses {
|
|||||||
int32 CombatStability; // Melee damage mitigation.
|
int32 CombatStability; // Melee damage mitigation.
|
||||||
int32 DoubleRiposte; // Chance to double riposte
|
int32 DoubleRiposte; // Chance to double riposte
|
||||||
int32 GiveDoubleRiposte[3]; // 0=Regular Chance, 1=Skill Attack Chance, 2=Skill
|
int32 GiveDoubleRiposte[3]; // 0=Regular Chance, 1=Skill Attack Chance, 2=Skill
|
||||||
uint32 RaiseSkillCap[HIGHEST_SKILL+1]; // Raise a specific skill cap (base1= value, base2=skill)
|
uint32 RaiseSkillCap[EQEmu::skills::HIGHEST_SKILL + 1]; // Raise a specific skill cap (base1= value, base2=skill)
|
||||||
int32 Ambidexterity; // Increase chance to duel wield by adding bonus 'skill'.
|
int32 Ambidexterity; // Increase chance to duel wield by adding bonus 'skill'.
|
||||||
int32 PetMaxHP; // Increase the max hp of your pet.
|
int32 PetMaxHP; // Increase the max hp of your pet.
|
||||||
int32 PetFlurry; // Chance for pet to flurry.
|
int32 PetFlurry; // Chance for pet to flurry.
|
||||||
@ -470,7 +470,7 @@ struct StatBonuses {
|
|||||||
uint16 extra_xtargets; // extra xtarget entries
|
uint16 extra_xtargets; // extra xtarget entries
|
||||||
bool ShroudofStealth; // rogue improved invisiblity
|
bool ShroudofStealth; // rogue improved invisiblity
|
||||||
uint16 ReduceFallDamage; // reduce fall damage by percent
|
uint16 ReduceFallDamage; // reduce fall damage by percent
|
||||||
int32 ReduceTradeskillFail[HIGHEST_SKILL+1]; // Reduces chance for trade skills to fail by percent.
|
int32 ReduceTradeskillFail[EQEmu::skills::HIGHEST_SKILL + 1]; // Reduces chance for trade skills to fail by percent.
|
||||||
uint8 TradeSkillMastery; // Allow number of tradeskills to exceed 200 skill.
|
uint8 TradeSkillMastery; // Allow number of tradeskills to exceed 200 skill.
|
||||||
int16 NoBreakAESneak; // Percent value
|
int16 NoBreakAESneak; // Percent value
|
||||||
int16 FeignedCastOnChance; // Percent Value
|
int16 FeignedCastOnChance; // Percent Value
|
||||||
|
|||||||
@ -34,6 +34,7 @@ Child of the Mob class.
|
|||||||
#include "../common/eqemu_logsys.h"
|
#include "../common/eqemu_logsys.h"
|
||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
#include "../common/string_util.h"
|
#include "../common/string_util.h"
|
||||||
|
#include "../common/say_link.h"
|
||||||
|
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "corpse.h"
|
#include "corpse.h"
|
||||||
@ -997,7 +998,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
|
|||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
|
|
||||||
int corpselootlimit = EQEmu::limits::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(client->ClientVersion()), EQEmu::legacy::TypeCorpse);
|
int corpselootlimit = EQEmu::inventory::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(client->ClientVersion()), EQEmu::legacy::TypeCorpse);
|
||||||
|
|
||||||
for(; cur != end; ++cur) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* item_data = *cur;
|
ServerLootItem_Struct* item_data = *cur;
|
||||||
@ -1291,7 +1292,7 @@ void Corpse::QueryLoot(Client* to) {
|
|||||||
cur = itemlist.begin();
|
cur = itemlist.begin();
|
||||||
end = itemlist.end();
|
end = itemlist.end();
|
||||||
|
|
||||||
int corpselootlimit = EQEmu::limits::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(to->ClientVersion()), EQEmu::legacy::TypeCorpse);
|
int corpselootlimit = EQEmu::inventory::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(to->ClientVersion()), EQEmu::legacy::TypeCorpse);
|
||||||
|
|
||||||
for(; cur != end; ++cur) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* sitem = *cur;
|
ServerLootItem_Struct* sitem = *cur;
|
||||||
|
|||||||
@ -47,8 +47,8 @@ class Corpse : public Mob {
|
|||||||
static Corpse* LoadCharacterCorpseEntity(uint32 in_dbid, uint32 in_charid, std::string in_charname, const glm::vec4& position, std::string time_of_death, bool rezzed, bool was_at_graveyard);
|
static Corpse* LoadCharacterCorpseEntity(uint32 in_dbid, uint32 in_charid, std::string in_charname, const glm::vec4& position, std::string time_of_death, bool rezzed, bool was_at_graveyard);
|
||||||
|
|
||||||
/* Corpse: General */
|
/* Corpse: General */
|
||||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) { return true; }
|
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType 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, int special = 0) { return; }
|
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0) { return; }
|
||||||
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) { return false; }
|
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0) { return false; }
|
||||||
virtual bool HasRaid() { return false; }
|
virtual bool HasRaid() { return false; }
|
||||||
virtual bool HasGroup() { return false; }
|
virtual bool HasGroup() { return false; }
|
||||||
|
|||||||
@ -284,12 +284,12 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
|||||||
}
|
}
|
||||||
else if(lockpicks != nullptr)
|
else if(lockpicks != nullptr)
|
||||||
{
|
{
|
||||||
if(sender->GetSkill(SkillPickLock))
|
if (sender->GetSkill(EQEmu::skills::SkillPickLock))
|
||||||
{
|
{
|
||||||
if(lockpicks->GetItem()->ItemType == EQEmu::item::ItemTypeLockPick)
|
if(lockpicks->GetItem()->ItemType == EQEmu::item::ItemTypeLockPick)
|
||||||
{
|
{
|
||||||
float modskill=sender->GetSkill(SkillPickLock);
|
float modskill = sender->GetSkill(EQEmu::skills::SkillPickLock);
|
||||||
sender->CheckIncreaseSkill(SkillPickLock, nullptr, 1);
|
sender->CheckIncreaseSkill(EQEmu::skills::SkillPickLock, nullptr, 1);
|
||||||
|
|
||||||
Log.Out(Logs::General, Logs::Skills, "Client has lockpicks: skill=%f", modskill);
|
Log.Out(Logs::General, Logs::Skills, "Client has lockpicks: skill=%f", modskill);
|
||||||
|
|
||||||
|
|||||||
@ -34,8 +34,8 @@ public:
|
|||||||
~Encounter();
|
~Encounter();
|
||||||
|
|
||||||
//abstract virtual function implementations required by base abstract class
|
//abstract virtual function implementations required by base abstract class
|
||||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) { return true; }
|
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType 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, int special = 0) { return; }
|
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0) { return; }
|
||||||
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||||
ExtraAttackOptions *opts = nullptr, int special = 0) {
|
ExtraAttackOptions *opts = nullptr, int special = 0) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -3008,11 +3008,11 @@ bool EntityList::MakeTrackPacket(Client *client)
|
|||||||
float MobDistance;
|
float MobDistance;
|
||||||
|
|
||||||
if (client->GetClass() == DRUID)
|
if (client->GetClass() == DRUID)
|
||||||
distance = (client->GetSkill(SkillTracking) * 10);
|
distance = (client->GetSkill(EQEmu::skills::SkillTracking) * 10);
|
||||||
else if (client->GetClass() == RANGER)
|
else if (client->GetClass() == RANGER)
|
||||||
distance = (client->GetSkill(SkillTracking) * 12);
|
distance = (client->GetSkill(EQEmu::skills::SkillTracking) * 12);
|
||||||
else if (client->GetClass() == BARD)
|
else if (client->GetClass() == BARD)
|
||||||
distance = (client->GetSkill(SkillTracking) * 7);
|
distance = (client->GetSkill(EQEmu::skills::SkillTracking) * 7);
|
||||||
if (distance <= 0)
|
if (distance <= 0)
|
||||||
return false;
|
return false;
|
||||||
if (distance < 300)
|
if (distance < 300)
|
||||||
|
|||||||
@ -249,7 +249,7 @@ void Client::GoFish()
|
|||||||
|
|
||||||
//success formula is not researched at all
|
//success formula is not researched at all
|
||||||
|
|
||||||
int fishing_skill = GetSkill(SkillFishing); //will take into account skill bonuses on pole & bait
|
int fishing_skill = GetSkill(EQEmu::skills::SkillFishing); //will take into account skill bonuses on pole & bait
|
||||||
|
|
||||||
//make sure we still have a fishing pole on:
|
//make sure we still have a fishing pole on:
|
||||||
int32 bslot = m_inv.HasItemByUse(EQEmu::item::ItemTypeFishingBait, 1, invWhereWorn | invWherePersonal);
|
int32 bslot = m_inv.HasItemByUse(EQEmu::item::ItemTypeFishingBait, 1, invWhereWorn | invWherePersonal);
|
||||||
@ -258,7 +258,7 @@ void Client::GoFish()
|
|||||||
Bait = m_inv.GetItem(bslot);
|
Bait = m_inv.GetItem(bslot);
|
||||||
|
|
||||||
//if the bait isnt equipped, need to add its skill bonus
|
//if the bait isnt equipped, need to add its skill bonus
|
||||||
if (bslot >= EQEmu::legacy::GENERAL_BEGIN && Bait != nullptr && Bait->GetItem()->SkillModType == SkillFishing) {
|
if (bslot >= EQEmu::legacy::GENERAL_BEGIN && Bait != nullptr && Bait->GetItem()->SkillModType == EQEmu::skills::SkillFishing) {
|
||||||
fishing_skill += Bait->GetItem()->SkillModValue;
|
fishing_skill += Bait->GetItem()->SkillModValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,16 +357,16 @@ void Client::GoFish()
|
|||||||
DeleteItemInInventory(EQEmu::legacy::SlotPrimary, 0, true);
|
DeleteItemInInventory(EQEmu::legacy::SlotPrimary, 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(CheckIncreaseSkill(SkillFishing, nullptr, 5))
|
if (CheckIncreaseSkill(EQEmu::skills::SkillFishing, nullptr, 5))
|
||||||
{
|
{
|
||||||
if(title_manager.IsNewTradeSkillTitleAvailable(SkillFishing, GetRawSkill(SkillFishing)))
|
if (title_manager.IsNewTradeSkillTitleAvailable(EQEmu::skills::SkillFishing, GetRawSkill(EQEmu::skills::SkillFishing)))
|
||||||
NotifyNewTitlesAvailable();
|
NotifyNewTitlesAvailable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::ForageItem(bool guarantee) {
|
void Client::ForageItem(bool guarantee) {
|
||||||
|
|
||||||
int skill_level = GetSkill(SkillForage);
|
int skill_level = GetSkill(EQEmu::skills::SkillForage);
|
||||||
|
|
||||||
//be wary of the string ids in switch below when changing this.
|
//be wary of the string ids in switch below when changing this.
|
||||||
uint32 common_food_ids[MAX_COMMON_FOOD_IDS] = {
|
uint32 common_food_ids[MAX_COMMON_FOOD_IDS] = {
|
||||||
@ -457,7 +457,7 @@ void Client::ForageItem(bool guarantee) {
|
|||||||
parse->EventPlayer(EVENT_FORAGE_FAILURE, this, "", 0);
|
parse->EventPlayer(EVENT_FORAGE_FAILURE, this, "", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckIncreaseSkill(SkillForage, nullptr, 5);
|
CheckIncreaseSkill(EQEmu::skills::SkillForage, nullptr, 5);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -432,27 +432,27 @@ void Lua_Client::IncreaseLanguageSkill(int skill_id, int value) {
|
|||||||
|
|
||||||
int Lua_Client::GetRawSkill(int skill_id) {
|
int Lua_Client::GetRawSkill(int skill_id) {
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return self->GetRawSkill(static_cast<SkillUseTypes>(skill_id));
|
return self->GetRawSkill(static_cast<EQEmu::skills::SkillType>(skill_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lua_Client::HasSkill(int skill_id) {
|
bool Lua_Client::HasSkill(int skill_id) {
|
||||||
Lua_Safe_Call_Bool();
|
Lua_Safe_Call_Bool();
|
||||||
return self->HasSkill(static_cast<SkillUseTypes>(skill_id));
|
return self->HasSkill(static_cast<EQEmu::skills::SkillType>(skill_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lua_Client::CanHaveSkill(int skill_id) {
|
bool Lua_Client::CanHaveSkill(int skill_id) {
|
||||||
Lua_Safe_Call_Bool();
|
Lua_Safe_Call_Bool();
|
||||||
return self->CanHaveSkill(static_cast<SkillUseTypes>(skill_id));
|
return self->CanHaveSkill(static_cast<EQEmu::skills::SkillType>(skill_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Client::SetSkill(int skill_id, int value) {
|
void Lua_Client::SetSkill(int skill_id, int value) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->SetSkill(static_cast<SkillUseTypes>(skill_id), value);
|
self->SetSkill(static_cast<EQEmu::skills::SkillType>(skill_id), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Client::AddSkill(int skill_id, int value) {
|
void Lua_Client::AddSkill(int skill_id, int value) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->AddSkill(static_cast<SkillUseTypes>(skill_id), value);
|
self->AddSkill(static_cast<EQEmu::skills::SkillType>(skill_id), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Client::CheckSpecializeIncrease(int spell_id) {
|
void Lua_Client::CheckSpecializeIncrease(int spell_id) {
|
||||||
@ -462,12 +462,12 @@ void Lua_Client::CheckSpecializeIncrease(int spell_id) {
|
|||||||
|
|
||||||
void Lua_Client::CheckIncreaseSkill(int skill_id, Lua_Mob target) {
|
void Lua_Client::CheckIncreaseSkill(int skill_id, Lua_Mob target) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->CheckIncreaseSkill(static_cast<SkillUseTypes>(skill_id), target);
|
self->CheckIncreaseSkill(static_cast<EQEmu::skills::SkillType>(skill_id), target);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Client::CheckIncreaseSkill(int skill_id, Lua_Mob target, int chance_mod) {
|
void Lua_Client::CheckIncreaseSkill(int skill_id, Lua_Mob target, int chance_mod) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->CheckIncreaseSkill(static_cast<SkillUseTypes>(skill_id), target, chance_mod);
|
self->CheckIncreaseSkill(static_cast<EQEmu::skills::SkillType>(skill_id), target, chance_mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Client::SetLanguageSkill(int language, int value) {
|
void Lua_Client::SetLanguageSkill(int language, int value) {
|
||||||
@ -477,7 +477,7 @@ void Lua_Client::SetLanguageSkill(int language, int value) {
|
|||||||
|
|
||||||
int Lua_Client::MaxSkill(int skill_id) {
|
int Lua_Client::MaxSkill(int skill_id) {
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return self->MaxSkill(static_cast<SkillUseTypes>(skill_id));
|
return self->MaxSkill(static_cast<EQEmu::skills::SkillType>(skill_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lua_Client::IsMedding() {
|
bool Lua_Client::IsMedding() {
|
||||||
|
|||||||
@ -178,22 +178,22 @@ bool Lua_Mob::Attack(Lua_Mob other, int hand, bool from_riposte, bool is_striket
|
|||||||
|
|
||||||
void Lua_Mob::Damage(Lua_Mob from, int damage, int spell_id, int attack_skill) {
|
void Lua_Mob::Damage(Lua_Mob from, int damage, int spell_id, int attack_skill) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
return self->Damage(from, damage, spell_id, static_cast<SkillUseTypes>(attack_skill));
|
return self->Damage(from, damage, spell_id, static_cast<EQEmu::skills::SkillType>(attack_skill));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Mob::Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable) {
|
void Lua_Mob::Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
return self->Damage(from, damage, spell_id, static_cast<SkillUseTypes>(attack_skill), avoidable);
|
return self->Damage(from, damage, spell_id, static_cast<EQEmu::skills::SkillType>(attack_skill), avoidable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Mob::Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable, int buffslot) {
|
void Lua_Mob::Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable, int buffslot) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
return self->Damage(from, damage, spell_id, static_cast<SkillUseTypes>(attack_skill), avoidable, buffslot);
|
return self->Damage(from, damage, spell_id, static_cast<EQEmu::skills::SkillType>(attack_skill), avoidable, buffslot);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Mob::Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable, int buffslot, bool buff_tic) {
|
void Lua_Mob::Damage(Lua_Mob from, int damage, int spell_id, int attack_skill, bool avoidable, int buffslot, bool buff_tic) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
return self->Damage(from, damage, spell_id, static_cast<SkillUseTypes>(attack_skill), avoidable, buffslot, buff_tic);
|
return self->Damage(from, damage, spell_id, static_cast<EQEmu::skills::SkillType>(attack_skill), avoidable, buffslot, buff_tic);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Mob::RangedAttack(Lua_Mob other) {
|
void Lua_Mob::RangedAttack(Lua_Mob other) {
|
||||||
@ -1252,28 +1252,28 @@ bool Lua_Mob::CombatRange(Lua_Mob other) {
|
|||||||
|
|
||||||
void Lua_Mob::DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage) {
|
void Lua_Mob::DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->DoSpecialAttackDamage(other, static_cast<SkillUseTypes>(skill), max_damage);
|
self->DoSpecialAttackDamage(other, static_cast<EQEmu::skills::SkillType>(skill), max_damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Mob::DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage) {
|
void Lua_Mob::DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->DoSpecialAttackDamage(other, static_cast<SkillUseTypes>(skill), max_damage, min_damage);
|
self->DoSpecialAttackDamage(other, static_cast<EQEmu::skills::SkillType>(skill), max_damage, min_damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Mob::DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage, int hate_override) {
|
void Lua_Mob::DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage, int hate_override) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->DoSpecialAttackDamage(other, static_cast<SkillUseTypes>(skill), max_damage, min_damage, hate_override);
|
self->DoSpecialAttackDamage(other, static_cast<EQEmu::skills::SkillType>(skill), max_damage, min_damage, hate_override);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Mob::DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage, int hate_override, int reuse_time) {
|
void Lua_Mob::DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage, int hate_override, int reuse_time) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->DoSpecialAttackDamage(other, static_cast<SkillUseTypes>(skill), max_damage, min_damage, hate_override, reuse_time);
|
self->DoSpecialAttackDamage(other, static_cast<EQEmu::skills::SkillType>(skill), max_damage, min_damage, hate_override, reuse_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Mob::DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage, int hate_override, int reuse_time,
|
void Lua_Mob::DoSpecialAttackDamage(Lua_Mob other, int skill, int max_damage, int min_damage, int hate_override, int reuse_time,
|
||||||
bool hit_chance) {
|
bool hit_chance) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->DoSpecialAttackDamage(other, static_cast<SkillUseTypes>(skill), max_damage, min_damage, hate_override, reuse_time, hit_chance);
|
self->DoSpecialAttackDamage(other, static_cast<EQEmu::skills::SkillType>(skill), max_damage, min_damage, hate_override, reuse_time, hit_chance);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Mob::DoThrowingAttackDmg(Lua_Mob other) {
|
void Lua_Mob::DoThrowingAttackDmg(Lua_Mob other) {
|
||||||
@ -1309,22 +1309,22 @@ void Lua_Mob::DoThrowingAttackDmg(Lua_Mob other, Lua_ItemInst range_weapon, Lua_
|
|||||||
|
|
||||||
void Lua_Mob::DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill) {
|
void Lua_Mob::DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->DoMeleeSkillAttackDmg(other, weapon_damage, static_cast<SkillUseTypes>(skill));
|
self->DoMeleeSkillAttackDmg(other, weapon_damage, static_cast<EQEmu::skills::SkillType>(skill));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Mob::DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill, int chance_mod) {
|
void Lua_Mob::DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill, int chance_mod) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->DoMeleeSkillAttackDmg(other, weapon_damage, static_cast<SkillUseTypes>(skill), chance_mod);
|
self->DoMeleeSkillAttackDmg(other, weapon_damage, static_cast<EQEmu::skills::SkillType>(skill), chance_mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Mob::DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill, int chance_mod, int focus) {
|
void Lua_Mob::DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill, int chance_mod, int focus) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->DoMeleeSkillAttackDmg(other, weapon_damage, static_cast<SkillUseTypes>(skill), chance_mod, focus);
|
self->DoMeleeSkillAttackDmg(other, weapon_damage, static_cast<EQEmu::skills::SkillType>(skill), chance_mod, focus);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Mob::DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill, int chance_mod, int focus, bool can_riposte) {
|
void Lua_Mob::DoMeleeSkillAttackDmg(Lua_Mob other, int weapon_damage, int skill, int chance_mod, int focus, bool can_riposte) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->DoMeleeSkillAttackDmg(other, weapon_damage, static_cast<SkillUseTypes>(skill), chance_mod, focus, can_riposte);
|
self->DoMeleeSkillAttackDmg(other, weapon_damage, static_cast<EQEmu::skills::SkillType>(skill), chance_mod, focus, can_riposte);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Mob::DoArcheryAttackDmg(Lua_Mob other) {
|
void Lua_Mob::DoArcheryAttackDmg(Lua_Mob other) {
|
||||||
@ -1713,17 +1713,17 @@ void Lua_Mob::SetTargetable(bool on) {
|
|||||||
|
|
||||||
void Lua_Mob::ModSkillDmgTaken(int skill, int value) {
|
void Lua_Mob::ModSkillDmgTaken(int skill, int value) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->ModSkillDmgTaken(static_cast<SkillUseTypes>(skill), value);
|
self->ModSkillDmgTaken(static_cast<EQEmu::skills::SkillType>(skill), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Mob::GetModSkillDmgTaken(int skill) {
|
int Lua_Mob::GetModSkillDmgTaken(int skill) {
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return self->GetModSkillDmgTaken(static_cast<SkillUseTypes>(skill));
|
return self->GetModSkillDmgTaken(static_cast<EQEmu::skills::SkillType>(skill));
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Mob::GetSkillDmgTaken(int skill) {
|
int Lua_Mob::GetSkillDmgTaken(int skill) {
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return self->GetSkillDmgTaken(static_cast<SkillUseTypes>(skill));
|
return self->GetSkillDmgTaken(static_cast<EQEmu::skills::SkillType>(skill));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lua_Mob::SetAllowBeneficial(bool value) {
|
void Lua_Mob::SetAllowBeneficial(bool value) {
|
||||||
@ -1773,7 +1773,7 @@ int Lua_Mob::GetFlurryChance() {
|
|||||||
|
|
||||||
int Lua_Mob::GetSkill(int skill) {
|
int Lua_Mob::GetSkill(int skill) {
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return self->GetSkill(static_cast<SkillUseTypes>(skill));
|
return self->GetSkill(static_cast<EQEmu::skills::SkillType>(skill));
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_Mob::GetSpecialAbility(int ability) {
|
int Lua_Mob::GetSpecialAbility(int ability) {
|
||||||
|
|||||||
@ -70,8 +70,8 @@ Merc::Merc(const NPCType* d, float x, float y, float z, float heading)
|
|||||||
rest_timer.Disable();
|
rest_timer.Disable();
|
||||||
|
|
||||||
int r;
|
int r;
|
||||||
for(r = 0; r <= HIGHEST_SKILL; r++) {
|
for (r = 0; r <= EQEmu::skills::HIGHEST_SKILL; r++) {
|
||||||
skills[r] = database.GetSkillCap(GetClass(),(SkillUseTypes)r,GetLevel());
|
skills[r] = database.GetSkillCap(GetClass(), (EQEmu::skills::SkillType)r, GetLevel());
|
||||||
}
|
}
|
||||||
|
|
||||||
size = d->size;
|
size = d->size;
|
||||||
@ -512,7 +512,7 @@ void Merc::AddItemBonuses(const EQEmu::Item_Struct *item, StatBonuses* newbon) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->SkillModValue != 0 && item->SkillModType <= HIGHEST_SKILL){
|
if (item->SkillModValue != 0 && item->SkillModType <= EQEmu::skills::HIGHEST_SKILL){
|
||||||
if ((item->SkillModValue > 0 && newbon->skillmod[item->SkillModType] < item->SkillModValue) ||
|
if ((item->SkillModValue > 0 && newbon->skillmod[item->SkillModType] < item->SkillModValue) ||
|
||||||
(item->SkillModValue < 0 && newbon->skillmod[item->SkillModType] > item->SkillModValue))
|
(item->SkillModValue < 0 && newbon->skillmod[item->SkillModType] > item->SkillModValue))
|
||||||
{
|
{
|
||||||
@ -566,7 +566,7 @@ void Merc::AddItemBonuses(const EQEmu::Item_Struct *item, StatBonuses* newbon) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->ExtraDmgSkill != 0 && item->ExtraDmgSkill <= HIGHEST_SKILL) {
|
if (item->ExtraDmgSkill != 0 && item->ExtraDmgSkill <= EQEmu::skills::HIGHEST_SKILL) {
|
||||||
if((newbon->SkillDamageAmount[item->ExtraDmgSkill] + item->ExtraDmgAmt) > RuleI(Character, ItemExtraDmgCap))
|
if((newbon->SkillDamageAmount[item->ExtraDmgSkill] + item->ExtraDmgAmt) > RuleI(Character, ItemExtraDmgCap))
|
||||||
newbon->SkillDamageAmount[item->ExtraDmgSkill] = RuleI(Character, ItemExtraDmgCap);
|
newbon->SkillDamageAmount[item->ExtraDmgSkill] = RuleI(Character, ItemExtraDmgCap);
|
||||||
else
|
else
|
||||||
@ -931,8 +931,8 @@ int32 Merc::CalcBaseManaRegen()
|
|||||||
int32 regen = 0;
|
int32 regen = 0;
|
||||||
if (IsSitting())
|
if (IsSitting())
|
||||||
{
|
{
|
||||||
if(HasSkill(SkillMeditate))
|
if (HasSkill(EQEmu::skills::SkillMeditate))
|
||||||
regen = (((GetSkill(SkillMeditate) / 10) + (clevel - (clevel / 4))) / 4) + 4;
|
regen = (((GetSkill(EQEmu::skills::SkillMeditate) / 10) + (clevel - (clevel / 4))) / 4) + 4;
|
||||||
else
|
else
|
||||||
regen = 2;
|
regen = 2;
|
||||||
}
|
}
|
||||||
@ -948,9 +948,9 @@ int32 Merc::CalcManaRegen()
|
|||||||
if (IsSitting())
|
if (IsSitting())
|
||||||
{
|
{
|
||||||
BuffFadeBySitModifier();
|
BuffFadeBySitModifier();
|
||||||
if(HasSkill(SkillMeditate)) {
|
if (HasSkill(EQEmu::skills::SkillMeditate)) {
|
||||||
this->_medding = true;
|
this->_medding = true;
|
||||||
regen = ((GetSkill(SkillMeditate) / 10) + mana_regen);
|
regen = ((GetSkill(EQEmu::skills::SkillMeditate) / 10) + mana_regen);
|
||||||
regen += spellbonuses.ManaRegen + itembonuses.ManaRegen;
|
regen += spellbonuses.ManaRegen + itembonuses.ManaRegen;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1179,16 +1179,16 @@ void Merc::CalcRestState() {
|
|||||||
RestRegenEndurance = (GetMaxEndurance() * RuleI(Character, RestRegenPercent) / 100);
|
RestRegenEndurance = (GetMaxEndurance() * RuleI(Character, RestRegenPercent) / 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Merc::HasSkill(SkillUseTypes skill_id) const {
|
bool Merc::HasSkill(EQEmu::skills::SkillType skill_id) const {
|
||||||
return((GetSkill(skill_id) > 0) && CanHaveSkill(skill_id));
|
return((GetSkill(skill_id) > 0) && CanHaveSkill(skill_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Merc::CanHaveSkill(SkillUseTypes skill_id) const {
|
bool Merc::CanHaveSkill(EQEmu::skills::SkillType skill_id) const {
|
||||||
return(database.GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)) > 0);
|
return(database.GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)) > 0);
|
||||||
//if you don't have it by max level, then odds are you never will?
|
//if you don't have it by max level, then odds are you never will?
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 Merc::MaxSkill(SkillUseTypes skillid, uint16 class_, uint16 level) const {
|
uint16 Merc::MaxSkill(EQEmu::skills::SkillType skillid, uint16 class_, uint16 level) const {
|
||||||
return(database.GetSkillCap(class_, skillid, level));
|
return(database.GetSkillCap(class_, skillid, level));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1627,7 +1627,7 @@ void Merc::AI_Process() {
|
|||||||
float DualWieldProbability = 0.0f;
|
float DualWieldProbability = 0.0f;
|
||||||
|
|
||||||
int16 Ambidexterity = aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity;
|
int16 Ambidexterity = aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity;
|
||||||
DualWieldProbability = (GetSkill(SkillDualWield) + GetLevel() + Ambidexterity) / 400.0f; // 78.0 max
|
DualWieldProbability = (GetSkill(EQEmu::skills::SkillDualWield) + GetLevel() + Ambidexterity) / 400.0f; // 78.0 max
|
||||||
int16 DWBonus = spellbonuses.DualWieldChance + itembonuses.DualWieldChance;
|
int16 DWBonus = spellbonuses.DualWieldChance + itembonuses.DualWieldChance;
|
||||||
DualWieldProbability += DualWieldProbability*float(DWBonus)/ 100.0f;
|
DualWieldProbability += DualWieldProbability*float(DWBonus)/ 100.0f;
|
||||||
|
|
||||||
@ -2318,7 +2318,7 @@ bool Merc::AICastSpell(int8 iChance, int32 iSpellTypes) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(spells[selectedMercSpell.spellid].skill == SkillBackstab && spells[selectedMercSpell.spellid].targettype == ST_Self) {
|
if (spells[selectedMercSpell.spellid].skill == EQEmu::skills::SkillBackstab && spells[selectedMercSpell.spellid].targettype == ST_Self) {
|
||||||
if(!hidden) {
|
if(!hidden) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -4432,7 +4432,7 @@ void Merc::DoClassAttacks(Mob *target) {
|
|||||||
dmg = -5;
|
dmg = -5;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if(target->CheckHitChance(this, SkillKick, 0)) {
|
if (target->CheckHitChance(this, EQEmu::skills::SkillKick, 0)) {
|
||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
dmg = GetKickDamage();
|
dmg = GetKickDamage();
|
||||||
else
|
else
|
||||||
@ -4442,7 +4442,7 @@ void Merc::DoClassAttacks(Mob *target) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reuse = KickReuseTime * 1000;
|
reuse = KickReuseTime * 1000;
|
||||||
DoSpecialAttackDamage(target, SkillKick, dmg, 1, -1, reuse);
|
DoSpecialAttackDamage(target, EQEmu::skills::SkillKick, dmg, 1, -1, reuse);
|
||||||
did_attack = true;
|
did_attack = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4454,7 +4454,7 @@ void Merc::DoClassAttacks(Mob *target) {
|
|||||||
dmg = -5;
|
dmg = -5;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if(target->CheckHitChance(this, SkillBash, 0)) {
|
if (target->CheckHitChance(this, EQEmu::skills::SkillBash, 0)) {
|
||||||
if(RuleB(Combat, UseIntervalAC))
|
if(RuleB(Combat, UseIntervalAC))
|
||||||
dmg = GetBashDamage();
|
dmg = GetBashDamage();
|
||||||
else
|
else
|
||||||
@ -4463,7 +4463,7 @@ void Merc::DoClassAttacks(Mob *target) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reuse = BashReuseTime * 1000;
|
reuse = BashReuseTime * 1000;
|
||||||
DoSpecialAttackDamage(target, SkillBash, dmg, 1, -1, reuse);
|
DoSpecialAttackDamage(target, EQEmu::skills::SkillBash, dmg, 1, -1, reuse);
|
||||||
did_attack = true;
|
did_attack = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4485,7 +4485,7 @@ bool Merc::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, boo
|
|||||||
return NPC::Attack(other, Hand, bRiposte, IsStrikethrough, IsFromSpell, opts);
|
return NPC::Attack(other, Hand, bRiposte, IsStrikethrough, IsFromSpell, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Merc::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, int special)
|
void Merc::Damage(Mob* other, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable, int8 buffslot, bool iBuffTic, int special)
|
||||||
{
|
{
|
||||||
if(IsDead() || IsCorpse())
|
if(IsDead() || IsCorpse())
|
||||||
return;
|
return;
|
||||||
@ -4526,7 +4526,7 @@ Mob* Merc::GetOwnerOrSelf() {
|
|||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Merc::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack_skill)
|
bool Merc::Death(Mob* killerMob, int32 damage, uint16 spell, EQEmu::skills::SkillType attack_skill)
|
||||||
{
|
{
|
||||||
if(!NPC::Death(killerMob, damage, spell, attack_skill))
|
if(!NPC::Death(killerMob, damage, spell, attack_skill))
|
||||||
{
|
{
|
||||||
|
|||||||
14
zone/merc.h
14
zone/merc.h
@ -64,8 +64,8 @@ public:
|
|||||||
virtual ~Merc();
|
virtual ~Merc();
|
||||||
|
|
||||||
//abstract virtual function implementations requird by base abstract class
|
//abstract virtual function implementations requird by base abstract class
|
||||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill);
|
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
|
||||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
|
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
|
||||||
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||||
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0);
|
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0);
|
||||||
virtual bool HasRaid() { return false; }
|
virtual bool HasRaid() { return false; }
|
||||||
@ -181,10 +181,10 @@ public:
|
|||||||
inline const uint8 GetClientVersion() const { return _OwnerClientVersion; }
|
inline const uint8 GetClientVersion() const { return _OwnerClientVersion; }
|
||||||
|
|
||||||
virtual void SetTarget(Mob* mob);
|
virtual void SetTarget(Mob* mob);
|
||||||
bool HasSkill(SkillUseTypes skill_id) const;
|
bool HasSkill(EQEmu::skills::SkillType skill_id) const;
|
||||||
bool CanHaveSkill(SkillUseTypes skill_id) const;
|
bool CanHaveSkill(EQEmu::skills::SkillType skill_id) const;
|
||||||
uint16 MaxSkill(SkillUseTypes skillid, uint16 class_, uint16 level) const;
|
uint16 MaxSkill(EQEmu::skills::SkillType skillid, uint16 class_, uint16 level) const;
|
||||||
inline uint16 MaxSkill(SkillUseTypes skillid) const { return MaxSkill(skillid, GetClass(), GetLevel()); }
|
inline uint16 MaxSkill(EQEmu::skills::SkillType skillid) const { return MaxSkill(skillid, GetClass(), GetLevel()); }
|
||||||
virtual void DoClassAttacks(Mob *target);
|
virtual void DoClassAttacks(Mob *target);
|
||||||
void CheckHateList();
|
void CheckHateList();
|
||||||
bool CheckTaunt();
|
bool CheckTaunt();
|
||||||
@ -291,7 +291,7 @@ protected:
|
|||||||
std::vector<MercSpell> merc_spells;
|
std::vector<MercSpell> merc_spells;
|
||||||
std::map<uint32,MercTimer> timers;
|
std::map<uint32,MercTimer> timers;
|
||||||
|
|
||||||
uint16 skills[HIGHEST_SKILL+1];
|
uint16 skills[EQEmu::skills::HIGHEST_SKILL + 1];
|
||||||
uint32 equipment[EQEmu::legacy::EQUIPMENT_SIZE]; //this is an array of item IDs
|
uint32 equipment[EQEmu::legacy::EQUIPMENT_SIZE]; //this is an array of item IDs
|
||||||
uint16 d_melee_texture1; //this is an item Material value
|
uint16 d_melee_texture1; //this is an item Material value
|
||||||
uint16 d_melee_texture2; //this is an item Material value (offhand)
|
uint16 d_melee_texture2; //this is an item Material value (offhand)
|
||||||
|
|||||||
114
zone/mob.cpp
114
zone/mob.cpp
@ -427,7 +427,7 @@ Mob::Mob(const char* in_name,
|
|||||||
|
|
||||||
m_AllowBeneficial = false;
|
m_AllowBeneficial = false;
|
||||||
m_DisableMelee = false;
|
m_DisableMelee = false;
|
||||||
for (int i = 0; i < HIGHEST_SKILL+2; i++) { SkillDmgTaken_Mod[i] = 0; }
|
for (int i = 0; i < EQEmu::skills::HIGHEST_SKILL + 2; i++) { SkillDmgTaken_Mod[i] = 0; }
|
||||||
for (int i = 0; i < HIGHEST_RESIST+2; i++) { Vulnerability_Mod[i] = 0; }
|
for (int i = 0; i < HIGHEST_RESIST+2; i++) { Vulnerability_Mod[i] = 0; }
|
||||||
|
|
||||||
emoteid = 0;
|
emoteid = 0;
|
||||||
@ -2369,14 +2369,14 @@ void Mob::SetZone(uint32 zone_id, uint32 instance_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Mob::Kill() {
|
void Mob::Kill() {
|
||||||
Death(this, 0, SPELL_UNKNOWN, SkillHandtoHand);
|
Death(this, 0, SPELL_UNKNOWN, EQEmu::skills::SkillHandtoHand);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Mob::CanThisClassDualWield(void) const {
|
bool Mob::CanThisClassDualWield(void) const {
|
||||||
if(!IsClient()) {
|
if(!IsClient()) {
|
||||||
return(GetSkill(SkillDualWield) > 0);
|
return(GetSkill(EQEmu::skills::SkillDualWield) > 0);
|
||||||
}
|
}
|
||||||
else if(CastToClient()->HasSkill(SkillDualWield)) {
|
else if (CastToClient()->HasSkill(EQEmu::skills::SkillDualWield)) {
|
||||||
const ItemInst* pinst = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
|
const ItemInst* pinst = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotPrimary);
|
||||||
const ItemInst* sinst = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
|
const ItemInst* sinst = CastToClient()->GetInv().GetItem(EQEmu::legacy::SlotSecondary);
|
||||||
|
|
||||||
@ -2406,12 +2406,12 @@ bool Mob::CanThisClassDualWield(void) const {
|
|||||||
bool Mob::CanThisClassDoubleAttack(void) const
|
bool Mob::CanThisClassDoubleAttack(void) const
|
||||||
{
|
{
|
||||||
if(!IsClient()) {
|
if(!IsClient()) {
|
||||||
return(GetSkill(SkillDoubleAttack) > 0);
|
return(GetSkill(EQEmu::skills::SkillDoubleAttack) > 0);
|
||||||
} else {
|
} else {
|
||||||
if(aabonuses.GiveDoubleAttack || itembonuses.GiveDoubleAttack || spellbonuses.GiveDoubleAttack) {
|
if(aabonuses.GiveDoubleAttack || itembonuses.GiveDoubleAttack || spellbonuses.GiveDoubleAttack) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return(CastToClient()->HasSkill(SkillDoubleAttack));
|
return(CastToClient()->HasSkill(EQEmu::skills::SkillDoubleAttack));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2420,7 +2420,7 @@ bool Mob::CanThisClassTripleAttack() const
|
|||||||
if (!IsClient())
|
if (!IsClient())
|
||||||
return false; // When they added the real triple attack skill, mobs lost the ability to triple
|
return false; // When they added the real triple attack skill, mobs lost the ability to triple
|
||||||
else
|
else
|
||||||
return CastToClient()->HasSkill(SkillTripleAttack);
|
return CastToClient()->HasSkill(EQEmu::skills::SkillTripleAttack);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Mob::IsWarriorClass(void) const
|
bool Mob::IsWarriorClass(void) const
|
||||||
@ -2459,36 +2459,36 @@ bool Mob::IsWarriorClass(void) const
|
|||||||
bool Mob::CanThisClassParry(void) const
|
bool Mob::CanThisClassParry(void) const
|
||||||
{
|
{
|
||||||
if(!IsClient()) {
|
if(!IsClient()) {
|
||||||
return(GetSkill(SkillParry) > 0);
|
return(GetSkill(EQEmu::skills::SkillParry) > 0);
|
||||||
} else {
|
} else {
|
||||||
return(CastToClient()->HasSkill(SkillParry));
|
return(CastToClient()->HasSkill(EQEmu::skills::SkillParry));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Mob::CanThisClassDodge(void) const
|
bool Mob::CanThisClassDodge(void) const
|
||||||
{
|
{
|
||||||
if(!IsClient()) {
|
if(!IsClient()) {
|
||||||
return(GetSkill(SkillDodge) > 0);
|
return(GetSkill(EQEmu::skills::SkillDodge) > 0);
|
||||||
} else {
|
} else {
|
||||||
return(CastToClient()->HasSkill(SkillDodge));
|
return(CastToClient()->HasSkill(EQEmu::skills::SkillDodge));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Mob::CanThisClassRiposte(void) const
|
bool Mob::CanThisClassRiposte(void) const
|
||||||
{
|
{
|
||||||
if(!IsClient()) {
|
if(!IsClient()) {
|
||||||
return(GetSkill(SkillRiposte) > 0);
|
return(GetSkill(EQEmu::skills::SkillRiposte) > 0);
|
||||||
} else {
|
} else {
|
||||||
return(CastToClient()->HasSkill(SkillRiposte));
|
return(CastToClient()->HasSkill(EQEmu::skills::SkillRiposte));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Mob::CanThisClassBlock(void) const
|
bool Mob::CanThisClassBlock(void) const
|
||||||
{
|
{
|
||||||
if(!IsClient()) {
|
if(!IsClient()) {
|
||||||
return(GetSkill(SkillBlock) > 0);
|
return(GetSkill(EQEmu::skills::SkillBlock) > 0);
|
||||||
} else {
|
} else {
|
||||||
return(CastToClient()->HasSkill(SkillBlock));
|
return(CastToClient()->HasSkill(EQEmu::skills::SkillBlock));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -3411,19 +3411,19 @@ void Mob::TriggerDefensiveProcs(Mob *on, uint16 hand, bool FromSkillProc, int da
|
|||||||
uint16 skillinuse = 0;
|
uint16 skillinuse = 0;
|
||||||
switch (damage) {
|
switch (damage) {
|
||||||
case (-1):
|
case (-1):
|
||||||
skillinuse = SkillBlock;
|
skillinuse = EQEmu::skills::SkillBlock;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (-2):
|
case (-2):
|
||||||
skillinuse = SkillParry;
|
skillinuse = EQEmu::skills::SkillParry;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (-3):
|
case (-3):
|
||||||
skillinuse = SkillRiposte;
|
skillinuse = EQEmu::skills::SkillRiposte;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (-4):
|
case (-4):
|
||||||
skillinuse = SkillDodge;
|
skillinuse = EQEmu::skills::SkillDodge;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3784,15 +3784,15 @@ int32 Mob::GetVulnerability(Mob* caster, uint32 spell_id, uint32 ticsremaining)
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16 Mob::GetSkillDmgTaken(const SkillUseTypes skill_used, ExtraAttackOptions *opts)
|
int16 Mob::GetSkillDmgTaken(const EQEmu::skills::SkillType skill_used, ExtraAttackOptions *opts)
|
||||||
{
|
{
|
||||||
int skilldmg_mod = 0;
|
int skilldmg_mod = 0;
|
||||||
|
|
||||||
// All skill dmg mod + Skill specific
|
// All skill dmg mod + Skill specific
|
||||||
skilldmg_mod += itembonuses.SkillDmgTaken[HIGHEST_SKILL+1] + spellbonuses.SkillDmgTaken[HIGHEST_SKILL+1] +
|
skilldmg_mod += itembonuses.SkillDmgTaken[EQEmu::skills::HIGHEST_SKILL + 1] + spellbonuses.SkillDmgTaken[EQEmu::skills::HIGHEST_SKILL + 1] +
|
||||||
itembonuses.SkillDmgTaken[skill_used] + spellbonuses.SkillDmgTaken[skill_used];
|
itembonuses.SkillDmgTaken[skill_used] + spellbonuses.SkillDmgTaken[skill_used];
|
||||||
|
|
||||||
skilldmg_mod += SkillDmgTaken_Mod[skill_used] + SkillDmgTaken_Mod[HIGHEST_SKILL+1];
|
skilldmg_mod += SkillDmgTaken_Mod[skill_used] + SkillDmgTaken_Mod[EQEmu::skills::HIGHEST_SKILL + 1];
|
||||||
|
|
||||||
if (opts)
|
if (opts)
|
||||||
skilldmg_mod += opts->skilldmgtaken_bonus_flat;
|
skilldmg_mod += opts->skilldmgtaken_bonus_flat;
|
||||||
@ -4606,7 +4606,7 @@ int16 Mob::GetCritDmgMob(uint16 skill)
|
|||||||
int critDmg_mod = 0;
|
int critDmg_mod = 0;
|
||||||
|
|
||||||
// All skill dmg mod + Skill specific
|
// All skill dmg mod + Skill specific
|
||||||
critDmg_mod += itembonuses.CritDmgMob[HIGHEST_SKILL+1] + spellbonuses.CritDmgMob[HIGHEST_SKILL+1] + aabonuses.CritDmgMob[HIGHEST_SKILL+1] +
|
critDmg_mod += itembonuses.CritDmgMob[EQEmu::skills::HIGHEST_SKILL + 1] + spellbonuses.CritDmgMob[EQEmu::skills::HIGHEST_SKILL + 1] + aabonuses.CritDmgMob[EQEmu::skills::HIGHEST_SKILL + 1] +
|
||||||
itembonuses.CritDmgMob[skill] + spellbonuses.CritDmgMob[skill] + aabonuses.CritDmgMob[skill];
|
itembonuses.CritDmgMob[skill] + spellbonuses.CritDmgMob[skill] + aabonuses.CritDmgMob[skill];
|
||||||
|
|
||||||
if(critDmg_mod < -100)
|
if(critDmg_mod < -100)
|
||||||
@ -4651,7 +4651,7 @@ int16 Mob::GetCriticalChanceBonus(uint16 skill)
|
|||||||
int critical_chance = 0;
|
int critical_chance = 0;
|
||||||
|
|
||||||
// All skills + Skill specific
|
// All skills + Skill specific
|
||||||
critical_chance += itembonuses.CriticalHitChance[HIGHEST_SKILL+1] + spellbonuses.CriticalHitChance[HIGHEST_SKILL+1] + aabonuses.CriticalHitChance[HIGHEST_SKILL+1] +
|
critical_chance += itembonuses.CriticalHitChance[EQEmu::skills::HIGHEST_SKILL + 1] + spellbonuses.CriticalHitChance[EQEmu::skills::HIGHEST_SKILL + 1] + aabonuses.CriticalHitChance[EQEmu::skills::HIGHEST_SKILL + 1] +
|
||||||
itembonuses.CriticalHitChance[skill] + spellbonuses.CriticalHitChance[skill] + aabonuses.CriticalHitChance[skill];
|
itembonuses.CriticalHitChance[skill] + spellbonuses.CriticalHitChance[skill] + aabonuses.CriticalHitChance[skill];
|
||||||
|
|
||||||
if(critical_chance < -100)
|
if(critical_chance < -100)
|
||||||
@ -4665,10 +4665,10 @@ int16 Mob::GetMeleeDamageMod_SE(uint16 skill)
|
|||||||
int dmg_mod = 0;
|
int dmg_mod = 0;
|
||||||
|
|
||||||
// All skill dmg mod + Skill specific
|
// All skill dmg mod + Skill specific
|
||||||
dmg_mod += itembonuses.DamageModifier[HIGHEST_SKILL+1] + spellbonuses.DamageModifier[HIGHEST_SKILL+1] + aabonuses.DamageModifier[HIGHEST_SKILL+1] +
|
dmg_mod += itembonuses.DamageModifier[EQEmu::skills::HIGHEST_SKILL + 1] + spellbonuses.DamageModifier[EQEmu::skills::HIGHEST_SKILL + 1] + aabonuses.DamageModifier[EQEmu::skills::HIGHEST_SKILL + 1] +
|
||||||
itembonuses.DamageModifier[skill] + spellbonuses.DamageModifier[skill] + aabonuses.DamageModifier[skill];
|
itembonuses.DamageModifier[skill] + spellbonuses.DamageModifier[skill] + aabonuses.DamageModifier[skill];
|
||||||
|
|
||||||
dmg_mod += itembonuses.DamageModifier2[HIGHEST_SKILL+1] + spellbonuses.DamageModifier2[HIGHEST_SKILL+1] + aabonuses.DamageModifier2[HIGHEST_SKILL+1] +
|
dmg_mod += itembonuses.DamageModifier2[EQEmu::skills::HIGHEST_SKILL + 1] + spellbonuses.DamageModifier2[EQEmu::skills::HIGHEST_SKILL + 1] + aabonuses.DamageModifier2[EQEmu::skills::HIGHEST_SKILL + 1] +
|
||||||
itembonuses.DamageModifier2[skill] + spellbonuses.DamageModifier2[skill] + aabonuses.DamageModifier2[skill];
|
itembonuses.DamageModifier2[skill] + spellbonuses.DamageModifier2[skill] + aabonuses.DamageModifier2[skill];
|
||||||
|
|
||||||
if (HasShieldEquiped() && !IsOffHandAtk())
|
if (HasShieldEquiped() && !IsOffHandAtk())
|
||||||
@ -4685,7 +4685,7 @@ int16 Mob::GetMeleeMinDamageMod_SE(uint16 skill)
|
|||||||
int dmg_mod = 0;
|
int dmg_mod = 0;
|
||||||
|
|
||||||
dmg_mod = itembonuses.MinDamageModifier[skill] + spellbonuses.MinDamageModifier[skill] +
|
dmg_mod = itembonuses.MinDamageModifier[skill] + spellbonuses.MinDamageModifier[skill] +
|
||||||
itembonuses.MinDamageModifier[HIGHEST_SKILL+1] + spellbonuses.MinDamageModifier[HIGHEST_SKILL+1];
|
itembonuses.MinDamageModifier[EQEmu::skills::HIGHEST_SKILL + 1] + spellbonuses.MinDamageModifier[EQEmu::skills::HIGHEST_SKILL + 1];
|
||||||
|
|
||||||
if(dmg_mod < -100)
|
if(dmg_mod < -100)
|
||||||
dmg_mod = -100;
|
dmg_mod = -100;
|
||||||
@ -4717,10 +4717,10 @@ int16 Mob::GetSkillDmgAmt(uint16 skill)
|
|||||||
int skill_dmg = 0;
|
int skill_dmg = 0;
|
||||||
|
|
||||||
// All skill dmg(only spells do this) + Skill specific
|
// All skill dmg(only spells do this) + Skill specific
|
||||||
skill_dmg += spellbonuses.SkillDamageAmount[HIGHEST_SKILL+1] + itembonuses.SkillDamageAmount[HIGHEST_SKILL+1] + aabonuses.SkillDamageAmount[HIGHEST_SKILL+1]
|
skill_dmg += spellbonuses.SkillDamageAmount[EQEmu::skills::HIGHEST_SKILL + 1] + itembonuses.SkillDamageAmount[EQEmu::skills::HIGHEST_SKILL + 1] + aabonuses.SkillDamageAmount[EQEmu::skills::HIGHEST_SKILL + 1]
|
||||||
+ itembonuses.SkillDamageAmount[skill] + spellbonuses.SkillDamageAmount[skill] + aabonuses.SkillDamageAmount[skill];
|
+ itembonuses.SkillDamageAmount[skill] + spellbonuses.SkillDamageAmount[skill] + aabonuses.SkillDamageAmount[skill];
|
||||||
|
|
||||||
skill_dmg += spellbonuses.SkillDamageAmount2[HIGHEST_SKILL+1] + itembonuses.SkillDamageAmount2[HIGHEST_SKILL+1]
|
skill_dmg += spellbonuses.SkillDamageAmount2[EQEmu::skills::HIGHEST_SKILL + 1] + itembonuses.SkillDamageAmount2[EQEmu::skills::HIGHEST_SKILL + 1]
|
||||||
+ itembonuses.SkillDamageAmount2[skill] + spellbonuses.SkillDamageAmount2[skill];
|
+ itembonuses.SkillDamageAmount2[skill] + spellbonuses.SkillDamageAmount2[skill];
|
||||||
|
|
||||||
return skill_dmg;
|
return skill_dmg;
|
||||||
@ -4740,7 +4740,7 @@ void Mob::MeleeLifeTap(int32 damage) {
|
|||||||
if (lifetap_amt > 0)
|
if (lifetap_amt > 0)
|
||||||
HealDamage(lifetap_amt); //Heal self for modified damage amount.
|
HealDamage(lifetap_amt); //Heal self for modified damage amount.
|
||||||
else
|
else
|
||||||
Damage(this, -lifetap_amt,0, SkillEvocation,false); //Dmg self for modified damage amount.
|
Damage(this, -lifetap_amt, 0, EQEmu::skills::SkillEvocation, false); //Dmg self for modified damage amount.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4914,21 +4914,21 @@ void Mob::SetBodyType(bodyType new_body, bool overwrite_orig) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Mob::ModSkillDmgTaken(SkillUseTypes skill_num, int value)
|
void Mob::ModSkillDmgTaken(EQEmu::skills::SkillType skill_num, int value)
|
||||||
{
|
{
|
||||||
if (skill_num == ALL_SKILLS)
|
if (skill_num == ALL_SKILLS)
|
||||||
SkillDmgTaken_Mod[HIGHEST_SKILL+1] = value;
|
SkillDmgTaken_Mod[EQEmu::skills::HIGHEST_SKILL + 1] = value;
|
||||||
|
|
||||||
else if (skill_num >= 0 && skill_num <= HIGHEST_SKILL)
|
else if (skill_num >= 0 && skill_num <= EQEmu::skills::HIGHEST_SKILL)
|
||||||
SkillDmgTaken_Mod[skill_num] = value;
|
SkillDmgTaken_Mod[skill_num] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16 Mob::GetModSkillDmgTaken(const SkillUseTypes skill_num)
|
int16 Mob::GetModSkillDmgTaken(const EQEmu::skills::SkillType skill_num)
|
||||||
{
|
{
|
||||||
if (skill_num == ALL_SKILLS)
|
if (skill_num == ALL_SKILLS)
|
||||||
return SkillDmgTaken_Mod[HIGHEST_SKILL+1];
|
return SkillDmgTaken_Mod[EQEmu::skills::HIGHEST_SKILL + 1];
|
||||||
|
|
||||||
else if (skill_num >= 0 && skill_num <= HIGHEST_SKILL)
|
else if (skill_num >= 0 && skill_num <= EQEmu::skills::HIGHEST_SKILL)
|
||||||
return SkillDmgTaken_Mod[skill_num];
|
return SkillDmgTaken_Mod[skill_num];
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -5021,52 +5021,52 @@ uint16 Mob::GetSkillByItemType(int ItemType)
|
|||||||
{
|
{
|
||||||
switch (ItemType) {
|
switch (ItemType) {
|
||||||
case EQEmu::item::ItemType1HSlash:
|
case EQEmu::item::ItemType1HSlash:
|
||||||
return Skill1HSlashing;
|
return EQEmu::skills::Skill1HSlashing;
|
||||||
case EQEmu::item::ItemType2HSlash:
|
case EQEmu::item::ItemType2HSlash:
|
||||||
return Skill2HSlashing;
|
return EQEmu::skills::Skill2HSlashing;
|
||||||
case EQEmu::item::ItemType1HPiercing:
|
case EQEmu::item::ItemType1HPiercing:
|
||||||
return Skill1HPiercing;
|
return EQEmu::skills::Skill1HPiercing;
|
||||||
case EQEmu::item::ItemType1HBlunt:
|
case EQEmu::item::ItemType1HBlunt:
|
||||||
return Skill1HBlunt;
|
return EQEmu::skills::Skill1HBlunt;
|
||||||
case EQEmu::item::ItemType2HBlunt:
|
case EQEmu::item::ItemType2HBlunt:
|
||||||
return Skill2HBlunt;
|
return EQEmu::skills::Skill2HBlunt;
|
||||||
case EQEmu::item::ItemType2HPiercing:
|
case EQEmu::item::ItemType2HPiercing:
|
||||||
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
|
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
|
||||||
return Skill1HPiercing;
|
return EQEmu::skills::Skill1HPiercing;
|
||||||
else
|
else
|
||||||
return Skill2HPiercing;
|
return EQEmu::skills::Skill2HPiercing;
|
||||||
case EQEmu::item::ItemTypeBow:
|
case EQEmu::item::ItemTypeBow:
|
||||||
return SkillArchery;
|
return EQEmu::skills::SkillArchery;
|
||||||
case EQEmu::item::ItemTypeLargeThrowing:
|
case EQEmu::item::ItemTypeLargeThrowing:
|
||||||
case EQEmu::item::ItemTypeSmallThrowing:
|
case EQEmu::item::ItemTypeSmallThrowing:
|
||||||
return SkillThrowing;
|
return EQEmu::skills::SkillThrowing;
|
||||||
case EQEmu::item::ItemTypeMartial:
|
case EQEmu::item::ItemTypeMartial:
|
||||||
return SkillHandtoHand;
|
return EQEmu::skills::SkillHandtoHand;
|
||||||
default:
|
default:
|
||||||
return SkillHandtoHand;
|
return EQEmu::skills::SkillHandtoHand;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Mob::GetItemTypeBySkill(SkillUseTypes skill)
|
uint8 Mob::GetItemTypeBySkill(EQEmu::skills::SkillType skill)
|
||||||
{
|
{
|
||||||
switch (skill) {
|
switch (skill) {
|
||||||
case SkillThrowing:
|
case EQEmu::skills::SkillThrowing:
|
||||||
return EQEmu::item::ItemTypeSmallThrowing;
|
return EQEmu::item::ItemTypeSmallThrowing;
|
||||||
case SkillArchery:
|
case EQEmu::skills::SkillArchery:
|
||||||
return EQEmu::item::ItemTypeArrow;
|
return EQEmu::item::ItemTypeArrow;
|
||||||
case Skill1HSlashing:
|
case EQEmu::skills::Skill1HSlashing:
|
||||||
return EQEmu::item::ItemType1HSlash;
|
return EQEmu::item::ItemType1HSlash;
|
||||||
case Skill2HSlashing:
|
case EQEmu::skills::Skill2HSlashing:
|
||||||
return EQEmu::item::ItemType2HSlash;
|
return EQEmu::item::ItemType2HSlash;
|
||||||
case Skill1HPiercing:
|
case EQEmu::skills::Skill1HPiercing:
|
||||||
return EQEmu::item::ItemType1HPiercing;
|
return EQEmu::item::ItemType1HPiercing;
|
||||||
case Skill2HPiercing: // watch for undesired client behavior
|
case EQEmu::skills::Skill2HPiercing: // watch for undesired client behavior
|
||||||
return EQEmu::item::ItemType2HPiercing;
|
return EQEmu::item::ItemType2HPiercing;
|
||||||
case Skill1HBlunt:
|
case EQEmu::skills::Skill1HBlunt:
|
||||||
return EQEmu::item::ItemType1HBlunt;
|
return EQEmu::item::ItemType1HBlunt;
|
||||||
case Skill2HBlunt:
|
case EQEmu::skills::Skill2HBlunt:
|
||||||
return EQEmu::item::ItemType2HBlunt;
|
return EQEmu::item::ItemType2HBlunt;
|
||||||
case SkillHandtoHand:
|
case EQEmu::skills::SkillHandtoHand:
|
||||||
return EQEmu::item::ItemTypeMartial;
|
return EQEmu::item::ItemTypeMartial;
|
||||||
default:
|
default:
|
||||||
return EQEmu::item::ItemTypeMartial;
|
return EQEmu::item::ItemTypeMartial;
|
||||||
|
|||||||
51
zone/mob.h
51
zone/mob.h
@ -25,6 +25,7 @@
|
|||||||
#include "position.h"
|
#include "position.h"
|
||||||
#include "aa_ability.h"
|
#include "aa_ability.h"
|
||||||
#include "aa.h"
|
#include "aa.h"
|
||||||
|
#include "../common/light_source.h"
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -157,12 +158,12 @@ public:
|
|||||||
int MonkSpecialAttack(Mob* other, uint8 skill_used);
|
int MonkSpecialAttack(Mob* other, uint8 skill_used);
|
||||||
virtual void TryBackstab(Mob *other,int ReuseTime = 10);
|
virtual void TryBackstab(Mob *other,int ReuseTime = 10);
|
||||||
bool AvoidDamage(Mob* attacker, int32 &damage, int hand);
|
bool AvoidDamage(Mob* attacker, int32 &damage, int hand);
|
||||||
virtual bool CheckHitChance(Mob* attacker, SkillUseTypes skillinuse, int Hand, int16 chance_mod = 0);
|
virtual bool CheckHitChance(Mob* attacker, EQEmu::skills::SkillType skillinuse, int Hand, int16 chance_mod = 0);
|
||||||
virtual void TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttackOptions *opts = nullptr);
|
virtual void TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttackOptions *opts = nullptr);
|
||||||
void TryPetCriticalHit(Mob *defender, uint16 skill, int32 &damage);
|
void TryPetCriticalHit(Mob *defender, uint16 skill, int32 &damage);
|
||||||
virtual bool TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse);
|
virtual bool TryFinishingBlow(Mob *defender, EQEmu::skills::SkillType skillinuse);
|
||||||
uint32 TryHeadShot(Mob* defender, SkillUseTypes skillInUse);
|
uint32 TryHeadShot(Mob* defender, EQEmu::skills::SkillType skillInUse);
|
||||||
uint32 TryAssassinate(Mob* defender, SkillUseTypes skillInUse, uint16 ReuseTime);
|
uint32 TryAssassinate(Mob* defender, EQEmu::skills::SkillType skillInUse, uint16 ReuseTime);
|
||||||
virtual void DoRiposte(Mob* defender);
|
virtual void DoRiposte(Mob* defender);
|
||||||
void ApplyMeleeDamageBonus(uint16 skill, int32 &damage,ExtraAttackOptions *opts = nullptr);
|
void ApplyMeleeDamageBonus(uint16 skill, int32 &damage,ExtraAttackOptions *opts = nullptr);
|
||||||
virtual void MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttackOptions *opts = nullptr);
|
virtual void MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttackOptions *opts = nullptr);
|
||||||
@ -170,7 +171,7 @@ public:
|
|||||||
bool CombatRange(Mob* other);
|
bool CombatRange(Mob* other);
|
||||||
virtual inline bool IsBerserk() { return false; } // only clients
|
virtual inline bool IsBerserk() { return false; } // only clients
|
||||||
void RogueEvade(Mob *other);
|
void RogueEvade(Mob *other);
|
||||||
void CommonOutgoingHitSuccess(Mob* defender, int32 &damage, SkillUseTypes skillInUse,ExtraAttackOptions *opts = nullptr);
|
void CommonOutgoingHitSuccess(Mob* defender, int32 &damage, EQEmu::skills::SkillType skillInUse, ExtraAttackOptions *opts = nullptr);
|
||||||
void BreakInvisibleSpells();
|
void BreakInvisibleSpells();
|
||||||
void CommonBreakInvisibleFromCombat();
|
void CommonBreakInvisibleFromCombat();
|
||||||
bool HasDied();
|
bool HasDied();
|
||||||
@ -203,7 +204,7 @@ public:
|
|||||||
virtual void WearChange(uint8 material_slot, uint16 texture, uint32 color, uint32 hero_forge_model = 0);
|
virtual void WearChange(uint8 material_slot, uint16 texture, uint32 color, uint32 hero_forge_model = 0);
|
||||||
void DoAnim(const int animnum, int type=0, bool ackreq = true, eqFilterType filter = FilterNone);
|
void DoAnim(const int animnum, int type=0, bool ackreq = true, eqFilterType filter = FilterNone);
|
||||||
void ProjectileAnimation(Mob* to, int item_id, bool IsArrow = false, float speed = 0,
|
void ProjectileAnimation(Mob* to, int item_id, bool IsArrow = false, float speed = 0,
|
||||||
float angle = 0, float tilt = 0, float arc = 0, const char *IDFile = nullptr, SkillUseTypes skillInUse = SkillArchery);
|
float angle = 0, float tilt = 0, float arc = 0, const char *IDFile = nullptr, EQEmu::skills::SkillType skillInUse = EQEmu::skills::SkillArchery);
|
||||||
void ChangeSize(float in_size, bool bNoRestriction = false);
|
void ChangeSize(float in_size, bool bNoRestriction = false);
|
||||||
inline uint8 SeeInvisible() const { return see_invis; }
|
inline uint8 SeeInvisible() const { return see_invis; }
|
||||||
inline bool SeeInvisibleUndead() const { return see_invis_undead; }
|
inline bool SeeInvisibleUndead() const { return see_invis_undead; }
|
||||||
@ -211,7 +212,7 @@ public:
|
|||||||
inline bool SeeImprovedHide() const { return see_improved_hide; }
|
inline bool SeeImprovedHide() const { return see_improved_hide; }
|
||||||
bool IsInvisible(Mob* other = 0) const;
|
bool IsInvisible(Mob* other = 0) const;
|
||||||
void SetInvisible(uint8 state);
|
void SetInvisible(uint8 state);
|
||||||
bool AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* weapon);
|
bool AttackAnimation(EQEmu::skills::SkillType &skillinuse, int Hand, const ItemInst* weapon);
|
||||||
|
|
||||||
//Song
|
//Song
|
||||||
bool UseBardSpellLogic(uint16 spell_id = 0xffff, int slot = -1);
|
bool UseBardSpellLogic(uint16 spell_id = 0xffff, int slot = -1);
|
||||||
@ -348,7 +349,7 @@ public:
|
|||||||
inline void SetTwoHandBluntEquiped(bool val) { has_twohandbluntequiped = val; }
|
inline void SetTwoHandBluntEquiped(bool val) { has_twohandbluntequiped = val; }
|
||||||
bool HasTwoHanderEquipped() { return has_twohanderequipped; }
|
bool HasTwoHanderEquipped() { return has_twohanderequipped; }
|
||||||
void SetTwoHanderEquipped(bool val) { has_twohanderequipped = val; }
|
void SetTwoHanderEquipped(bool val) { has_twohanderequipped = val; }
|
||||||
virtual uint16 GetSkill(SkillUseTypes skill_num) const { return 0; }
|
virtual uint16 GetSkill(EQEmu::skills::SkillType skill_num) const { return 0; }
|
||||||
virtual uint32 GetEquipment(uint8 material_slot) const { return(0); }
|
virtual uint32 GetEquipment(uint8 material_slot) const { return(0); }
|
||||||
virtual int32 GetEquipmentMaterial(uint8 material_slot) const;
|
virtual int32 GetEquipmentMaterial(uint8 material_slot) const;
|
||||||
virtual int32 GetHerosForgeModel(uint8 material_slot) const;
|
virtual int32 GetHerosForgeModel(uint8 material_slot) const;
|
||||||
@ -356,8 +357,8 @@ public:
|
|||||||
virtual uint32 IsEliteMaterialItem(uint8 material_slot) const;
|
virtual uint32 IsEliteMaterialItem(uint8 material_slot) const;
|
||||||
bool CanClassEquipItem(uint32 item_id);
|
bool CanClassEquipItem(uint32 item_id);
|
||||||
bool AffectedBySpellExcludingSlot(int slot, int effect);
|
bool AffectedBySpellExcludingSlot(int slot, int effect);
|
||||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) = 0;
|
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill) = 0;
|
||||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill,
|
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill,
|
||||||
bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0) = 0;
|
bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0) = 0;
|
||||||
inline virtual void SetHP(int32 hp) { if (hp >= max_hp) cur_hp = max_hp; else cur_hp = hp;}
|
inline virtual void SetHP(int32 hp) { if (hp >= max_hp) cur_hp = max_hp; else cur_hp = hp;}
|
||||||
bool ChangeHP(Mob* other, int32 amount, uint16 spell_id = 0, int8 buffslot = -1, bool iBuffTic = false);
|
bool ChangeHP(Mob* other, int32 amount, uint16 spell_id = 0, int8 buffslot = -1, bool iBuffTic = false);
|
||||||
@ -556,7 +557,7 @@ public:
|
|||||||
static uint8 GetDefaultGender(uint16 in_race, uint8 in_gender = 0xFF);
|
static uint8 GetDefaultGender(uint16 in_race, uint8 in_gender = 0xFF);
|
||||||
static bool IsPlayerRace(uint16 in_race);
|
static bool IsPlayerRace(uint16 in_race);
|
||||||
uint16 GetSkillByItemType(int ItemType);
|
uint16 GetSkillByItemType(int ItemType);
|
||||||
uint8 GetItemTypeBySkill(SkillUseTypes skill);
|
uint8 GetItemTypeBySkill(EQEmu::skills::SkillType skill);
|
||||||
virtual void MakePet(uint16 spell_id, const char* pettype, const char *petname = nullptr);
|
virtual void MakePet(uint16 spell_id, const char* pettype, const char *petname = nullptr);
|
||||||
virtual void MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, const char *petname = nullptr, float in_size = 0.0f);
|
virtual void MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, const char *petname = nullptr, float in_size = 0.0f);
|
||||||
bool IsWarriorClass() const;
|
bool IsWarriorClass() const;
|
||||||
@ -649,7 +650,7 @@ public:
|
|||||||
int32 GetVulnerability(Mob* caster, uint32 spell_id, uint32 ticsremaining);
|
int32 GetVulnerability(Mob* caster, uint32 spell_id, uint32 ticsremaining);
|
||||||
int32 GetFcDamageAmtIncoming(Mob *caster, uint32 spell_id, bool use_skill = false, uint16 skill=0);
|
int32 GetFcDamageAmtIncoming(Mob *caster, uint32 spell_id, bool use_skill = false, uint16 skill=0);
|
||||||
int32 GetFocusIncoming(focusType type, int effect, Mob *caster, uint32 spell_id);
|
int32 GetFocusIncoming(focusType type, int effect, Mob *caster, uint32 spell_id);
|
||||||
int16 GetSkillDmgTaken(const SkillUseTypes skill_used,ExtraAttackOptions *opts=nullptr);
|
int16 GetSkillDmgTaken(const EQEmu::skills::SkillType skill_used, ExtraAttackOptions *opts = nullptr);
|
||||||
void DoKnockback(Mob *caster, uint32 pushback, uint32 pushup);
|
void DoKnockback(Mob *caster, uint32 pushback, uint32 pushup);
|
||||||
int16 CalcResistChanceBonus();
|
int16 CalcResistChanceBonus();
|
||||||
int16 CalcFearResistChance();
|
int16 CalcFearResistChance();
|
||||||
@ -682,8 +683,8 @@ public:
|
|||||||
inline void SetSpellPowerDistanceMod(int16 value) { SpellPowerDistanceMod = value; };
|
inline void SetSpellPowerDistanceMod(int16 value) { SpellPowerDistanceMod = value; };
|
||||||
int32 GetSpellStat(uint32 spell_id, const char *identifier, uint8 slot = 0);
|
int32 GetSpellStat(uint32 spell_id, const char *identifier, uint8 slot = 0);
|
||||||
|
|
||||||
void ModSkillDmgTaken(SkillUseTypes skill_num, int value);
|
void ModSkillDmgTaken(EQEmu::skills::SkillType skill_num, int value);
|
||||||
int16 GetModSkillDmgTaken(const SkillUseTypes skill_num);
|
int16 GetModSkillDmgTaken(const EQEmu::skills::SkillType skill_num);
|
||||||
void ModVulnerability(uint8 resist, int16 value);
|
void ModVulnerability(uint8 resist, int16 value);
|
||||||
int16 GetModVulnerability(const uint8 resist);
|
int16 GetModVulnerability(const uint8 resist);
|
||||||
|
|
||||||
@ -768,7 +769,7 @@ public:
|
|||||||
int32 GetMeleeMitigation();
|
int32 GetMeleeMitigation();
|
||||||
|
|
||||||
uint8 GetWeaponDamageBonus(const EQEmu::Item_Struct* weapon, bool offhand = false);
|
uint8 GetWeaponDamageBonus(const EQEmu::Item_Struct* weapon, bool offhand = false);
|
||||||
uint16 GetDamageTable(SkillUseTypes skillinuse);
|
uint16 GetDamageTable(EQEmu::skills::SkillType skillinuse);
|
||||||
virtual int GetHandToHandDamage(void);
|
virtual int GetHandToHandDamage(void);
|
||||||
|
|
||||||
bool CanThisClassDoubleAttack(void) const;
|
bool CanThisClassDoubleAttack(void) const;
|
||||||
@ -791,11 +792,11 @@ public:
|
|||||||
int32 AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTic, Mob* attacker);
|
int32 AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTic, Mob* attacker);
|
||||||
int32 ReduceAllDamage(int32 damage);
|
int32 ReduceAllDamage(int32 damage);
|
||||||
|
|
||||||
virtual void DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage, int32 min_damage = 1, int32 hate_override = -1, int ReuseTime = 10, bool CheckHitChance=false, bool CanAvoid=true);
|
virtual void DoSpecialAttackDamage(Mob *who, EQEmu::skills::SkillType skill, int32 max_damage, int32 min_damage = 1, int32 hate_override = -1, int ReuseTime = 10, bool CheckHitChance = false, bool CanAvoid = true);
|
||||||
virtual void DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const EQEmu::Item_Struct* AmmoItem=nullptr, uint16 weapon_damage=0, int16 chance_mod=0,int16 focus=0, int ReuseTime=0, uint32 range_id=0, int AmmoSlot=0, float speed = 4.0f);
|
virtual void DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const EQEmu::Item_Struct* AmmoItem=nullptr, uint16 weapon_damage=0, int16 chance_mod=0,int16 focus=0, int ReuseTime=0, uint32 range_id=0, int AmmoSlot=0, float speed = 4.0f);
|
||||||
virtual void DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes skillinuse, int16 chance_mod=0, int16 focus=0, bool CanRiposte=false, int ReuseTime=0);
|
virtual void DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, EQEmu::skills::SkillType skillinuse, int16 chance_mod = 0, int16 focus = 0, bool CanRiposte = false, int ReuseTime = 0);
|
||||||
virtual void DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const ItemInst* Ammo=nullptr, uint16 weapon_damage=0, int16 chance_mod=0, int16 focus=0, int ReuseTime=0, uint32 range_id=0, uint32 ammo_id=0, const EQEmu::Item_Struct *AmmoItem=nullptr, int AmmoSlot=0, float speed= 4.0f);
|
virtual void DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon=nullptr, const ItemInst* Ammo=nullptr, uint16 weapon_damage=0, int16 chance_mod=0, int16 focus=0, int ReuseTime=0, uint32 range_id=0, uint32 ammo_id=0, const EQEmu::Item_Struct *AmmoItem=nullptr, int AmmoSlot=0, float speed= 4.0f);
|
||||||
bool TryProjectileAttack(Mob* other, const EQEmu::Item_Struct *item, SkillUseTypes skillInUse, uint16 weapon_dmg, const ItemInst* RangeWeapon, const ItemInst* Ammo, int AmmoSlot, float speed);
|
bool TryProjectileAttack(Mob* other, const EQEmu::Item_Struct *item, EQEmu::skills::SkillType skillInUse, uint16 weapon_dmg, const ItemInst* RangeWeapon, const ItemInst* Ammo, int AmmoSlot, float speed);
|
||||||
void ProjectileAttack();
|
void ProjectileAttack();
|
||||||
inline bool HasProjectileAttack() const { return ActiveProjectileATK; }
|
inline bool HasProjectileAttack() const { return ActiveProjectileATK; }
|
||||||
inline void SetProjectileAttack(bool value) { ActiveProjectileATK = value; }
|
inline void SetProjectileAttack(bool value) { ActiveProjectileATK = value; }
|
||||||
@ -913,7 +914,7 @@ public:
|
|||||||
// HP Event
|
// HP Event
|
||||||
inline int GetNextHPEvent() const { return nexthpevent; }
|
inline int GetNextHPEvent() const { return nexthpevent; }
|
||||||
void SetNextHPEvent( int hpevent );
|
void SetNextHPEvent( int hpevent );
|
||||||
void SendItemAnimation(Mob *to, const EQEmu::Item_Struct *item, SkillUseTypes skillInUse, float velocity= 4.0);
|
void SendItemAnimation(Mob *to, const EQEmu::Item_Struct *item, EQEmu::skills::SkillType skillInUse, float velocity = 4.0);
|
||||||
inline int& GetNextIncHPEvent() { return nextinchpevent; }
|
inline int& GetNextIncHPEvent() { return nextinchpevent; }
|
||||||
void SetNextIncHPEvent( int inchpevent );
|
void SetNextIncHPEvent( int inchpevent );
|
||||||
|
|
||||||
@ -964,7 +965,7 @@ public:
|
|||||||
|
|
||||||
bool HasSpellEffect(int effectid);
|
bool HasSpellEffect(int effectid);
|
||||||
int mod_effect_value(int effect_value, uint16 spell_id, int effect_type, Mob* caster, uint16 caster_id);
|
int mod_effect_value(int effect_value, uint16 spell_id, int effect_type, Mob* caster, uint16 caster_id);
|
||||||
float mod_hit_chance(float chancetohit, SkillUseTypes skillinuse, Mob* attacker);
|
float mod_hit_chance(float chancetohit, EQEmu::skills::SkillType skillinuse, Mob* attacker);
|
||||||
float mod_riposte_chance(float ripostchance, Mob* attacker);
|
float mod_riposte_chance(float ripostchance, Mob* attacker);
|
||||||
float mod_block_chance(float blockchance, Mob* attacker);
|
float mod_block_chance(float blockchance, Mob* attacker);
|
||||||
float mod_parry_chance(float parrychance, Mob* attacker);
|
float mod_parry_chance(float parrychance, Mob* attacker);
|
||||||
@ -975,7 +976,7 @@ public:
|
|||||||
int32 mod_kick_damage(int32 dmg);
|
int32 mod_kick_damage(int32 dmg);
|
||||||
int32 mod_bash_damage(int32 dmg);
|
int32 mod_bash_damage(int32 dmg);
|
||||||
int32 mod_frenzy_damage(int32 dmg);
|
int32 mod_frenzy_damage(int32 dmg);
|
||||||
int32 mod_monk_special_damage(int32 ndamage, SkillUseTypes skill_type);
|
int32 mod_monk_special_damage(int32 ndamage, EQEmu::skills::SkillType skill_type);
|
||||||
int32 mod_backstab_damage(int32 ndamage);
|
int32 mod_backstab_damage(int32 ndamage);
|
||||||
int mod_archery_bonus_chance(int bonuschance, const ItemInst* RangeWeapon);
|
int mod_archery_bonus_chance(int bonuschance, const ItemInst* RangeWeapon);
|
||||||
uint32 mod_archery_bonus_damage(uint32 MaxDmg, const ItemInst* RangeWeapon);
|
uint32 mod_archery_bonus_damage(uint32 MaxDmg, const ItemInst* RangeWeapon);
|
||||||
@ -994,7 +995,7 @@ public:
|
|||||||
uint32 Tune_GetMeanDamage(Mob* GM, Mob *attacker, int32 damage, int32 minhit, ExtraAttackOptions *opts = nullptr, int Msg = 0,int ac_override=0, int atk_override=0, int add_ac=0, int add_atk = 0);
|
uint32 Tune_GetMeanDamage(Mob* GM, Mob *attacker, int32 damage, int32 minhit, ExtraAttackOptions *opts = nullptr, int Msg = 0,int ac_override=0, int atk_override=0, int add_ac=0, int add_atk = 0);
|
||||||
void Tune_FindATKByPctMitigation(Mob* defender, Mob *attacker, float pct_mitigation, int interval = 50, int max_loop = 100, int ac_override=0,int Msg =0);
|
void Tune_FindATKByPctMitigation(Mob* defender, Mob *attacker, float pct_mitigation, int interval = 50, int max_loop = 100, int ac_override=0,int Msg =0);
|
||||||
void Tune_FindACByPctMitigation(Mob* defender, Mob *attacker, float pct_mitigation, int interval = 50, int max_loop = 100, int atk_override=0,int Msg =0);
|
void Tune_FindACByPctMitigation(Mob* defender, Mob *attacker, float pct_mitigation, int interval = 50, int max_loop = 100, int atk_override=0,int Msg =0);
|
||||||
float Tune_CheckHitChance(Mob* defender, Mob* attacker, SkillUseTypes skillinuse, int Hand, int16 chance_mod, int Msg = 1,int acc_override=0, int avoid_override=0, int add_acc=0, int add_avoid = 0);
|
float Tune_CheckHitChance(Mob* defender, Mob* attacker, EQEmu::skills::SkillType skillinuse, int Hand, int16 chance_mod, int Msg = 1, int acc_override = 0, int avoid_override = 0, int add_acc = 0, int add_avoid = 0);
|
||||||
void Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_chance, int interval, int max_loop, int avoid_override, int Msg = 0);
|
void Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_chance, int interval, int max_loop, int avoid_override, int Msg = 0);
|
||||||
void Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_chance, int interval, int max_loop, int acc_override, int Msg = 0);
|
void Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_chance, int interval, int max_loop, int acc_override, int Msg = 0);
|
||||||
|
|
||||||
@ -1031,7 +1032,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void CommonDamage(Mob* other, int32 &damage, const uint16 spell_id, const SkillUseTypes attack_skill, bool &avoidable, const int8 buffslot, const bool iBuffTic, int special = 0);
|
void CommonDamage(Mob* other, int32 &damage, const uint16 spell_id, const EQEmu::skills::SkillType attack_skill, bool &avoidable, const int8 buffslot, const bool iBuffTic, int special = 0);
|
||||||
static uint16 GetProcID(uint16 spell_id, uint8 effect_index);
|
static uint16 GetProcID(uint16 spell_id, uint8 effect_index);
|
||||||
float _GetMovementSpeed(int mod) const;
|
float _GetMovementSpeed(int mod) const;
|
||||||
int _GetWalkSpeed() const;
|
int _GetWalkSpeed() const;
|
||||||
@ -1049,7 +1050,7 @@ protected:
|
|||||||
std::vector<uint16> RampageArray;
|
std::vector<uint16> RampageArray;
|
||||||
std::map<std::string, std::string> m_EntityVariables;
|
std::map<std::string, std::string> m_EntityVariables;
|
||||||
|
|
||||||
int16 SkillDmgTaken_Mod[HIGHEST_SKILL+2];
|
int16 SkillDmgTaken_Mod[EQEmu::skills::HIGHEST_SKILL + 2];
|
||||||
int16 Vulnerability_Mod[HIGHEST_RESIST+2];
|
int16 Vulnerability_Mod[HIGHEST_RESIST+2];
|
||||||
bool m_AllowBeneficial;
|
bool m_AllowBeneficial;
|
||||||
bool m_DisableMelee;
|
bool m_DisableMelee;
|
||||||
@ -1165,7 +1166,7 @@ protected:
|
|||||||
int GetWeaponDamage(Mob *against, const ItemInst *weapon_item, uint32 *hate = nullptr);
|
int GetWeaponDamage(Mob *against, const ItemInst *weapon_item, uint32 *hate = nullptr);
|
||||||
int GetKickDamage();
|
int GetKickDamage();
|
||||||
int GetBashDamage();
|
int GetBashDamage();
|
||||||
virtual void ApplySpecialAttackMod(SkillUseTypes skill, int32 &dmg, int32 &mindmg);
|
virtual void ApplySpecialAttackMod(EQEmu::skills::SkillType skill, int32 &dmg, int32 &mindmg);
|
||||||
virtual int16 GetFocusEffect(focusType type, uint16 spell_id) { return 0; }
|
virtual int16 GetFocusEffect(focusType type, uint16 spell_id) { return 0; }
|
||||||
void CalculateNewFearpoint();
|
void CalculateNewFearpoint();
|
||||||
float FindGroundZ(float new_x, float new_y, float z_offset=0.0);
|
float FindGroundZ(float new_x, float new_y, float z_offset=0.0);
|
||||||
|
|||||||
@ -29,7 +29,7 @@ void Zone::mod_repop() { return; }
|
|||||||
void NPC::mod_prespawn(Spawn2 *sp) { return; }
|
void NPC::mod_prespawn(Spawn2 *sp) { return; }
|
||||||
|
|
||||||
//Base damage from NPC::Attack
|
//Base damage from NPC::Attack
|
||||||
int NPC::mod_npc_damage(int damage, SkillUseTypes skillinuse, int hand, const EQEmu::Item_Struct* weapon, Mob* other) { return(damage); }
|
int NPC::mod_npc_damage(int damage, EQEmu::skills::SkillType skillinuse, int hand, const EQEmu::Item_Struct* weapon, Mob* other) { return(damage); }
|
||||||
|
|
||||||
//Mob c has been given credit for a kill. This is called after the regular EVENT_KILLED_MERIT event.
|
//Mob c has been given credit for a kill. This is called after the regular EVENT_KILLED_MERIT event.
|
||||||
void NPC::mod_npc_killed_merit(Mob* c) { return; }
|
void NPC::mod_npc_killed_merit(Mob* c) { return; }
|
||||||
@ -38,7 +38,7 @@ void NPC::mod_npc_killed_merit(Mob* c) { return; }
|
|||||||
void NPC::mod_npc_killed(Mob* oos) { return; }
|
void NPC::mod_npc_killed(Mob* oos) { return; }
|
||||||
|
|
||||||
//Base damage from Client::Attack - can cover myriad skill types
|
//Base damage from Client::Attack - can cover myriad skill types
|
||||||
int Client::mod_client_damage(int damage, SkillUseTypes skillinuse, int hand, const ItemInst* weapon, Mob* other) { return(damage); }
|
int Client::mod_client_damage(int damage, EQEmu::skills::SkillType skillinuse, int hand, const ItemInst* weapon, Mob* other) { return(damage); }
|
||||||
|
|
||||||
//message is char[4096], don't screw it up. Return true for normal behavior, false to return immediately.
|
//message is char[4096], don't screw it up. Return true for normal behavior, false to return immediately.
|
||||||
// Channels:
|
// Channels:
|
||||||
@ -58,7 +58,7 @@ bool Client::mod_client_message(char* message, uint8 chan_num) { return(true); }
|
|||||||
|
|
||||||
//Skillup override. When this is called the regular skillup check has failed. Return false to proceed with default behavior.
|
//Skillup override. When this is called the regular skillup check has failed. Return false to proceed with default behavior.
|
||||||
//This will NOT allow a client to increase skill past a cap.
|
//This will NOT allow a client to increase skill past a cap.
|
||||||
bool Client::mod_can_increase_skill(SkillUseTypes skillid, Mob* against_who) { return(false); }
|
bool Client::mod_can_increase_skill(EQEmu::skills::SkillType skillid, Mob* against_who) { return(false); }
|
||||||
|
|
||||||
//chance of general skill increase, rolled against 0-99 where higher chance is better.
|
//chance of general skill increase, rolled against 0-99 where higher chance is better.
|
||||||
int16 Client::mod_increase_skill_chance(int16 chance, Mob* against_who) { return(chance); }
|
int16 Client::mod_increase_skill_chance(int16 chance, Mob* against_who) { return(chance); }
|
||||||
@ -114,7 +114,7 @@ int Client::mod_drink_value(const EQEmu::Item_Struct *item, int change) { return
|
|||||||
int Mob::mod_effect_value(int effect_value, uint16 spell_id, int effect_type, Mob* caster, uint16 caster_id) { return(effect_value); }
|
int Mob::mod_effect_value(int effect_value, uint16 spell_id, int effect_type, Mob* caster, uint16 caster_id) { return(effect_value); }
|
||||||
|
|
||||||
//chancetohit - 0 to 100 percent - set over 1000 for a guaranteed hit
|
//chancetohit - 0 to 100 percent - set over 1000 for a guaranteed hit
|
||||||
float Mob::mod_hit_chance(float chancetohit, SkillUseTypes skillinuse, Mob* attacker) { return(chancetohit); }
|
float Mob::mod_hit_chance(float chancetohit, EQEmu::skills::SkillType skillinuse, Mob* attacker) { return(chancetohit); }
|
||||||
|
|
||||||
//Final riposte chance
|
//Final riposte chance
|
||||||
float Mob::mod_riposte_chance(float ripostechance, Mob* attacker) { return(ripostechance); }
|
float Mob::mod_riposte_chance(float ripostechance, Mob* attacker) { return(ripostechance); }
|
||||||
@ -146,7 +146,7 @@ int32 Mob::mod_bash_damage(int32 dmg) { return(dmg); }
|
|||||||
int32 Mob::mod_frenzy_damage(int32 dmg) { return(dmg); }
|
int32 Mob::mod_frenzy_damage(int32 dmg) { return(dmg); }
|
||||||
|
|
||||||
//Special attack damage after all other bonuses are applied.
|
//Special attack damage after all other bonuses are applied.
|
||||||
int32 Mob::mod_monk_special_damage(int32 ndamage, SkillUseTypes skill_type) { return(ndamage); }
|
int32 Mob::mod_monk_special_damage(int32 ndamage, EQEmu::skills::SkillType skill_type) { return(ndamage); }
|
||||||
|
|
||||||
//ndamage - Backstab damage as calculated by default formulas
|
//ndamage - Backstab damage as calculated by default formulas
|
||||||
int32 Mob::mod_backstab_damage(int32 ndamage) { return(ndamage); }
|
int32 Mob::mod_backstab_damage(int32 ndamage) { return(ndamage); }
|
||||||
|
|||||||
19
zone/npc.cpp
19
zone/npc.cpp
@ -30,6 +30,7 @@
|
|||||||
#include "../common/item_struct.h"
|
#include "../common/item_struct.h"
|
||||||
#include "../common/linked_list.h"
|
#include "../common/linked_list.h"
|
||||||
#include "../common/servertalk.h"
|
#include "../common/servertalk.h"
|
||||||
|
#include "../common/say_link.h"
|
||||||
|
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "entity.h"
|
#include "entity.h"
|
||||||
@ -276,20 +277,20 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, const glm::vec4& position, int if
|
|||||||
|
|
||||||
//give NPCs skill values...
|
//give NPCs skill values...
|
||||||
int r;
|
int r;
|
||||||
for(r = 0; r <= HIGHEST_SKILL; r++) {
|
for (r = 0; r <= EQEmu::skills::HIGHEST_SKILL; r++) {
|
||||||
skills[r] = database.GetSkillCap(GetClass(),(SkillUseTypes)r,moblevel);
|
skills[r] = database.GetSkillCap(GetClass(), (EQEmu::skills::SkillType)r, moblevel);
|
||||||
}
|
}
|
||||||
// some overrides -- really we need to be able to set skills for mobs in the DB
|
// some overrides -- really we need to be able to set skills for mobs in the DB
|
||||||
// There are some known low level SHM/BST pets that do not follow this, which supports
|
// There are some known low level SHM/BST pets that do not follow this, which supports
|
||||||
// the theory of needing to be able to set skills for each mob separately
|
// the theory of needing to be able to set skills for each mob separately
|
||||||
if (moblevel > 50) {
|
if (moblevel > 50) {
|
||||||
skills[SkillDoubleAttack] = 250;
|
skills[EQEmu::skills::SkillDoubleAttack] = 250;
|
||||||
skills[SkillDualWield] = 250;
|
skills[EQEmu::skills::SkillDualWield] = 250;
|
||||||
} else if (moblevel > 3) {
|
} else if (moblevel > 3) {
|
||||||
skills[SkillDoubleAttack] = moblevel * 5;
|
skills[EQEmu::skills::SkillDoubleAttack] = moblevel * 5;
|
||||||
skills[SkillDualWield] = skills[SkillDoubleAttack];
|
skills[EQEmu::skills::SkillDualWield] = skills[EQEmu::skills::SkillDoubleAttack];
|
||||||
} else {
|
} else {
|
||||||
skills[SkillDoubleAttack] = moblevel * 5;
|
skills[EQEmu::skills::SkillDoubleAttack] = moblevel * 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(d->trap_template > 0)
|
if(d->trap_template > 0)
|
||||||
@ -1427,7 +1428,7 @@ uint32 NPC::GetMaxDamage(uint8 tlevel)
|
|||||||
|
|
||||||
void NPC::PickPocket(Client* thief)
|
void NPC::PickPocket(Client* thief)
|
||||||
{
|
{
|
||||||
thief->CheckIncreaseSkill(SkillPickPockets, nullptr, 5);
|
thief->CheckIncreaseSkill(EQEmu::skills::SkillPickPockets, nullptr, 5);
|
||||||
|
|
||||||
//make sure were allowed to target them:
|
//make sure were allowed to target them:
|
||||||
int over_level = GetLevel();
|
int over_level = GetLevel();
|
||||||
@ -1446,7 +1447,7 @@ void NPC::PickPocket(Client* thief)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int steal_skill = thief->GetSkill(SkillPickPockets);
|
int steal_skill = thief->GetSkill(EQEmu::skills::SkillPickPockets);
|
||||||
int steal_chance = steal_skill * 100 / (5 * over_level + 5);
|
int steal_chance = steal_skill * 100 / (5 * over_level + 5);
|
||||||
|
|
||||||
// Determine whether to steal money or an item.
|
// Determine whether to steal money or an item.
|
||||||
|
|||||||
12
zone/npc.h
12
zone/npc.h
@ -108,8 +108,8 @@ public:
|
|||||||
virtual ~NPC();
|
virtual ~NPC();
|
||||||
|
|
||||||
//abstract virtual function implementations requird by base abstract class
|
//abstract virtual function implementations requird by base abstract class
|
||||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill);
|
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill);
|
||||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
|
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, EQEmu::skills::SkillType attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, int special = 0);
|
||||||
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
virtual bool Attack(Mob* other, int Hand = EQEmu::legacy::SlotPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||||
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0);
|
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr, int special = 0);
|
||||||
virtual bool HasRaid() { return false; }
|
virtual bool HasRaid() { return false; }
|
||||||
@ -142,7 +142,7 @@ public:
|
|||||||
void CalcNPCDamage();
|
void CalcNPCDamage();
|
||||||
|
|
||||||
virtual void SetTarget(Mob* mob);
|
virtual void SetTarget(Mob* mob);
|
||||||
virtual uint16 GetSkill(SkillUseTypes skill_num) const { if (skill_num <= HIGHEST_SKILL) { return skills[skill_num]; } return 0; }
|
virtual uint16 GetSkill(EQEmu::skills::SkillType skill_num) const { if (skill_num <= EQEmu::skills::HIGHEST_SKILL) { return skills[skill_num]; } return 0; }
|
||||||
|
|
||||||
void CalcItemBonuses(StatBonuses *newbon);
|
void CalcItemBonuses(StatBonuses *newbon);
|
||||||
virtual void CalcBonuses();
|
virtual void CalcBonuses();
|
||||||
@ -161,7 +161,7 @@ public:
|
|||||||
virtual void RangedAttack(Mob* other);
|
virtual void RangedAttack(Mob* other);
|
||||||
virtual void ThrowingAttack(Mob* other) { }
|
virtual void ThrowingAttack(Mob* other) { }
|
||||||
int32 GetNumberOfAttacks() const { return attack_count; }
|
int32 GetNumberOfAttacks() const { return attack_count; }
|
||||||
void DoRangedAttackDmg(Mob* other, bool Launch=true, int16 damage_mod=0, int16 chance_mod=0, SkillUseTypes skill=SkillArchery, float speed=4.0f, const char *IDFile = nullptr);
|
void DoRangedAttackDmg(Mob* other, bool Launch = true, int16 damage_mod = 0, int16 chance_mod = 0, EQEmu::skills::SkillType skill = EQEmu::skills::SkillArchery, float speed = 4.0f, const char *IDFile = nullptr);
|
||||||
|
|
||||||
bool DatabaseCastAccepted(int spell_id);
|
bool DatabaseCastAccepted(int spell_id);
|
||||||
bool IsFactionListAlly(uint32 other_faction);
|
bool IsFactionListAlly(uint32 other_faction);
|
||||||
@ -403,7 +403,7 @@ public:
|
|||||||
void SetMerchantProbability(uint8 amt) { probability = amt; }
|
void SetMerchantProbability(uint8 amt) { probability = amt; }
|
||||||
uint8 GetMerchantProbability() { return probability; }
|
uint8 GetMerchantProbability() { return probability; }
|
||||||
void mod_prespawn(Spawn2 *sp);
|
void mod_prespawn(Spawn2 *sp);
|
||||||
int mod_npc_damage(int damage, SkillUseTypes skillinuse, int hand, const EQEmu::Item_Struct* weapon, Mob* other);
|
int mod_npc_damage(int damage, EQEmu::skills::SkillType skillinuse, int hand, const EQEmu::Item_Struct* weapon, Mob* other);
|
||||||
void mod_npc_killed_merit(Mob* c);
|
void mod_npc_killed_merit(Mob* c);
|
||||||
void mod_npc_killed(Mob* oos);
|
void mod_npc_killed(Mob* oos);
|
||||||
void AISpellsList(Client *c);
|
void AISpellsList(Client *c);
|
||||||
@ -497,7 +497,7 @@ protected:
|
|||||||
uint32 roambox_delay;
|
uint32 roambox_delay;
|
||||||
uint32 roambox_min_delay;
|
uint32 roambox_min_delay;
|
||||||
|
|
||||||
uint16 skills[HIGHEST_SKILL+1];
|
uint16 skills[EQEmu::skills::HIGHEST_SKILL + 1];
|
||||||
|
|
||||||
uint32 equipment[EQEmu::legacy::EQUIPMENT_SIZE]; //this is an array of item IDs
|
uint32 equipment[EQEmu::legacy::EQUIPMENT_SIZE]; //this is an array of item IDs
|
||||||
|
|
||||||
|
|||||||
@ -108,7 +108,7 @@ public:
|
|||||||
static void HandleAugmentation(Client* user, const AugmentItem_Struct* in_augment, Object *worldo);
|
static void HandleAugmentation(Client* user, const AugmentItem_Struct* in_augment, Object *worldo);
|
||||||
static void HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac);
|
static void HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac);
|
||||||
|
|
||||||
static SkillUseTypes TypeToSkill(uint32 type);
|
static EQEmu::skills::SkillType TypeToSkill(uint32 type);
|
||||||
|
|
||||||
// Packet functions
|
// Packet functions
|
||||||
void CreateSpawnPacket(EQApplicationPacket* app);
|
void CreateSpawnPacket(EQApplicationPacket* app);
|
||||||
|
|||||||
@ -1940,7 +1940,7 @@ XS(XS_Client_GetSkill)
|
|||||||
Client * THIS;
|
Client * THIS;
|
||||||
uint16 RETVAL;
|
uint16 RETVAL;
|
||||||
dXSTARG;
|
dXSTARG;
|
||||||
SkillUseTypes skill_id = (SkillUseTypes)SvUV(ST(1));
|
EQEmu::skills::SkillType skill_id = (EQEmu::skills::SkillType)SvUV(ST(1));
|
||||||
|
|
||||||
if (sv_derived_from(ST(0), "Client")) {
|
if (sv_derived_from(ST(0), "Client")) {
|
||||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||||
@ -1967,7 +1967,7 @@ XS(XS_Client_GetRawSkill)
|
|||||||
Client * THIS;
|
Client * THIS;
|
||||||
uint32 RETVAL;
|
uint32 RETVAL;
|
||||||
dXSTARG;
|
dXSTARG;
|
||||||
SkillUseTypes skill_id = (SkillUseTypes)SvUV(ST(1));
|
EQEmu::skills::SkillType skill_id = (EQEmu::skills::SkillType)SvUV(ST(1));
|
||||||
|
|
||||||
if (sv_derived_from(ST(0), "Client")) {
|
if (sv_derived_from(ST(0), "Client")) {
|
||||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||||
@ -1993,7 +1993,7 @@ XS(XS_Client_HasSkill)
|
|||||||
{
|
{
|
||||||
Client * THIS;
|
Client * THIS;
|
||||||
bool RETVAL;
|
bool RETVAL;
|
||||||
SkillUseTypes skill_id = (SkillUseTypes)SvUV(ST(1));
|
EQEmu::skills::SkillType skill_id = (EQEmu::skills::SkillType)SvUV(ST(1));
|
||||||
|
|
||||||
if (sv_derived_from(ST(0), "Client")) {
|
if (sv_derived_from(ST(0), "Client")) {
|
||||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||||
@ -2020,7 +2020,7 @@ XS(XS_Client_CanHaveSkill)
|
|||||||
{
|
{
|
||||||
Client * THIS;
|
Client * THIS;
|
||||||
bool RETVAL;
|
bool RETVAL;
|
||||||
SkillUseTypes skill_id = (SkillUseTypes)SvUV(ST(1));
|
EQEmu::skills::SkillType skill_id = (EQEmu::skills::SkillType)SvUV(ST(1));
|
||||||
|
|
||||||
if (sv_derived_from(ST(0), "Client")) {
|
if (sv_derived_from(ST(0), "Client")) {
|
||||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||||
@ -2046,7 +2046,7 @@ XS(XS_Client_SetSkill)
|
|||||||
Perl_croak(aTHX_ "Usage: Client::SetSkill(THIS, skill_num, value)");
|
Perl_croak(aTHX_ "Usage: Client::SetSkill(THIS, skill_num, value)");
|
||||||
{
|
{
|
||||||
Client * THIS;
|
Client * THIS;
|
||||||
SkillUseTypes skill_num = (SkillUseTypes)SvUV(ST(1));
|
EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType)SvUV(ST(1));
|
||||||
uint16 value = (uint16)SvUV(ST(2));
|
uint16 value = (uint16)SvUV(ST(2));
|
||||||
|
|
||||||
if (sv_derived_from(ST(0), "Client")) {
|
if (sv_derived_from(ST(0), "Client")) {
|
||||||
@ -2071,7 +2071,7 @@ XS(XS_Client_AddSkill)
|
|||||||
Perl_croak(aTHX_ "Usage: Client::AddSkill(THIS, skillid, value)");
|
Perl_croak(aTHX_ "Usage: Client::AddSkill(THIS, skillid, value)");
|
||||||
{
|
{
|
||||||
Client * THIS;
|
Client * THIS;
|
||||||
SkillUseTypes skillid = (SkillUseTypes)SvUV(ST(1));
|
EQEmu::skills::SkillType skillid = (EQEmu::skills::SkillType)SvUV(ST(1));
|
||||||
uint16 value = (uint16)SvUV(ST(2));
|
uint16 value = (uint16)SvUV(ST(2));
|
||||||
|
|
||||||
if (sv_derived_from(ST(0), "Client")) {
|
if (sv_derived_from(ST(0), "Client")) {
|
||||||
@ -2121,7 +2121,7 @@ XS(XS_Client_CheckIncreaseSkill)
|
|||||||
{
|
{
|
||||||
Client * THIS;
|
Client * THIS;
|
||||||
bool RETVAL;
|
bool RETVAL;
|
||||||
SkillUseTypes skillid = (SkillUseTypes)SvUV(ST(1));
|
EQEmu::skills::SkillType skillid = (EQEmu::skills::SkillType)SvUV(ST(1));
|
||||||
int chancemodi;
|
int chancemodi;
|
||||||
|
|
||||||
if (sv_derived_from(ST(0), "Client")) {
|
if (sv_derived_from(ST(0), "Client")) {
|
||||||
@ -2180,7 +2180,7 @@ XS(XS_Client_MaxSkill)
|
|||||||
{
|
{
|
||||||
Client * THIS;
|
Client * THIS;
|
||||||
uint16 RETVAL;
|
uint16 RETVAL;
|
||||||
SkillUseTypes skillid = (SkillUseTypes)SvUV(ST(1));
|
EQEmu::skills::SkillType skillid = (EQEmu::skills::SkillType)SvUV(ST(1));
|
||||||
uint16 class_ = 0;
|
uint16 class_ = 0;
|
||||||
uint16 level = 0;
|
uint16 level = 0;
|
||||||
dXSTARG;
|
dXSTARG;
|
||||||
|
|||||||
@ -619,7 +619,7 @@ XS(XS_Mob_GetSkill)
|
|||||||
Mob * THIS;
|
Mob * THIS;
|
||||||
uint32 RETVAL;
|
uint32 RETVAL;
|
||||||
dXSTARG;
|
dXSTARG;
|
||||||
SkillUseTypes skill_num = (SkillUseTypes)SvUV(ST(1));
|
EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType)SvUV(ST(1));
|
||||||
|
|
||||||
if (sv_derived_from(ST(0), "Mob")) {
|
if (sv_derived_from(ST(0), "Mob")) {
|
||||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||||
@ -901,7 +901,7 @@ XS(XS_Mob_Damage)
|
|||||||
Mob* from;
|
Mob* from;
|
||||||
int32 damage = (int32)SvIV(ST(2));
|
int32 damage = (int32)SvIV(ST(2));
|
||||||
uint16 spell_id = (uint16)SvUV(ST(3));
|
uint16 spell_id = (uint16)SvUV(ST(3));
|
||||||
SkillUseTypes attack_skill = (SkillUseTypes)SvUV(ST(4));
|
EQEmu::skills::SkillType attack_skill = (EQEmu::skills::SkillType)SvUV(ST(4));
|
||||||
bool avoidable;
|
bool avoidable;
|
||||||
int8 buffslot;
|
int8 buffslot;
|
||||||
bool iBuffTic;
|
bool iBuffTic;
|
||||||
@ -6836,7 +6836,7 @@ XS(XS_Mob_DoSpecialAttackDamage)
|
|||||||
{
|
{
|
||||||
Mob * THIS;
|
Mob * THIS;
|
||||||
Mob* target;
|
Mob* target;
|
||||||
SkillUseTypes attack_skill = (SkillUseTypes)SvUV(ST(2));
|
EQEmu::skills::SkillType attack_skill = (EQEmu::skills::SkillType)SvUV(ST(2));
|
||||||
int32 max_damage = (int32)SvIV(ST(3));
|
int32 max_damage = (int32)SvIV(ST(3));
|
||||||
int32 min_damage = 1;
|
int32 min_damage = 1;
|
||||||
int32 hate_override = -11;
|
int32 hate_override = -11;
|
||||||
@ -7835,7 +7835,7 @@ XS(XS_Mob_ModSkillDmgTaken)
|
|||||||
Perl_croak(aTHX_ "Usage: Mob::ModSkillDmgTaken(THIS, skill, value)");
|
Perl_croak(aTHX_ "Usage: Mob::ModSkillDmgTaken(THIS, skill, value)");
|
||||||
{
|
{
|
||||||
Mob * THIS;
|
Mob * THIS;
|
||||||
SkillUseTypes skill_num = (SkillUseTypes)SvUV(ST(1));
|
EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType)SvUV(ST(1));
|
||||||
int16 value = (int16)SvIV(ST(2));
|
int16 value = (int16)SvIV(ST(2));
|
||||||
|
|
||||||
if (sv_derived_from(ST(0), "Mob")) {
|
if (sv_derived_from(ST(0), "Mob")) {
|
||||||
@ -7862,7 +7862,7 @@ XS(XS_Mob_GetModSkillDmgTaken)
|
|||||||
Mob * THIS;
|
Mob * THIS;
|
||||||
int16 RETVAL;
|
int16 RETVAL;
|
||||||
dXSTARG;
|
dXSTARG;
|
||||||
SkillUseTypes skill_num = (SkillUseTypes)SvUV(ST(1));
|
EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType)SvUV(ST(1));
|
||||||
|
|
||||||
if (sv_derived_from(ST(0), "Mob")) {
|
if (sv_derived_from(ST(0), "Mob")) {
|
||||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||||
@ -7889,7 +7889,7 @@ XS(XS_Mob_GetSkillDmgTaken)
|
|||||||
Mob * THIS;
|
Mob * THIS;
|
||||||
int32 RETVAL;
|
int32 RETVAL;
|
||||||
dXSTARG;
|
dXSTARG;
|
||||||
SkillUseTypes skill_num = (SkillUseTypes)SvUV(ST(1));
|
EQEmu::skills::SkillType skill_num = (EQEmu::skills::SkillType)SvUV(ST(1));
|
||||||
|
|
||||||
if (sv_derived_from(ST(0), "Mob")) {
|
if (sv_derived_from(ST(0), "Mob")) {
|
||||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||||
@ -8055,7 +8055,7 @@ XS(XS_Mob_DoMeleeSkillAttackDmg)
|
|||||||
Mob * THIS;
|
Mob * THIS;
|
||||||
Mob* target;
|
Mob* target;
|
||||||
uint16 weapon_damage = (uint16)SvIV(ST(2));
|
uint16 weapon_damage = (uint16)SvIV(ST(2));
|
||||||
SkillUseTypes skill = (SkillUseTypes)SvUV(ST(3));
|
EQEmu::skills::SkillType skill = (EQEmu::skills::SkillType)SvUV(ST(3));
|
||||||
int16 chance_mod = (int16)SvIV(ST(4));
|
int16 chance_mod = (int16)SvIV(ST(4));
|
||||||
int16 focus = (int16)SvIV(ST(5));
|
int16 focus = (int16)SvIV(ST(5));
|
||||||
uint8 CanRiposte = (uint8)SvIV(ST(6));
|
uint8 CanRiposte = (uint8)SvIV(ST(6));
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
#include "../common/skills.h"
|
#include "../common/skills.h"
|
||||||
#include "../common/spdat.h"
|
#include "../common/spdat.h"
|
||||||
#include "../common/string_util.h"
|
#include "../common/string_util.h"
|
||||||
|
#include "../common/say_link.h"
|
||||||
|
|
||||||
#include "entity.h"
|
#include "entity.h"
|
||||||
#include "event_codes.h"
|
#include "event_codes.h"
|
||||||
@ -1152,10 +1153,10 @@ void QuestManager::doanim(int anim_id) {
|
|||||||
|
|
||||||
void QuestManager::addskill(int skill_id, int value) {
|
void QuestManager::addskill(int skill_id, int value) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if(skill_id < 0 || skill_id > HIGHEST_SKILL)
|
if (skill_id < 0 || skill_id > EQEmu::skills::HIGHEST_SKILL)
|
||||||
return;
|
return;
|
||||||
if (initiator && initiator->IsClient())
|
if (initiator && initiator->IsClient())
|
||||||
initiator->AddSkill((SkillUseTypes) skill_id, value);
|
initiator->AddSkill((EQEmu::skills::SkillType) skill_id, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::setlanguage(int skill_id, int value) {
|
void QuestManager::setlanguage(int skill_id, int value) {
|
||||||
@ -1166,10 +1167,10 @@ void QuestManager::setlanguage(int skill_id, int value) {
|
|||||||
|
|
||||||
void QuestManager::setskill(int skill_id, int value) {
|
void QuestManager::setskill(int skill_id, int value) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if(skill_id < 0 || skill_id > HIGHEST_SKILL)
|
if (skill_id < 0 || skill_id > EQEmu::skills::HIGHEST_SKILL)
|
||||||
return;
|
return;
|
||||||
if (initiator && initiator->IsClient())
|
if (initiator && initiator->IsClient())
|
||||||
initiator->SetSkill((SkillUseTypes) skill_id, value);
|
initiator->SetSkill((EQEmu::skills::SkillType) skill_id, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::setallskill(int value) {
|
void QuestManager::setallskill(int value) {
|
||||||
@ -1177,8 +1178,8 @@ void QuestManager::setallskill(int value) {
|
|||||||
if (!initiator)
|
if (!initiator)
|
||||||
return;
|
return;
|
||||||
if (initiator && initiator->IsClient()) {
|
if (initiator && initiator->IsClient()) {
|
||||||
SkillUseTypes sk;
|
EQEmu::skills::SkillType sk;
|
||||||
for (sk = Skill1HBlunt; sk <= HIGHEST_SKILL; sk = (SkillUseTypes)(sk+1)) {
|
for (sk = EQEmu::skills::Skill1HBlunt; sk <= EQEmu::skills::HIGHEST_SKILL; sk = (EQEmu::skills::SkillType)(sk + 1)) {
|
||||||
initiator->SetSkill(sk, value);
|
initiator->SetSkill(sk, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1772,7 +1773,7 @@ void QuestManager::clear_zone_flag(int zone_id) {
|
|||||||
void QuestManager::sethp(int hpperc) {
|
void QuestManager::sethp(int hpperc) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
int newhp = (owner->GetMaxHP() * (100 - hpperc)) / 100;
|
int newhp = (owner->GetMaxHP() * (100 - hpperc)) / 100;
|
||||||
owner->Damage(owner, newhp, SPELL_UNKNOWN, SkillHandtoHand, false, 0, false);
|
owner->Damage(owner, newhp, SPELL_UNKNOWN, EQEmu::skills::SkillHandtoHand, false, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QuestManager::summonburiedplayercorpse(uint32 char_id, const glm::vec4& position) {
|
bool QuestManager::summonburiedplayercorpse(uint32 char_id, const glm::vec4& position) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -2271,18 +2271,15 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
|||||||
|
|
||||||
focus = caster->GetFocusEffect(focusFcBaseEffects, spell_id);
|
focus = caster->GetFocusEffect(focusFcBaseEffects, spell_id);
|
||||||
|
|
||||||
switch(spells[spell_id].skill)
|
switch(spells[spell_id].skill) {
|
||||||
{
|
case EQEmu::skills::SkillThrowing:
|
||||||
case SkillThrowing:
|
caster->DoThrowingAttackDmg(this, nullptr, nullptr, spells[spell_id].base[i],spells[spell_id].base2[i], focus, ReuseTime);
|
||||||
caster->DoThrowingAttackDmg(this, nullptr, nullptr, spells[spell_id].base[i],spells[spell_id].base2[i], focus, ReuseTime);
|
|
||||||
break;
|
break;
|
||||||
|
case EQEmu::skills::SkillArchery:
|
||||||
case SkillArchery:
|
caster->DoArcheryAttackDmg(this, nullptr, nullptr, spells[spell_id].base[i],spells[spell_id].base2[i],focus, ReuseTime);
|
||||||
caster->DoArcheryAttackDmg(this, nullptr, nullptr, spells[spell_id].base[i],spells[spell_id].base2[i],focus, ReuseTime);
|
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
default:
|
caster->DoMeleeSkillAttackDmg(this, spells[spell_id].base[i], spells[spell_id].skill, spells[spell_id].base2[i], focus, false, ReuseTime);
|
||||||
caster->DoMeleeSkillAttackDmg(this, spells[spell_id].base[i], spells[spell_id].skill, spells[spell_id].base2[i], focus, false, ReuseTime);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -3046,7 +3043,7 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level,
|
|||||||
effect_value = CalcSpellEffectValue_formula(formula, base, max, caster_level, spell_id, ticsremaining);
|
effect_value = CalcSpellEffectValue_formula(formula, base, max, caster_level, spell_id, ticsremaining);
|
||||||
|
|
||||||
// this doesn't actually need to be a song to get mods, just the right skill
|
// this doesn't actually need to be a song to get mods, just the right skill
|
||||||
if (EQEmu::IsBardInstrumentSkill(spells[spell_id].skill) &&
|
if (EQEmu::skills::IsBardInstrumentSkill(spells[spell_id].skill) &&
|
||||||
spells[spell_id].effectid[effect_id] != SE_AttackSpeed &&
|
spells[spell_id].effectid[effect_id] != SE_AttackSpeed &&
|
||||||
spells[spell_id].effectid[effect_id] != SE_AttackSpeed2 &&
|
spells[spell_id].effectid[effect_id] != SE_AttackSpeed2 &&
|
||||||
spells[spell_id].effectid[effect_id] != SE_AttackSpeed3 &&
|
spells[spell_id].effectid[effect_id] != SE_AttackSpeed3 &&
|
||||||
@ -3613,13 +3610,13 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
|
|||||||
if (!IsBardSong(buff.spellid)) {
|
if (!IsBardSong(buff.spellid)) {
|
||||||
double break_chance = 2.0;
|
double break_chance = 2.0;
|
||||||
if (caster) {
|
if (caster) {
|
||||||
break_chance -= (2 * (((double)caster->GetSkill(SkillDivination) +
|
break_chance -= (2 * (((double)caster->GetSkill(EQEmu::skills::SkillDivination) +
|
||||||
((double)caster->GetLevel() * 3.0)) /
|
((double)caster->GetLevel() * 3.0)) /
|
||||||
650.0));
|
650.0));
|
||||||
} else {
|
} else {
|
||||||
break_chance -=
|
break_chance -=
|
||||||
(2 *
|
(2 *
|
||||||
(((double)GetSkill(SkillDivination) + ((double)GetLevel() * 3.0)) /
|
(((double)GetSkill(EQEmu::skills::SkillDivination) + ((double)GetLevel() * 3.0)) /
|
||||||
650.0));
|
650.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6564,7 +6561,7 @@ bool Mob::TrySpellProjectile(Mob* spell_target, uint16 spell_id, float speed){
|
|||||||
ProjectileAtk[slot].origin_x = GetX();
|
ProjectileAtk[slot].origin_x = GetX();
|
||||||
ProjectileAtk[slot].origin_y = GetY();
|
ProjectileAtk[slot].origin_y = GetY();
|
||||||
ProjectileAtk[slot].origin_z = GetZ();
|
ProjectileAtk[slot].origin_z = GetZ();
|
||||||
ProjectileAtk[slot].skill = SkillConjuration;
|
ProjectileAtk[slot].skill = EQEmu::skills::SkillConjuration;
|
||||||
ProjectileAtk[slot].speed_mod = speed_mod;
|
ProjectileAtk[slot].speed_mod = speed_mod;
|
||||||
|
|
||||||
SetProjectileAttack(true);
|
SetProjectileAttack(true);
|
||||||
@ -6619,7 +6616,7 @@ void Mob::ResourceTap(int32 damage, uint16 spellid)
|
|||||||
if (damage > 0)
|
if (damage > 0)
|
||||||
HealDamage(damage);
|
HealDamage(damage);
|
||||||
else
|
else
|
||||||
Damage(this, -damage, 0, SkillEvocation, false);
|
Damage(this, -damage, 0, EQEmu::skills::SkillEvocation, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spells[spellid].base2[i] == 1) // Mana Tap
|
if (spells[spellid].base2[i] == 1) // Mana Tap
|
||||||
|
|||||||
@ -556,16 +556,16 @@ bool Mob::DoCastingChecks()
|
|||||||
|
|
||||||
uint16 Mob::GetSpecializeSkillValue(uint16 spell_id) const {
|
uint16 Mob::GetSpecializeSkillValue(uint16 spell_id) const {
|
||||||
switch(spells[spell_id].skill) {
|
switch(spells[spell_id].skill) {
|
||||||
case SkillAbjuration:
|
case EQEmu::skills::SkillAbjuration:
|
||||||
return(GetSkill(SkillSpecializeAbjure));
|
return(GetSkill(EQEmu::skills::SkillSpecializeAbjure));
|
||||||
case SkillAlteration:
|
case EQEmu::skills::SkillAlteration:
|
||||||
return(GetSkill(SkillSpecializeAlteration));
|
return(GetSkill(EQEmu::skills::SkillSpecializeAlteration));
|
||||||
case SkillConjuration:
|
case EQEmu::skills::SkillConjuration:
|
||||||
return(GetSkill(SkillSpecializeConjuration));
|
return(GetSkill(EQEmu::skills::SkillSpecializeConjuration));
|
||||||
case SkillDivination:
|
case EQEmu::skills::SkillDivination:
|
||||||
return(GetSkill(SkillSpecializeDivination));
|
return(GetSkill(EQEmu::skills::SkillSpecializeDivination));
|
||||||
case SkillEvocation:
|
case EQEmu::skills::SkillEvocation:
|
||||||
return(GetSkill(SkillSpecializeEvocation));
|
return(GetSkill(EQEmu::skills::SkillSpecializeEvocation));
|
||||||
default:
|
default:
|
||||||
//wtf...
|
//wtf...
|
||||||
break;
|
break;
|
||||||
@ -584,20 +584,20 @@ void Client::CheckSpecializeIncrease(uint16 spell_id) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
switch(spells[spell_id].skill) {
|
switch(spells[spell_id].skill) {
|
||||||
case SkillAbjuration:
|
case EQEmu::skills::SkillAbjuration:
|
||||||
CheckIncreaseSkill(SkillSpecializeAbjure, nullptr);
|
CheckIncreaseSkill(EQEmu::skills::SkillSpecializeAbjure, nullptr);
|
||||||
break;
|
break;
|
||||||
case SkillAlteration:
|
case EQEmu::skills::SkillAlteration:
|
||||||
CheckIncreaseSkill(SkillSpecializeAlteration, nullptr);
|
CheckIncreaseSkill(EQEmu::skills::SkillSpecializeAlteration, nullptr);
|
||||||
break;
|
break;
|
||||||
case SkillConjuration:
|
case EQEmu::skills::SkillConjuration:
|
||||||
CheckIncreaseSkill(SkillSpecializeConjuration, nullptr);
|
CheckIncreaseSkill(EQEmu::skills::SkillSpecializeConjuration, nullptr);
|
||||||
break;
|
break;
|
||||||
case SkillDivination:
|
case EQEmu::skills::SkillDivination:
|
||||||
CheckIncreaseSkill(SkillSpecializeDivination, nullptr);
|
CheckIncreaseSkill(EQEmu::skills::SkillSpecializeDivination, nullptr);
|
||||||
break;
|
break;
|
||||||
case SkillEvocation:
|
case EQEmu::skills::SkillEvocation:
|
||||||
CheckIncreaseSkill(SkillSpecializeEvocation, nullptr);
|
CheckIncreaseSkill(EQEmu::skills::SkillSpecializeEvocation, nullptr);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//wtf...
|
//wtf...
|
||||||
@ -617,48 +617,48 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){
|
|||||||
|
|
||||||
switch(spells[spell_id].skill)
|
switch(spells[spell_id].skill)
|
||||||
{
|
{
|
||||||
case SkillSinging:
|
case EQEmu::skills::SkillSinging:
|
||||||
CheckIncreaseSkill(SkillSinging, nullptr, -15);
|
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15);
|
||||||
break;
|
break;
|
||||||
case SkillPercussionInstruments:
|
case EQEmu::skills::SkillPercussionInstruments:
|
||||||
if(this->itembonuses.percussionMod > 0) {
|
if(this->itembonuses.percussionMod > 0) {
|
||||||
if(GetRawSkill(SkillPercussionInstruments) > 0) // no skill increases if not trained in the instrument
|
if (GetRawSkill(EQEmu::skills::SkillPercussionInstruments) > 0) // no skill increases if not trained in the instrument
|
||||||
CheckIncreaseSkill(SkillPercussionInstruments, nullptr, -15);
|
CheckIncreaseSkill(EQEmu::skills::SkillPercussionInstruments, nullptr, -15);
|
||||||
else
|
else
|
||||||
Message_StringID(13,NO_INSTRUMENT_SKILL); // tell the client that they need instrument training
|
Message_StringID(13,NO_INSTRUMENT_SKILL); // tell the client that they need instrument training
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CheckIncreaseSkill(SkillSinging, nullptr, -15);
|
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15);
|
||||||
break;
|
break;
|
||||||
case SkillStringedInstruments:
|
case EQEmu::skills::SkillStringedInstruments:
|
||||||
if(this->itembonuses.stringedMod > 0) {
|
if(this->itembonuses.stringedMod > 0) {
|
||||||
if(GetRawSkill(SkillStringedInstruments) > 0)
|
if (GetRawSkill(EQEmu::skills::SkillStringedInstruments) > 0)
|
||||||
CheckIncreaseSkill(SkillStringedInstruments, nullptr, -15);
|
CheckIncreaseSkill(EQEmu::skills::SkillStringedInstruments, nullptr, -15);
|
||||||
else
|
else
|
||||||
Message_StringID(13,NO_INSTRUMENT_SKILL);
|
Message_StringID(13,NO_INSTRUMENT_SKILL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CheckIncreaseSkill(SkillSinging, nullptr, -15);
|
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15);
|
||||||
break;
|
break;
|
||||||
case SkillWindInstruments:
|
case EQEmu::skills::SkillWindInstruments:
|
||||||
if(this->itembonuses.windMod > 0) {
|
if(this->itembonuses.windMod > 0) {
|
||||||
if(GetRawSkill(SkillWindInstruments) > 0)
|
if (GetRawSkill(EQEmu::skills::SkillWindInstruments) > 0)
|
||||||
CheckIncreaseSkill(SkillWindInstruments, nullptr, -15);
|
CheckIncreaseSkill(EQEmu::skills::SkillWindInstruments, nullptr, -15);
|
||||||
else
|
else
|
||||||
Message_StringID(13,NO_INSTRUMENT_SKILL);
|
Message_StringID(13,NO_INSTRUMENT_SKILL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CheckIncreaseSkill(SkillSinging, nullptr, -15);
|
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15);
|
||||||
break;
|
break;
|
||||||
case SkillBrassInstruments:
|
case EQEmu::skills::SkillBrassInstruments:
|
||||||
if(this->itembonuses.brassMod > 0) {
|
if(this->itembonuses.brassMod > 0) {
|
||||||
if(GetRawSkill(SkillBrassInstruments) > 0)
|
if (GetRawSkill(EQEmu::skills::SkillBrassInstruments) > 0)
|
||||||
CheckIncreaseSkill(SkillBrassInstruments, nullptr, -15);
|
CheckIncreaseSkill(EQEmu::skills::SkillBrassInstruments, nullptr, -15);
|
||||||
else
|
else
|
||||||
Message_StringID(13,NO_INSTRUMENT_SKILL);
|
Message_StringID(13,NO_INSTRUMENT_SKILL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CheckIncreaseSkill(SkillSinging, nullptr, -15);
|
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -991,7 +991,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
|
|||||||
channelbonuses += spellbonuses.ChannelChanceSpells + itembonuses.ChannelChanceSpells + aabonuses.ChannelChanceSpells;
|
channelbonuses += spellbonuses.ChannelChanceSpells + itembonuses.ChannelChanceSpells + aabonuses.ChannelChanceSpells;
|
||||||
|
|
||||||
// max 93% chance at 252 skill
|
// max 93% chance at 252 skill
|
||||||
channelchance = 30 + GetSkill(SkillChanneling) / 400.0f * 100;
|
channelchance = 30 + GetSkill(EQEmu::skills::SkillChanneling) / 400.0f * 100;
|
||||||
channelchance -= attacked_count * 2;
|
channelchance -= attacked_count * 2;
|
||||||
channelchance += channelchance * channelbonuses / 100.0f;
|
channelchance += channelchance * channelbonuses / 100.0f;
|
||||||
}
|
}
|
||||||
@ -1005,7 +1005,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
|
|||||||
channelbonuses += spellbonuses.ChannelChanceSpells + itembonuses.ChannelChanceSpells + aabonuses.ChannelChanceSpells;
|
channelbonuses += spellbonuses.ChannelChanceSpells + itembonuses.ChannelChanceSpells + aabonuses.ChannelChanceSpells;
|
||||||
|
|
||||||
// max 93% chance at 252 skill
|
// max 93% chance at 252 skill
|
||||||
channelchance = 30 + GetSkill(SkillChanneling) / 400.0f * 100;
|
channelchance = 30 + GetSkill(EQEmu::skills::SkillChanneling) / 400.0f * 100;
|
||||||
channelchance -= attacked_count * 2;
|
channelchance -= attacked_count * 2;
|
||||||
channelchance += channelchance * channelbonuses / 100.0f;
|
channelchance += channelchance * channelbonuses / 100.0f;
|
||||||
}
|
}
|
||||||
@ -1037,7 +1037,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.Out(Logs::Detail, Logs::Spells, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(SkillChanneling));
|
Log.Out(Logs::Detail, Logs::Spells, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(EQEmu::skills::SkillChanneling));
|
||||||
|
|
||||||
if(!spells[spell_id].uninterruptable && zone->random.Real(0, 100) > channelchance) {
|
if(!spells[spell_id].uninterruptable && zone->random.Real(0, 100) > channelchance) {
|
||||||
Log.Out(Logs::Detail, Logs::Spells, "Casting of %d canceled: interrupted.", spell_id);
|
Log.Out(Logs::Detail, Logs::Spells, "Casting of %d canceled: interrupted.", spell_id);
|
||||||
@ -1330,7 +1330,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
|
|||||||
c->CheckIncreaseSkill(spells[spell_id].skill, nullptr);
|
c->CheckIncreaseSkill(spells[spell_id].skill, nullptr);
|
||||||
|
|
||||||
// increased chance of gaining channel skill if you regained concentration
|
// increased chance of gaining channel skill if you regained concentration
|
||||||
c->CheckIncreaseSkill(SkillChanneling, nullptr, regain_conc ? 5 : 0);
|
c->CheckIncreaseSkill(EQEmu::skills::SkillChanneling, nullptr, regain_conc ? 5 : 0);
|
||||||
|
|
||||||
c->CheckSpecializeIncrease(spell_id);
|
c->CheckSpecializeIncrease(spell_id);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,7 @@ Copyright (C) 2001-2008 EQEMu Development Team (http://eqemulator.net)
|
|||||||
#include "../common/misc_functions.h"
|
#include "../common/misc_functions.h"
|
||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
#include "../common/string_util.h"
|
#include "../common/string_util.h"
|
||||||
|
#include "../common/say_link.h"
|
||||||
|
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "entity.h"
|
#include "entity.h"
|
||||||
|
|||||||
@ -46,7 +46,7 @@ bool TitleManager::LoadTitles()
|
|||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
TitleEntry Title;
|
TitleEntry Title;
|
||||||
Title.TitleID = atoi(row[0]);
|
Title.TitleID = atoi(row[0]);
|
||||||
Title.SkillID = (SkillUseTypes) atoi(row[1]);
|
Title.SkillID = (EQEmu::skills::SkillType) atoi(row[1]);
|
||||||
Title.MinSkillValue = atoi(row[2]);
|
Title.MinSkillValue = atoi(row[2]);
|
||||||
Title.MaxSkillValue = atoi(row[3]);
|
Title.MaxSkillValue = atoi(row[3]);
|
||||||
Title.MinAAPoints = atoi(row[4]);
|
Title.MinAAPoints = atoi(row[4]);
|
||||||
@ -187,10 +187,10 @@ bool TitleManager::IsClientEligibleForTitle(Client *c, std::vector<TitleEntry>::
|
|||||||
|
|
||||||
if(Title->SkillID >= 0)
|
if(Title->SkillID >= 0)
|
||||||
{
|
{
|
||||||
if((Title->MinSkillValue >= 0) && (c->GetRawSkill(static_cast<SkillUseTypes>(Title->SkillID)) < static_cast<uint32>(Title->MinSkillValue)))
|
if ((Title->MinSkillValue >= 0) && (c->GetRawSkill(static_cast<EQEmu::skills::SkillType>(Title->SkillID)) < static_cast<uint32>(Title->MinSkillValue)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if((Title->MaxSkillValue >= 0) && (c->GetRawSkill(static_cast<SkillUseTypes>(Title->SkillID)) > static_cast<uint32>(Title->MaxSkillValue)))
|
if ((Title->MaxSkillValue >= 0) && (c->GetRawSkill(static_cast<EQEmu::skills::SkillType>(Title->SkillID)) > static_cast<uint32>(Title->MaxSkillValue)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
extern QueryServ* QServ;
|
extern QueryServ* QServ;
|
||||||
|
|
||||||
static const SkillUseTypes TradeskillUnknown = Skill1HBlunt; /* an arbitrary non-tradeskill */
|
static const EQEmu::skills::SkillType TradeskillUnknown = EQEmu::skills::Skill1HBlunt; /* an arbitrary non-tradeskill */
|
||||||
|
|
||||||
void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augment, Object *worldo)
|
void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augment, Object *worldo)
|
||||||
{
|
{
|
||||||
@ -363,7 +363,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
|
|||||||
}
|
}
|
||||||
|
|
||||||
//changing from a switch to string of if's since we don't need to iterate through all of the skills in the SkillType enum
|
//changing from a switch to string of if's since we don't need to iterate through all of the skills in the SkillType enum
|
||||||
if (spec.tradeskill == SkillAlchemy) {
|
if (spec.tradeskill == EQEmu::skills::SkillAlchemy) {
|
||||||
if (user_pp.class_ != SHAMAN) {
|
if (user_pp.class_ != SHAMAN) {
|
||||||
user->Message(13, "This tradeskill can only be performed by a shaman.");
|
user->Message(13, "This tradeskill can only be performed by a shaman.");
|
||||||
return;
|
return;
|
||||||
@ -373,13 +373,13 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (spec.tradeskill == SkillTinkering) {
|
else if (spec.tradeskill == EQEmu::skills::SkillTinkering) {
|
||||||
if (user_pp.race != GNOME) {
|
if (user_pp.race != GNOME) {
|
||||||
user->Message(13, "Only gnomes can tinker.");
|
user->Message(13, "Only gnomes can tinker.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (spec.tradeskill == SkillMakePoison) {
|
else if (spec.tradeskill == EQEmu::skills::SkillMakePoison) {
|
||||||
if (user_pp.class_ != ROGUE) {
|
if (user_pp.class_ != ROGUE) {
|
||||||
user->Message(13, "Only rogues can mix poisons.");
|
user->Message(13, "Only rogues can mix poisons.");
|
||||||
return;
|
return;
|
||||||
@ -604,17 +604,17 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac
|
|||||||
parse->EventPlayer(EVENT_COMBINE_FAILURE, user, spec.name.c_str(), spec.recipe_id);
|
parse->EventPlayer(EVENT_COMBINE_FAILURE, user, spec.name.c_str(), spec.recipe_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
SkillUseTypes Object::TypeToSkill(uint32 type)
|
EQEmu::skills::SkillType Object::TypeToSkill(uint32 type)
|
||||||
{
|
{
|
||||||
switch(type) { // grouped and ordered by SkillUseTypes name - new types need to be verified for proper SkillUseTypes and use
|
switch(type) { // grouped and ordered by SkillUseTypes name - new types need to be verified for proper SkillUseTypes and use
|
||||||
/*SkillAlchemy*/
|
/*SkillAlchemy*/
|
||||||
case EQEmu::item::BagTypeMedicineBag:
|
case EQEmu::item::BagTypeMedicineBag:
|
||||||
return SkillAlchemy;
|
return EQEmu::skills::SkillAlchemy;
|
||||||
|
|
||||||
/*SkillBaking*/
|
/*SkillBaking*/
|
||||||
//case EQEmu::item::BagTypeMixingBowl: // No idea...
|
//case EQEmu::item::BagTypeMixingBowl: // No idea...
|
||||||
case EQEmu::item::BagTypeOven:
|
case EQEmu::item::BagTypeOven:
|
||||||
return SkillBaking;
|
return EQEmu::skills::SkillBaking;
|
||||||
|
|
||||||
/*SkillBlacksmithing*/
|
/*SkillBlacksmithing*/
|
||||||
case EQEmu::item::BagTypeForge:
|
case EQEmu::item::BagTypeForge:
|
||||||
@ -632,25 +632,25 @@ SkillUseTypes Object::TypeToSkill(uint32 type)
|
|||||||
case EQEmu::item::BagTypeValeForge:
|
case EQEmu::item::BagTypeValeForge:
|
||||||
//case EQEmu::item::BagTypeErudForge:
|
//case EQEmu::item::BagTypeErudForge:
|
||||||
//case EQEmu::item::BagTypeGuktaForge:
|
//case EQEmu::item::BagTypeGuktaForge:
|
||||||
return SkillBlacksmithing;
|
return EQEmu::skills::SkillBlacksmithing;
|
||||||
|
|
||||||
/*SkillBrewing*/
|
/*SkillBrewing*/
|
||||||
//case EQEmu::item::BagTypeIceCreamChurn: // No idea...
|
//case EQEmu::item::BagTypeIceCreamChurn: // No idea...
|
||||||
case EQEmu::item::BagTypeBrewBarrel:
|
case EQEmu::item::BagTypeBrewBarrel:
|
||||||
return SkillBrewing;
|
return EQEmu::skills::SkillBrewing;
|
||||||
|
|
||||||
/*SkillFishing*/
|
/*SkillFishing*/
|
||||||
case EQEmu::item::BagTypeTackleBox:
|
case EQEmu::item::BagTypeTackleBox:
|
||||||
return SkillFishing;
|
return EQEmu::skills::SkillFishing;
|
||||||
|
|
||||||
/*SkillFletching*/
|
/*SkillFletching*/
|
||||||
case EQEmu::item::BagTypeFletchingKit:
|
case EQEmu::item::BagTypeFletchingKit:
|
||||||
//case EQEmu::item::BagTypeFierDalFletchingKit:
|
//case EQEmu::item::BagTypeFierDalFletchingKit:
|
||||||
return SkillFletching;
|
return EQEmu::skills::SkillFletching;
|
||||||
|
|
||||||
/*SkillJewelryMaking*/
|
/*SkillJewelryMaking*/
|
||||||
case EQEmu::item::BagTypeJewelersKit:
|
case EQEmu::item::BagTypeJewelersKit:
|
||||||
return SkillJewelryMaking;
|
return EQEmu::skills::SkillJewelryMaking;
|
||||||
|
|
||||||
/*SkillMakePoison*/
|
/*SkillMakePoison*/
|
||||||
// This is a guess and needs to be verified... (Could be SkillAlchemy)
|
// This is a guess and needs to be verified... (Could be SkillAlchemy)
|
||||||
@ -661,7 +661,7 @@ SkillUseTypes Object::TypeToSkill(uint32 type)
|
|||||||
case EQEmu::item::BagTypePotteryWheel:
|
case EQEmu::item::BagTypePotteryWheel:
|
||||||
case EQEmu::item::BagTypeKiln:
|
case EQEmu::item::BagTypeKiln:
|
||||||
//case EQEmu::item::BagTypeIksarPotteryWheel:
|
//case EQEmu::item::BagTypeIksarPotteryWheel:
|
||||||
return SkillPottery;
|
return EQEmu::skills::SkillPottery;
|
||||||
|
|
||||||
/*SkillResearch*/
|
/*SkillResearch*/
|
||||||
//case EQEmu::item::BagTypeLexicon:
|
//case EQEmu::item::BagTypeLexicon:
|
||||||
@ -670,18 +670,18 @@ SkillUseTypes Object::TypeToSkill(uint32 type)
|
|||||||
case EQEmu::item::BagTypeNecromancersLexicon:
|
case EQEmu::item::BagTypeNecromancersLexicon:
|
||||||
case EQEmu::item::BagTypeEnchantersLexicon:
|
case EQEmu::item::BagTypeEnchantersLexicon:
|
||||||
//case EQEmu::item::BagTypeConcordanceofResearch:
|
//case EQEmu::item::BagTypeConcordanceofResearch:
|
||||||
return SkillResearch;
|
return EQEmu::skills::SkillResearch;
|
||||||
|
|
||||||
/*SkillTailoring*/
|
/*SkillTailoring*/
|
||||||
case EQEmu::item::BagTypeSewingKit:
|
case EQEmu::item::BagTypeSewingKit:
|
||||||
//case EQEmu::item::BagTypeHalflingTailoringKit:
|
//case EQEmu::item::BagTypeHalflingTailoringKit:
|
||||||
//case EQEmu::item::BagTypeErudTailoringKit:
|
//case EQEmu::item::BagTypeErudTailoringKit:
|
||||||
//case EQEmu::item::BagTypeFierDalTailoringKit:
|
//case EQEmu::item::BagTypeFierDalTailoringKit:
|
||||||
return SkillTailoring;
|
return EQEmu::skills::SkillTailoring;
|
||||||
|
|
||||||
/*SkillTinkering*/
|
/*SkillTinkering*/
|
||||||
case EQEmu::item::BagTypeToolBox:
|
case EQEmu::item::BagTypeToolBox:
|
||||||
return SkillTinkering;
|
return EQEmu::skills::SkillTinkering;
|
||||||
|
|
||||||
/*Undefined*/
|
/*Undefined*/
|
||||||
default:
|
default:
|
||||||
@ -718,7 +718,7 @@ void Client::TradeskillSearchResults(const std::string &query, unsigned long obj
|
|||||||
// Recipes that have either been made before or were
|
// Recipes that have either been made before or were
|
||||||
// explicitly learned are excempt from that limit
|
// explicitly learned are excempt from that limit
|
||||||
if (RuleB(Skills, UseLimitTradeskillSearchSkillDiff)
|
if (RuleB(Skills, UseLimitTradeskillSearchSkillDiff)
|
||||||
&& ((int32)trivial - (int32)GetSkill((SkillUseTypes)tradeskill)) > RuleI(Skills, MaxTradeskillSearchSkillDiff)
|
&& ((int32)trivial - (int32)GetSkill((EQEmu::skills::SkillType)tradeskill)) > RuleI(Skills, MaxTradeskillSearchSkillDiff)
|
||||||
&& row[4] == nullptr)
|
&& row[4] == nullptr)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -866,49 +866,50 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
|
|||||||
// Some tradeskills are more eqal then others. ;-)
|
// Some tradeskills are more eqal then others. ;-)
|
||||||
// If you want to customize the stage1 success rate do it here.
|
// If you want to customize the stage1 success rate do it here.
|
||||||
// Remember: skillup_modifier is (float). Lower is better
|
// Remember: skillup_modifier is (float). Lower is better
|
||||||
switch(spec->tradeskill) {
|
switch(spec->tradeskill) {
|
||||||
case SkillFletching:
|
case EQEmu::skills::SkillFletching:
|
||||||
skillup_modifier = RuleI(Character, TradeskillUpFletching);
|
skillup_modifier = RuleI(Character, TradeskillUpFletching);
|
||||||
break;
|
break;
|
||||||
case SkillAlchemy:
|
case EQEmu::skills::SkillAlchemy:
|
||||||
skillup_modifier = RuleI(Character, TradeskillUpAlchemy);
|
skillup_modifier = RuleI(Character, TradeskillUpAlchemy);
|
||||||
break;
|
break;
|
||||||
case SkillJewelryMaking:
|
case EQEmu::skills::SkillJewelryMaking:
|
||||||
skillup_modifier = RuleI(Character, TradeskillUpJewelcrafting);
|
skillup_modifier = RuleI(Character, TradeskillUpJewelcrafting);
|
||||||
break;
|
break;
|
||||||
case SkillPottery:
|
case EQEmu::skills::SkillPottery:
|
||||||
skillup_modifier = RuleI(Character, TradeskillUpPottery);
|
skillup_modifier = RuleI(Character, TradeskillUpPottery);
|
||||||
break;
|
break;
|
||||||
case SkillBaking:
|
case EQEmu::skills::SkillBaking:
|
||||||
skillup_modifier = RuleI(Character, TradeskillUpBaking);
|
skillup_modifier = RuleI(Character, TradeskillUpBaking);
|
||||||
break;
|
break;
|
||||||
case SkillBrewing:
|
case EQEmu::skills::SkillBrewing:
|
||||||
skillup_modifier = RuleI(Character, TradeskillUpBrewing);
|
skillup_modifier = RuleI(Character, TradeskillUpBrewing);
|
||||||
break;
|
break;
|
||||||
case SkillBlacksmithing:
|
case EQEmu::skills::SkillBlacksmithing:
|
||||||
skillup_modifier = RuleI(Character, TradeskillUpBlacksmithing);
|
skillup_modifier = RuleI(Character, TradeskillUpBlacksmithing);
|
||||||
break;
|
break;
|
||||||
case SkillResearch:
|
case EQEmu::skills::SkillResearch:
|
||||||
skillup_modifier = RuleI(Character, TradeskillUpResearch);
|
skillup_modifier = RuleI(Character, TradeskillUpResearch);
|
||||||
break;
|
break;
|
||||||
case SkillMakePoison:
|
case EQEmu::skills::SkillMakePoison:
|
||||||
skillup_modifier = RuleI(Character, TradeskillUpMakePoison);
|
skillup_modifier = RuleI(Character, TradeskillUpMakePoison);
|
||||||
break;
|
break;
|
||||||
case SkillTinkering:
|
case EQEmu::skills::SkillTinkering:
|
||||||
skillup_modifier = RuleI(Character, TradeskillUpTinkering);
|
skillup_modifier = RuleI(Character, TradeskillUpTinkering);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
skillup_modifier = 2;
|
skillup_modifier = 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some tradeskills take the higher of one additional stat beside INT and WIS
|
// Some tradeskills take the higher of one additional stat beside INT and WIS
|
||||||
// to determine the skillup rate. Additionally these tradeskills do not have an
|
// to determine the skillup rate. Additionally these tradeskills do not have an
|
||||||
// -15 modifier on their statbonus.
|
// -15 modifier on their statbonus.
|
||||||
if (spec->tradeskill == SkillFletching || spec->tradeskill == SkillMakePoison) {
|
if (spec->tradeskill == EQEmu::skills::SkillFletching || spec->tradeskill == EQEmu::skills::SkillMakePoison) {
|
||||||
thirdstat = GetDEX();
|
thirdstat = GetDEX();
|
||||||
stat_modifier = 0;
|
stat_modifier = 0;
|
||||||
} else if (spec->tradeskill == SkillBlacksmithing) {
|
}
|
||||||
|
else if (spec->tradeskill == EQEmu::skills::SkillBlacksmithing) {
|
||||||
thirdstat = GetSTR();
|
thirdstat = GetSTR();
|
||||||
stat_modifier = 0;
|
stat_modifier = 0;
|
||||||
}
|
}
|
||||||
@ -1045,7 +1046,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
|
|||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float skillup_modifier, uint16 success_modifier, SkillUseTypes tradeskill)
|
void Client::CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float skillup_modifier, uint16 success_modifier, EQEmu::skills::SkillType tradeskill)
|
||||||
{
|
{
|
||||||
uint16 current_raw_skill = GetRawSkill(tradeskill);
|
uint16 current_raw_skill = GetRawSkill(tradeskill);
|
||||||
|
|
||||||
@ -1290,7 +1291,7 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id
|
|||||||
return false;//just not found i guess..
|
return false;//just not found i guess..
|
||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
spec->tradeskill = (SkillUseTypes)atoi(row[1]);
|
spec->tradeskill = (EQEmu::skills::SkillType)atoi(row[1]);
|
||||||
spec->skill_needed = (int16)atoi(row[2]);
|
spec->skill_needed = (int16)atoi(row[2]);
|
||||||
spec->trivial = (uint16)atoi(row[3]);
|
spec->trivial = (uint16)atoi(row[3]);
|
||||||
spec->nofail = atoi(row[4]) ? true : false;
|
spec->nofail = atoi(row[4]) ? true : false;
|
||||||
@ -1406,43 +1407,43 @@ void Client::LearnRecipe(uint32 recipeID)
|
|||||||
results = database.QueryDatabase(query);
|
results = database.QueryDatabase(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::CanIncreaseTradeskill(SkillUseTypes tradeskill) {
|
bool Client::CanIncreaseTradeskill(EQEmu::skills::SkillType tradeskill) {
|
||||||
uint32 rawskill = GetRawSkill(tradeskill);
|
uint32 rawskill = GetRawSkill(tradeskill);
|
||||||
uint16 maxskill = MaxSkill(tradeskill);
|
uint16 maxskill = MaxSkill(tradeskill);
|
||||||
|
|
||||||
if (rawskill >= maxskill) //Max skill sanity check
|
if (rawskill >= maxskill) //Max skill sanity check
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint8 Baking = (GetRawSkill(SkillBaking) > 200) ? 1 : 0;
|
uint8 Baking = (GetRawSkill(EQEmu::skills::SkillBaking) > 200) ? 1 : 0;
|
||||||
uint8 Smithing = (GetRawSkill(SkillBlacksmithing) > 200) ? 1 : 0;
|
uint8 Smithing = (GetRawSkill(EQEmu::skills::SkillBlacksmithing) > 200) ? 1 : 0;
|
||||||
uint8 Brewing = (GetRawSkill(SkillBrewing) > 200) ? 1 : 0;
|
uint8 Brewing = (GetRawSkill(EQEmu::skills::SkillBrewing) > 200) ? 1 : 0;
|
||||||
uint8 Fletching = (GetRawSkill(SkillFletching) > 200) ? 1 : 0;
|
uint8 Fletching = (GetRawSkill(EQEmu::skills::SkillFletching) > 200) ? 1 : 0;
|
||||||
uint8 Jewelry = (GetRawSkill(SkillJewelryMaking) > 200) ? 1 : 0;
|
uint8 Jewelry = (GetRawSkill(EQEmu::skills::SkillJewelryMaking) > 200) ? 1 : 0;
|
||||||
uint8 Pottery = (GetRawSkill(SkillPottery) > 200) ? 1 : 0;
|
uint8 Pottery = (GetRawSkill(EQEmu::skills::SkillPottery) > 200) ? 1 : 0;
|
||||||
uint8 Tailoring = (GetRawSkill(SkillTailoring) > 200) ? 1 : 0;
|
uint8 Tailoring = (GetRawSkill(EQEmu::skills::SkillTailoring) > 200) ? 1 : 0;
|
||||||
uint8 SkillTotal = Baking + Smithing + Brewing + Fletching + Jewelry + Pottery + Tailoring; //Tradeskills above 200
|
uint8 SkillTotal = Baking + Smithing + Brewing + Fletching + Jewelry + Pottery + Tailoring; //Tradeskills above 200
|
||||||
//New Tanaan AA: Each level allows an additional tradeskill above 200 (first one is free)
|
//New Tanaan AA: Each level allows an additional tradeskill above 200 (first one is free)
|
||||||
uint8 aaLevel = spellbonuses.TradeSkillMastery + itembonuses.TradeSkillMastery + aabonuses.TradeSkillMastery;
|
uint8 aaLevel = spellbonuses.TradeSkillMastery + itembonuses.TradeSkillMastery + aabonuses.TradeSkillMastery;
|
||||||
|
|
||||||
switch (tradeskill) {
|
switch (tradeskill) {
|
||||||
case SkillBaking:
|
case EQEmu::skills::SkillBaking:
|
||||||
case SkillBlacksmithing:
|
case EQEmu::skills::SkillBlacksmithing:
|
||||||
case SkillBrewing:
|
case EQEmu::skills::SkillBrewing:
|
||||||
case SkillFletching:
|
case EQEmu::skills::SkillFletching:
|
||||||
case SkillJewelryMaking:
|
case EQEmu::skills::SkillJewelryMaking:
|
||||||
case SkillPottery:
|
case EQEmu::skills::SkillPottery:
|
||||||
case SkillTailoring:
|
case EQEmu::skills::SkillTailoring:
|
||||||
if (aaLevel == 6)
|
if (aaLevel == 6)
|
||||||
break; //Maxed AA
|
break; //Maxed AA
|
||||||
if (SkillTotal == 0)
|
if (SkillTotal == 0)
|
||||||
break; //First tradeskill freebie
|
break; //First tradeskill freebie
|
||||||
if ((SkillTotal == (aaLevel + 1)) && (rawskill > 200))
|
if ((SkillTotal == (aaLevel + 1)) && (rawskill > 200))
|
||||||
break; //One of the tradeskills already allowed to go over 200
|
break; //One of the tradeskills already allowed to go over 200
|
||||||
if ((SkillTotal >= (aaLevel + 1)) && (rawskill >= 200))
|
if ((SkillTotal >= (aaLevel + 1)) && (rawskill >= 200))
|
||||||
return false; //One or more tradeskills already at or beyond limit
|
return false; //One or more tradeskills already at or beyond limit
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break; //Other skills unchecked and ability to increase assumed true
|
break; //Other skills unchecked and ability to increase assumed true
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -255,7 +255,7 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (RuleB(Combat, UseIntervalAC)) {
|
if (RuleB(Combat, UseIntervalAC)) {
|
||||||
float softcap = (GetSkill(SkillDefense) + GetLevel()) *
|
float softcap = (GetSkill(EQEmu::skills::SkillDefense) + GetLevel()) *
|
||||||
RuleR(Combat, SoftcapFactor) * (1.0 + aa_mit);
|
RuleR(Combat, SoftcapFactor) * (1.0 + aa_mit);
|
||||||
float mitigation_rating = 0.0;
|
float mitigation_rating = 0.0;
|
||||||
float attack_rating = 0.0;
|
float attack_rating = 0.0;
|
||||||
@ -410,14 +410,14 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh
|
|||||||
int tmp_armor = armor;
|
int tmp_armor = armor;
|
||||||
if (GetClass() == WIZARD || GetClass() == MAGICIAN ||
|
if (GetClass() == WIZARD || GetClass() == MAGICIAN ||
|
||||||
GetClass() == NECROMANCER || GetClass() == ENCHANTER){
|
GetClass() == NECROMANCER || GetClass() == ENCHANTER){
|
||||||
mitigation_rating = ((GetSkill(SkillDefense) + itembonuses.HeroicAGI/10) / 4.0) + armor + 1;
|
mitigation_rating = ((GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 4.0) + armor + 1;
|
||||||
if (Msg >= 2)
|
if (Msg >= 2)
|
||||||
GM->Message(0, "# + %.2f #### DEFENDER Armor Bonus [Defense Skill %i Heroic Agi %i]", mitigation_rating - tmp_armor, GetSkill(SkillDefense), itembonuses.HeroicAGI);
|
GM->Message(0, "# + %.2f #### DEFENDER Armor Bonus [Defense Skill %i Heroic Agi %i]", mitigation_rating - tmp_armor, GetSkill(EQEmu::skills::SkillDefense), itembonuses.HeroicAGI);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
mitigation_rating = ((GetSkill(SkillDefense) + itembonuses.HeroicAGI/10) / 3.0) + (armor * 1.333333) + 1;
|
mitigation_rating = ((GetSkill(EQEmu::skills::SkillDefense) + itembonuses.HeroicAGI / 10) / 3.0) + (armor * 1.333333) + 1;
|
||||||
if (Msg >= 2)
|
if (Msg >= 2)
|
||||||
GM->Message(0, "# + %.2f #### DEFENDER Armor Bonus [Defense Skill %i Heroic Agi %i]", mitigation_rating - tmp_armor, GetSkill(SkillDefense), itembonuses.HeroicAGI);
|
GM->Message(0, "# + %.2f #### DEFENDER Armor Bonus [Defense Skill %i Heroic Agi %i]", mitigation_rating - tmp_armor, GetSkill(EQEmu::skills::SkillDefense), itembonuses.HeroicAGI);
|
||||||
|
|
||||||
}
|
}
|
||||||
mitigation_rating *= 0.847;
|
mitigation_rating *= 0.847;
|
||||||
@ -443,16 +443,16 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh
|
|||||||
|
|
||||||
if (attacker->IsClient()){
|
if (attacker->IsClient()){
|
||||||
if (atk_override)
|
if (atk_override)
|
||||||
attack_rating = (atk_override + ((attacker->GetSTR()-66) * 0.9) + (attacker->GetSkill(SkillOffense)*1.345));
|
attack_rating = (atk_override + ((attacker->GetSTR() - 66) * 0.9) + (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345));
|
||||||
else
|
else
|
||||||
attack_rating = ((attacker->CastToClient()->CalcATK() + add_atk) + ((attacker->GetSTR()-66) * 0.9) + (attacker->GetSkill(SkillOffense)*1.345));
|
attack_rating = ((attacker->CastToClient()->CalcATK() + add_atk) + ((attacker->GetSTR() - 66) * 0.9) + (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345));
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if (atk_override)
|
if (atk_override)
|
||||||
attack_rating = (atk_override + (attacker->GetSkill(SkillOffense)*1.345) + ((attacker->GetSTR()-66) * 0.9));
|
attack_rating = (atk_override + (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345) + ((attacker->GetSTR() - 66) * 0.9));
|
||||||
else
|
else
|
||||||
attack_rating = ((attacker->GetATK() + add_atk) + (attacker->GetSkill(SkillOffense)*1.345) + ((attacker->GetSTR()-66) * 0.9));
|
attack_rating = ((attacker->GetATK() + add_atk) + (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345) + ((attacker->GetSTR() - 66) * 0.9));
|
||||||
}
|
}
|
||||||
|
|
||||||
attack_rating = attacker->mod_attack_rating(attack_rating, this);
|
attack_rating = attacker->mod_attack_rating(attack_rating, this);
|
||||||
@ -468,7 +468,7 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh
|
|||||||
GM->Message(0, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK);
|
GM->Message(0, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK);
|
||||||
GM->Message(0, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK);
|
GM->Message(0, "# %i #### ATTACKER Worn/Equip ATK Bonus", attacker->itembonuses.ATK);
|
||||||
GM->Message(0, "# %.2f #### ATTACKER Strength Stat ATK Bonus [Stat Amt: %i]", ((attacker->GetSTR()-66) * 0.9),attacker->GetSTR());
|
GM->Message(0, "# %.2f #### ATTACKER Strength Stat ATK Bonus [Stat Amt: %i]", ((attacker->GetSTR()-66) * 0.9),attacker->GetSTR());
|
||||||
GM->Message(0, "# %.2f #### ATTACKER Offensive Skill ATK Bonus [Stat Amt: %i]", (attacker->GetSkill(SkillOffense)*1.345) ,attacker->GetSkill(SkillOffense));
|
GM->Message(0, "# %.2f #### ATTACKER Offensive Skill ATK Bonus [Stat Amt: %i]", (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345), attacker->GetSkill(EQEmu::skills::SkillOffense));
|
||||||
}
|
}
|
||||||
|
|
||||||
else{
|
else{
|
||||||
@ -476,7 +476,7 @@ int32 Mob::Tune_MeleeMitigation(Mob* GM, Mob *attacker, int32 damage, int32 minh
|
|||||||
GM->Message(0, "# %i #### ATTACKER SE_ATK(2) spell Bonus", attacker->spellbonuses.ATK);
|
GM->Message(0, "# %i #### ATTACKER SE_ATK(2) spell Bonus", attacker->spellbonuses.ATK);
|
||||||
GM->Message(0, "# %i #### ATTACKER NPC ATK Stat", attacker->CastToNPC()->ATK);
|
GM->Message(0, "# %i #### ATTACKER NPC ATK Stat", attacker->CastToNPC()->ATK);
|
||||||
GM->Message(0, "# %.2f #### ATTACKER Strength Stat ATK Bonus [Stat Amt: %i]", ((attacker->GetSTR()-66) * 0.9),attacker->GetSTR());
|
GM->Message(0, "# %.2f #### ATTACKER Strength Stat ATK Bonus [Stat Amt: %i]", ((attacker->GetSTR()-66) * 0.9),attacker->GetSTR());
|
||||||
GM->Message(0, "# %.2f #### ATTACKER Offensive Skill ATK Bonus [Stat Amt: %i]", (attacker->GetSkill(SkillOffense)*1.345) ,attacker->GetSkill(SkillOffense));
|
GM->Message(0, "# %.2f #### ATTACKER Offensive Skill ATK Bonus [Stat Amt: %i]", (attacker->GetSkill(EQEmu::skills::SkillOffense)*1.345), attacker->GetSkill(EQEmu::skills::SkillOffense));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -596,7 +596,7 @@ int32 Client::GetMeleeDamage(Mob* other, bool GetMinDamage)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SkillUseTypes skillinuse;
|
EQEmu::skills::SkillType skillinuse;
|
||||||
AttackAnimation(skillinuse, Hand, weapon);
|
AttackAnimation(skillinuse, Hand, weapon);
|
||||||
|
|
||||||
int damage = 0;
|
int damage = 0;
|
||||||
@ -621,7 +621,7 @@ int32 Client::GetMeleeDamage(Mob* other, bool GetMinDamage)
|
|||||||
max_hit = (RuleI(Combat, HitCapPre20));
|
max_hit = (RuleI(Combat, HitCapPre20));
|
||||||
|
|
||||||
CheckIncreaseSkill(skillinuse, other, -15);
|
CheckIncreaseSkill(skillinuse, other, -15);
|
||||||
CheckIncreaseSkill(SkillOffense, other, -15);
|
CheckIncreaseSkill(EQEmu::skills::SkillOffense, other, -15);
|
||||||
|
|
||||||
|
|
||||||
#ifndef EQEMU_NO_WEAPON_DAMAGE_BONUS
|
#ifndef EQEMU_NO_WEAPON_DAMAGE_BONUS
|
||||||
@ -658,7 +658,7 @@ void Mob::Tune_FindAccuaryByHitChance(Mob* defender, Mob *attacker, float hit_ch
|
|||||||
float tmp_hit_chance = 0.0f;
|
float tmp_hit_chance = 0.0f;
|
||||||
bool end = false;
|
bool end = false;
|
||||||
|
|
||||||
SkillUseTypes skillinuse = SkillHandtoHand;
|
EQEmu::skills::SkillType skillinuse = EQEmu::skills::SkillHandtoHand;
|
||||||
if (attacker->IsClient())
|
if (attacker->IsClient())
|
||||||
{//Will check first equiped weapon for skill. Ie. remove wepaons to assess bow.
|
{//Will check first equiped weapon for skill. Ie. remove wepaons to assess bow.
|
||||||
ItemInst* weapon;
|
ItemInst* weapon;
|
||||||
@ -738,7 +738,7 @@ void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_
|
|||||||
float tmp_hit_chance = 0.0f;
|
float tmp_hit_chance = 0.0f;
|
||||||
bool end = false;
|
bool end = false;
|
||||||
|
|
||||||
SkillUseTypes skillinuse = SkillHandtoHand;
|
EQEmu::skills::SkillType skillinuse = EQEmu::skills::SkillHandtoHand;
|
||||||
if (attacker->IsClient())
|
if (attacker->IsClient())
|
||||||
{//Will check first equiped weapon for skill. Ie. remove wepaons to assess bow.
|
{//Will check first equiped weapon for skill. Ie. remove wepaons to assess bow.
|
||||||
ItemInst* weapon;
|
ItemInst* weapon;
|
||||||
@ -809,7 +809,7 @@ void Mob::Tune_FindAvoidanceByHitChance(Mob* defender, Mob *attacker, float hit_
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
float Mob::Tune_CheckHitChance(Mob* defender, Mob* attacker, SkillUseTypes skillinuse, int Hand, int16 chance_mod, int Msg,int acc_override, int avoid_override, int add_acc, int add_avoid)
|
float Mob::Tune_CheckHitChance(Mob* defender, Mob* attacker, EQEmu::skills::SkillType skillinuse, int Hand, int16 chance_mod, int Msg, int acc_override, int avoid_override, int add_acc, int add_avoid)
|
||||||
{
|
{
|
||||||
|
|
||||||
float chancetohit = RuleR(Combat, BaseHitChance);
|
float chancetohit = RuleR(Combat, BaseHitChance);
|
||||||
@ -897,9 +897,9 @@ float Mob::Tune_CheckHitChance(Mob* defender, Mob* attacker, SkillUseTypes skill
|
|||||||
|
|
||||||
if(defender->IsClient())
|
if(defender->IsClient())
|
||||||
{
|
{
|
||||||
chancetohit += (RuleR(Combat,WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(SkillDefense) - defender->GetSkill(SkillDefense)));
|
chancetohit += (RuleR(Combat, WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(EQEmu::skills::SkillDefense) - defender->GetSkill(EQEmu::skills::SkillDefense)));
|
||||||
if (Msg >= 2)
|
if (Msg >= 2)
|
||||||
Message(0, "# + %.2f Total: %.2f #### DEFENDER Defense Skill Mod", (RuleR(Combat,WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(SkillDefense) - defender->GetSkill(SkillDefense))), chancetohit);
|
Message(0, "# + %.2f Total: %.2f #### DEFENDER Defense Skill Mod", (RuleR(Combat, WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(EQEmu::skills::SkillDefense) - defender->GetSkill(EQEmu::skills::SkillDefense))), chancetohit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -988,17 +988,17 @@ float Mob::Tune_CheckHitChance(Mob* defender, Mob* attacker, SkillUseTypes skill
|
|||||||
hitBonus += attacker->itembonuses.HitChanceEffect[skillinuse] +
|
hitBonus += attacker->itembonuses.HitChanceEffect[skillinuse] +
|
||||||
attacker->spellbonuses.HitChanceEffect[skillinuse]+
|
attacker->spellbonuses.HitChanceEffect[skillinuse]+
|
||||||
attacker->aabonuses.HitChanceEffect[skillinuse]+
|
attacker->aabonuses.HitChanceEffect[skillinuse]+
|
||||||
attacker->itembonuses.HitChanceEffect[HIGHEST_SKILL+1] +
|
attacker->itembonuses.HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1] +
|
||||||
attacker->spellbonuses.HitChanceEffect[HIGHEST_SKILL+1] +
|
attacker->spellbonuses.HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1] +
|
||||||
attacker->aabonuses.HitChanceEffect[HIGHEST_SKILL+1];
|
attacker->aabonuses.HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1];
|
||||||
|
|
||||||
if (Msg >= 2){
|
if (Msg >= 2){
|
||||||
if (attacker->aabonuses.HitChanceEffect[HIGHEST_SKILL+1])
|
if (attacker->aabonuses.HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1])
|
||||||
Message(0, "# %i #### ATTACKER SE_HitChance(184) AA Bonus [All Skills]", attacker->aabonuses.HitChanceEffect[HIGHEST_SKILL+1]);
|
Message(0, "# %i #### ATTACKER SE_HitChance(184) AA Bonus [All Skills]", attacker->aabonuses.HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1]);
|
||||||
if (attacker->spellbonuses.HitChanceEffect[HIGHEST_SKILL+1])
|
if (attacker->spellbonuses.HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1])
|
||||||
Message(0, "# %i #### ATTACKER SE_HitChance(184) Spell Bonus [All Skills]", attacker->spellbonuses.HitChanceEffect[HIGHEST_SKILL+1]);
|
Message(0, "# %i #### ATTACKER SE_HitChance(184) Spell Bonus [All Skills]", attacker->spellbonuses.HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1]);
|
||||||
if (attacker->itembonuses.HitChanceEffect[HIGHEST_SKILL+1])
|
if (attacker->itembonuses.HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1])
|
||||||
Message(0, "# %i #### ATTACKER SE_HitChance(184) Worn Bonus [All Skills]", attacker->itembonuses.HitChanceEffect[HIGHEST_SKILL+1]);
|
Message(0, "# %i #### ATTACKER SE_HitChance(184) Worn Bonus [All Skills]", attacker->itembonuses.HitChanceEffect[EQEmu::skills::HIGHEST_SKILL + 1]);
|
||||||
if (attacker->itembonuses.HitChanceEffect[skillinuse])
|
if (attacker->itembonuses.HitChanceEffect[skillinuse])
|
||||||
Message(0, "# %i #### ATTACKER SE_HitChance(184) AA Bonus [Skill]", attacker->aabonuses.HitChanceEffect[skillinuse]);
|
Message(0, "# %i #### ATTACKER SE_HitChance(184) AA Bonus [Skill]", attacker->aabonuses.HitChanceEffect[skillinuse]);
|
||||||
if (attacker->spellbonuses.HitChanceEffect[skillinuse])
|
if (attacker->spellbonuses.HitChanceEffect[skillinuse])
|
||||||
@ -1009,19 +1009,19 @@ float Mob::Tune_CheckHitChance(Mob* defender, Mob* attacker, SkillUseTypes skill
|
|||||||
|
|
||||||
//Accuracy = Spell Effect , HitChance = 'Accuracy' from Item Effect
|
//Accuracy = Spell Effect , HitChance = 'Accuracy' from Item Effect
|
||||||
//Only AA derived accuracy can be skill limited. ie (Precision of the Pathfinder, Dead Aim)
|
//Only AA derived accuracy can be skill limited. ie (Precision of the Pathfinder, Dead Aim)
|
||||||
hitBonus += (attacker->itembonuses.Accuracy[HIGHEST_SKILL+1] +
|
hitBonus += (attacker->itembonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] +
|
||||||
attacker->spellbonuses.Accuracy[HIGHEST_SKILL+1] +
|
attacker->spellbonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] +
|
||||||
attacker->aabonuses.Accuracy[HIGHEST_SKILL+1] +
|
attacker->aabonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1] +
|
||||||
attacker->aabonuses.Accuracy[skillinuse] +
|
attacker->aabonuses.Accuracy[skillinuse] +
|
||||||
attacker->itembonuses.HitChance) / 15.0f; //Item Mod 'Accuracy'
|
attacker->itembonuses.HitChance) / 15.0f; //Item Mod 'Accuracy'
|
||||||
|
|
||||||
if (Msg >= 2) {
|
if (Msg >= 2) {
|
||||||
if (attacker->aabonuses.Accuracy[HIGHEST_SKILL+1])
|
if (attacker->aabonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1])
|
||||||
Message(0, "# %.2f #### ATTACKER SE_Accuracy(216) AA Bonus [All Skills] [Stat Amt: %i]", static_cast<float>(attacker->aabonuses.Accuracy[HIGHEST_SKILL+1])/15.0f,attacker->aabonuses.Accuracy[HIGHEST_SKILL+1]);
|
Message(0, "# %.2f #### ATTACKER SE_Accuracy(216) AA Bonus [All Skills] [Stat Amt: %i]", static_cast<float>(attacker->aabonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1]) / 15.0f, attacker->aabonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1]);
|
||||||
if (attacker->spellbonuses.Accuracy[HIGHEST_SKILL+1])
|
if (attacker->spellbonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1])
|
||||||
Message(0, "# %.2f #### ATTACKER SE_Accuracy(216) Spell Bonus [All Skills] [Stat Amt: %i]", static_cast<float>(attacker->spellbonuses.Accuracy[HIGHEST_SKILL+1])/15.0f,attacker->spellbonuses.Accuracy[HIGHEST_SKILL+1]);
|
Message(0, "# %.2f #### ATTACKER SE_Accuracy(216) Spell Bonus [All Skills] [Stat Amt: %i]", static_cast<float>(attacker->spellbonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1]) / 15.0f, attacker->spellbonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1]);
|
||||||
if (attacker->itembonuses.Accuracy[HIGHEST_SKILL+1])
|
if (attacker->itembonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1])
|
||||||
Message(0, "# %.2f #### ATTACKER SE_Accuracy(216) Worn Bonus [All Skills] [Stat Amt: %i]", static_cast<float>(attacker->itembonuses.Accuracy[HIGHEST_SKILL+1])/15.0f,attacker->itembonuses.Accuracy[HIGHEST_SKILL+1]);
|
Message(0, "# %.2f #### ATTACKER SE_Accuracy(216) Worn Bonus [All Skills] [Stat Amt: %i]", static_cast<float>(attacker->itembonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1]) / 15.0f, attacker->itembonuses.Accuracy[EQEmu::skills::HIGHEST_SKILL + 1]);
|
||||||
if (attacker->aabonuses.Accuracy[skillinuse])
|
if (attacker->aabonuses.Accuracy[skillinuse])
|
||||||
Message(0, "# %.2f #### ATTACKER SE_Accuracy(216) AA Bonus [Skill] [Stat Amt: %i]", static_cast<float>(attacker->aabonuses.Accuracy[skillinuse])/15.0f,attacker->aabonuses.Accuracy[skillinuse]);
|
Message(0, "# %.2f #### ATTACKER SE_Accuracy(216) AA Bonus [Skill] [Stat Amt: %i]", static_cast<float>(attacker->aabonuses.Accuracy[skillinuse])/15.0f,attacker->aabonuses.Accuracy[skillinuse]);
|
||||||
if (attacker->itembonuses.HitChance)
|
if (attacker->itembonuses.HitChance)
|
||||||
@ -1053,7 +1053,7 @@ float Mob::Tune_CheckHitChance(Mob* defender, Mob* attacker, SkillUseTypes skill
|
|||||||
hitBonus += (add_acc / 15.0f); //Modifier from database
|
hitBonus += (add_acc / 15.0f); //Modifier from database
|
||||||
}
|
}
|
||||||
|
|
||||||
if(skillinuse == SkillArchery){
|
if (skillinuse == EQEmu::skills::SkillArchery){
|
||||||
hitBonus -= hitBonus*RuleR(Combat, ArcheryHitPenalty);
|
hitBonus -= hitBonus*RuleR(Combat, ArcheryHitPenalty);
|
||||||
if (Msg >= 2)
|
if (Msg >= 2)
|
||||||
Message(0, "# %.2f pct #### RuleR(Combat, ArcheryHitPenalty) ", RuleR(Combat, ArcheryHitPenalty));
|
Message(0, "# %.2f pct #### RuleR(Combat, ArcheryHitPenalty) ", RuleR(Combat, ArcheryHitPenalty));
|
||||||
|
|||||||
@ -92,7 +92,7 @@ struct DBnpcspellseffects_Struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct DBTradeskillRecipe_Struct {
|
struct DBTradeskillRecipe_Struct {
|
||||||
SkillUseTypes tradeskill;
|
EQEmu::skills::SkillType tradeskill;
|
||||||
int16 skill_needed;
|
int16 skill_needed;
|
||||||
uint16 trivial;
|
uint16 trivial;
|
||||||
bool nofail;
|
bool nofail;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user