Core/Items
* Updated ItemTemplate structure to 4.x * Calculate armor, damage and disenchant loot from dbc files TODO: Use dbc disenchant ids in disenchant_loot_template
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
DROP TABLE IF EXISTS `item_script_names`;
|
||||
CREATE TABLE `item_script_names` (
|
||||
`Id` int(10) unsigned not null,
|
||||
`ScriptName` varchar(64) not null,
|
||||
PRIMARY KEY(`Id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
|
||||
INSERT INTO `item_script_names`
|
||||
SELECT
|
||||
`item_template`.`entry` AS `Id`,
|
||||
`item_template`.`ScriptName` AS `ScriptName`
|
||||
FROM
|
||||
`item_template`
|
||||
WHERE
|
||||
length(`item_template`.`ScriptName`)>0;
|
||||
|
||||
ALTER TABLE `item_template` DROP `ScriptName`;
|
||||
@@ -0,0 +1,48 @@
|
||||
ALTER TABLE `item_template`
|
||||
ADD `stat_unk1_1` int(11) not null default 0 AFTER `stat_value1`,
|
||||
ADD `stat_unk2_1` int(11) not null default 0 AFTER `stat_unk1_1`,
|
||||
ADD `stat_unk1_2` int(11) not null default 0 AFTER `stat_value2`,
|
||||
ADD `stat_unk2_2` int(11) not null default 0 AFTER `stat_unk1_2`,
|
||||
ADD `stat_unk1_3` int(11) not null default 0 AFTER `stat_value3`,
|
||||
ADD `stat_unk2_3` int(11) not null default 0 AFTER `stat_unk1_3`,
|
||||
ADD `stat_unk1_4` int(11) not null default 0 AFTER `stat_value4`,
|
||||
ADD `stat_unk2_4` int(11) not null default 0 AFTER `stat_unk1_4`,
|
||||
ADD `stat_unk1_5` int(11) not null default 0 AFTER `stat_value5`,
|
||||
ADD `stat_unk2_5` int(11) not null default 0 AFTER `stat_unk1_5`,
|
||||
ADD `stat_unk1_6` int(11) not null default 0 AFTER `stat_value6`,
|
||||
ADD `stat_unk2_6` int(11) not null default 0 AFTER `stat_unk1_6`,
|
||||
ADD `stat_unk1_7` int(11) not null default 0 AFTER `stat_value7`,
|
||||
ADD `stat_unk2_7` int(11) not null default 0 AFTER `stat_unk1_7`,
|
||||
ADD `stat_unk1_8` int(11) not null default 0 AFTER `stat_value8`,
|
||||
ADD `stat_unk2_8` int(11) not null default 0 AFTER `stat_unk1_8`,
|
||||
ADD `stat_unk1_9` int(11) not null default 0 AFTER `stat_value9`,
|
||||
ADD `stat_unk2_9` int(11) not null default 0 AFTER `stat_unk1_9`,
|
||||
ADD `stat_unk1_10` int(11) not null default 0 AFTER `stat_value10`,
|
||||
ADD `stat_unk2_10` int(11) not null default 0 AFTER `stat_unk1_10`,
|
||||
DROP `StatsCount`,
|
||||
DROP `ScalingStatValue`,
|
||||
CHANGE `dmg_type1` `DamageType` tinyint(3) unsigned not null default 0 AFTER `ScalingStatDistribution`,
|
||||
DROP `dmg_min1`,
|
||||
DROP `dmg_max1`,
|
||||
DROP `dmg_min2`,
|
||||
DROP `dmg_max2`,
|
||||
DROP `dmg_type2`,
|
||||
DROP `armor`,
|
||||
DROP `holy_res`,
|
||||
DROP `fire_res`,
|
||||
DROP `nature_res`,
|
||||
DROP `frost_res`,
|
||||
DROP `shadow_res`,
|
||||
DROP `arcane_res`,
|
||||
DROP `ammo_type`,
|
||||
DROP `spellppmRate_1`,
|
||||
DROP `spellppmRate_2`,
|
||||
DROP `spellppmRate_3`,
|
||||
DROP `spellppmRate_4`,
|
||||
DROP `spellppmRate_5`,
|
||||
DROP `block`,
|
||||
DROP `RequiredDisenchantSkill`,
|
||||
DROP `DisenchantId`,
|
||||
ADD `StatScalingFactor` float not null default 0 AFTER `HolidayId`,
|
||||
ADD `Field130` int(11) not null default 0 AFTER `StatScalingFactor`,
|
||||
ADD `Field131` int(11) not null default 0 AFTER `Field130`;
|
||||
@@ -0,0 +1,38 @@
|
||||
DROP TABLE IF EXISTS `item_template_addon`;
|
||||
CREATE TABLE `item_template_addon` (
|
||||
`Id` int(10) unsigned not null,
|
||||
`BuyCount` tinyint(3) unsigned not null default 1,
|
||||
`FoodType` tinyint(3) unsigned not null default 0,
|
||||
`MinMoneyLoot` int(10) unsigned not null default 0,
|
||||
`MaxMoneyLoot` int(10) unsigned not null default 0,
|
||||
`SpellPPMChance` float unsigned not null default 0,
|
||||
PRIMARY KEY(`Id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
|
||||
INSERT INTO `item_template_addon`
|
||||
SELECT
|
||||
`item_template`.`entry` AS `Id`,
|
||||
`item_template`.`BuyCount` AS `BuyCount`,
|
||||
`item_template`.`FoodType` AS `FoodType`,
|
||||
`item_template`.`minMoneyLoot` AS `MinMoneyLoot`,
|
||||
`item_template`.`maxMoneyLoot` AS `MaxMoneyLoot`,
|
||||
ABS(IF(`item_template`.`spelltrigger_1`=2, `item_template`.`spellppmRate_1`,
|
||||
IF (`item_template`.`spelltrigger_2`=2, `item_template`.`spellppmRate_2`,
|
||||
IF (`item_template`.`spelltrigger_3`=2, `item_template`.`spellppmRate_3`,
|
||||
IF (`item_template`.`spelltrigger_4`=2, `item_template`.`spellppmRate_4`,
|
||||
IF (`item_template`.`spelltrigger_5`=2, `item_template`.`spellppmRate_5`, 0))))))
|
||||
AS `SpellPPMChance`
|
||||
FROM
|
||||
`item_template`
|
||||
HAVING -- need to use having due to `SpellPPMChance` usage which is not an actual field in table
|
||||
`item_template`.`BuyCount`!=1 OR
|
||||
`item_template`.`FoodType`!=0 OR
|
||||
(`item_template`.`minMoneyLoot`!=0 AND
|
||||
`item_template`.`maxMoneyLoot`!=0) OR
|
||||
`SpellPPMChance`!=0;
|
||||
|
||||
ALTER TABLE `item_template`
|
||||
DROP `BuyCount`,
|
||||
DROP `FoodType`,
|
||||
DROP `minMoneyLoot`,
|
||||
DROP `maxMoneyLoot`;
|
||||
@@ -111,20 +111,12 @@ DBCStorage <GtRegenMPPerSptEntry> sGtRegenMPPerSptStore(GtRegenMPPerSptf
|
||||
|
||||
DBCStorage <HolidaysEntry> sHolidaysStore(Holidaysfmt);
|
||||
|
||||
DBCStorage <ItemClassEntry> sItemClassStore(ItemClassfmt);
|
||||
//DBCStorage <ItemEntry> sItemStore(Itemfmt);
|
||||
DBCStorage <ItemBagFamilyEntry> sItemBagFamilyStore(ItemBagFamilyfmt);
|
||||
//DBCStorage <ItemCondExtCostsEntry> sItemCondExtCostsStore(ItemCondExtCostsEntryfmt);
|
||||
//DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently
|
||||
//DBCStorage <ItemExtendedCostEntry> sItemExtendedCostStore(ItemExtendedCostEntryfmt);
|
||||
DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore(ItemLimitCategoryEntryfmt);
|
||||
DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore(ItemRandomPropertiesfmt);
|
||||
DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore(ItemRandomSuffixfmt);
|
||||
DBCStorage <ItemSetEntry> sItemSetStore(ItemSetEntryfmt);
|
||||
|
||||
DBCStorage <ItemArmorQualityEntry> sItemArmorQualityStore(ItemArmorQualityfmt);
|
||||
DBCStorage <ItemArmorShieldEntry> sItemArmorShieldStore(ItemArmorShieldfmt);
|
||||
DBCStorage <ItemArmorTotalEntry> sItemArmorTotalStore(ItemArmorTotalfmt);
|
||||
DBCStorage <ItemBagFamilyEntry> sItemBagFamilyStore(ItemBagFamilyfmt);
|
||||
DBCStorage <ItemClassEntry> sItemClassStore(ItemClassfmt);
|
||||
//DBCStorage <ItemCondExtCostsEntry> sItemCondExtCostsStore(ItemCondExtCostsEntryfmt);
|
||||
DBCStorage <ItemDamageEntry> sItemDamageAmmoStore(ItemDamagefmt);
|
||||
DBCStorage <ItemDamageEntry> sItemDamageOneHandStore(ItemDamagefmt);
|
||||
DBCStorage <ItemDamageEntry> sItemDamageOneHandCasterStore(ItemDamagefmt);
|
||||
@@ -133,6 +125,13 @@ DBCStorage <ItemDamageEntry> sItemDamageThrownStore(ItemDamagefmt);
|
||||
DBCStorage <ItemDamageEntry> sItemDamageTwoHandStore(ItemDamagefmt);
|
||||
DBCStorage <ItemDamageEntry> sItemDamageTwoHandCasterStore(ItemDamagefmt);
|
||||
DBCStorage <ItemDamageEntry> sItemDamageWandStore(ItemDamagefmt);
|
||||
DBCStorage <ItemDisenchantLootEntry> sItemDisenchantLootStore(ItemDisenchantLootfmt);
|
||||
//DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently
|
||||
//DBCStorage <ItemExtendedCostEntry> sItemExtendedCostStore(ItemExtendedCostEntryfmt);
|
||||
DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore(ItemLimitCategoryEntryfmt);
|
||||
DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore(ItemRandomPropertiesfmt);
|
||||
DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore(ItemRandomSuffixfmt);
|
||||
DBCStorage <ItemSetEntry> sItemSetStore(ItemSetEntryfmt);
|
||||
|
||||
DBCStorage <LFGDungeonEntry> sLFGDungeonStore(LFGDungeonEntryfmt);
|
||||
//DBCStorage <LiquidTypeEntry> sLiquidTypeStore(LiquidTypeEntryfmt);
|
||||
@@ -409,6 +408,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageTwoHandStore, dbcPath, "ItemDamageTwoHand.dbc");//14545
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageTwoHandCasterStore,dbcPath, "ItemDamageTwoHandCaster.dbc");//14545
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageWandStore, dbcPath, "ItemDamageWand.dbc");//14545
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sItemDisenchantLootStore, dbcPath, "ItemDisenchantLoot.dbc");
|
||||
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sItemClassStore, dbcPath,"ItemClass.dbc");//14545
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sLFGDungeonStore, dbcPath, "LFGDungeons.dbc");//14545
|
||||
|
||||
@@ -128,6 +128,7 @@ extern DBCStorage <ItemDamageEntry> sItemDamageTwoHandStore;
|
||||
extern DBCStorage <ItemDamageEntry> sItemDamageTwoHandCasterStore;
|
||||
extern DBCStorage <ItemDamageEntry> sItemDamageWandStore;
|
||||
//extern DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore; -- not used currently
|
||||
extern DBCStorage <ItemDisenchantLootEntry> sItemDisenchantLootStore;
|
||||
extern DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore;
|
||||
extern DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore;
|
||||
extern DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore;
|
||||
|
||||
@@ -1169,7 +1169,7 @@ struct ItemClassEntry
|
||||
struct ItemDamageEntry
|
||||
{
|
||||
uint32 Id; // 0 item level
|
||||
float Value[7]; // 1-7 multiplier for item quality
|
||||
float DPS[7]; // 1-7 multiplier for item quality
|
||||
uint32 Id2; // 8 item level
|
||||
};
|
||||
|
||||
@@ -1216,6 +1216,17 @@ struct ItemDisplayInfoEntry
|
||||
// 11 m_particleColorID
|
||||
};
|
||||
|
||||
struct ItemDisenchantLootEntry
|
||||
{
|
||||
uint32 Id;
|
||||
uint32 ItemClass;
|
||||
int32 Unk;
|
||||
uint32 ItemQuality;
|
||||
uint32 MinItemLevel;
|
||||
uint32 MaxItemLevel;
|
||||
uint32 RequiredDisenchantSkill;
|
||||
};
|
||||
|
||||
//struct ItemCondExtCostsEntry
|
||||
//{
|
||||
// uint32 ID;
|
||||
@@ -2317,4 +2328,3 @@ typedef std::vector<TaxiPathNodeList> TaxiPathNodesByPath;
|
||||
#define TaxiMaskSize 14
|
||||
typedef uint32 TaxiMask[TaxiMaskSize];
|
||||
#endif
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@ const char ItemArmorQualityfmt[]="nfffffffi";
|
||||
const char ItemArmorShieldfmt[]="nifffffff";
|
||||
const char ItemArmorTotalfmt[]="niffff";
|
||||
const char ItemDamagefmt[]="nfffffffi";
|
||||
const char ItemDisenchantLootfmt[]="niiiiii";
|
||||
const char ItemClassfmt[]="dixxx";
|
||||
//const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx";
|
||||
//const char ItemCondExtCostsEntryfmt[]="xiii";
|
||||
|
||||
@@ -67,7 +67,15 @@ enum ItemModType
|
||||
ITEM_MOD_SPELL_POWER = 45,
|
||||
ITEM_MOD_HEALTH_REGEN = 46,
|
||||
ITEM_MOD_SPELL_PENETRATION = 47,
|
||||
ITEM_MOD_BLOCK_VALUE = 48
|
||||
ITEM_MOD_BLOCK_VALUE = 48,
|
||||
ITEM_MOD_MASTERY_RATING = 49,
|
||||
ITEM_MOD_EXTRA_ARMOR = 50,
|
||||
ITEM_MOD_FIRE_RESISTANCE = 51,
|
||||
ITEM_MOD_FROST_RESISTANCE = 52,
|
||||
ITEM_MOD_HOLY_RESISTANCE = 53,
|
||||
ITEM_MOD_SHADOW_RESISTANCE = 54,
|
||||
ITEM_MOD_NATURE_RESISTANCE = 55,
|
||||
ITEM_MOD_ARCANE_RESISTANCE = 56,
|
||||
};
|
||||
|
||||
#define MAX_ITEM_MOD 49
|
||||
@@ -543,24 +551,19 @@ inline uint8 ItemSubClassToDurabilityMultiplierId(uint32 ItemClass, uint32 ItemS
|
||||
#pragma pack(push, 1)
|
||||
#endif
|
||||
|
||||
struct _Damage
|
||||
{
|
||||
float DamageMin;
|
||||
float DamageMax;
|
||||
uint32 DamageType; // id from Resistances.dbc
|
||||
};
|
||||
|
||||
struct _ItemStat
|
||||
{
|
||||
uint32 ItemStatType;
|
||||
int32 ItemStatValue;
|
||||
int32 ItemStatUnk1;
|
||||
int32 ItemStatUnk2;
|
||||
};
|
||||
|
||||
struct _Spell
|
||||
{
|
||||
int32 SpellId; // id from Spell.dbc
|
||||
uint32 SpellTrigger;
|
||||
int32 SpellCharges;
|
||||
float SpellPPMRate;
|
||||
int32 SpellCooldown;
|
||||
uint32 SpellCategory; // id from SpellCategory.dbc
|
||||
int32 SpellCategoryCooldown;
|
||||
@@ -583,7 +586,7 @@ struct ItemTemplate
|
||||
uint32 Class; // id from ItemClass.dbc
|
||||
uint32 SubClass; // id from ItemSubClass.dbc
|
||||
int32 Unk0;
|
||||
std::string Name1;
|
||||
std::string Name1;
|
||||
uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc
|
||||
uint32 Quality;
|
||||
uint32 Flags;
|
||||
@@ -609,18 +612,15 @@ struct ItemTemplate
|
||||
uint32 StatsCount;
|
||||
_ItemStat ItemStat[MAX_ITEM_PROTO_STATS];
|
||||
uint32 ScalingStatDistribution; // id from ScalingStatDistribution.dbc
|
||||
_Damage Damage[MAX_ITEM_PROTO_DAMAGES];
|
||||
float DamageMin;
|
||||
float DamageMax;
|
||||
uint32 DamageType; // id from Resistances.dbc
|
||||
float DPS;
|
||||
uint32 Armor;
|
||||
uint32 HolyRes;
|
||||
uint32 FireRes;
|
||||
uint32 NatureRes;
|
||||
uint32 FrostRes;
|
||||
uint32 ShadowRes;
|
||||
uint32 ArcaneRes;
|
||||
uint32 Delay;
|
||||
uint32 AmmoType;
|
||||
float RangedModRange;
|
||||
_Spell Spells[MAX_ITEM_PROTO_SPELLS];
|
||||
float SpellPPMRate;
|
||||
uint32 Bonding;
|
||||
std::string Description;
|
||||
uint32 PageText;
|
||||
@@ -632,7 +632,6 @@ struct ItemTemplate
|
||||
uint32 Sheath;
|
||||
int32 RandomProperty; // id from ItemRandomProperties.dbc
|
||||
int32 RandomSuffix; // id from ItemRandomSuffix.dbc
|
||||
uint32 Block;
|
||||
uint32 ItemSet; // id from ItemSet.dbc
|
||||
uint32 MaxDurability;
|
||||
uint32 Area; // id from AreaTable.dbc
|
||||
@@ -647,6 +646,9 @@ struct ItemTemplate
|
||||
int32 Duration; // negative = realtime, positive = ingame time
|
||||
uint32 ItemLimitCategory; // id from ItemLimitCategory.dbc
|
||||
uint32 HolidayId; // id from Holidays.dbc
|
||||
float StatScalingFactor;
|
||||
int32 Field130;
|
||||
int32 Field131;
|
||||
uint32 ScriptId;
|
||||
uint32 DisenchantID;
|
||||
uint32 FoodType;
|
||||
@@ -679,22 +681,12 @@ struct ItemTemplate
|
||||
return (Stackable == 2147483647 || Stackable <= 0) ? uint32(0x7FFFFFFF-1) : uint32(Stackable);
|
||||
}
|
||||
|
||||
float getDPS() const
|
||||
{
|
||||
if (Delay == 0)
|
||||
return 0;
|
||||
float temp = 0;
|
||||
for (int i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i)
|
||||
temp+=Damage[i].DamageMin + Damage[i].DamageMax;
|
||||
return temp*500/Delay;
|
||||
}
|
||||
|
||||
int32 getFeralBonus(int32 extraDPS = 0) const
|
||||
{
|
||||
// 0x02A5F3 - is mask for Melee weapon from ItemSubClassMask.dbc
|
||||
if (Class == ITEM_CLASS_WEAPON && (1<<SubClass)&0x02A5F3)
|
||||
if (Class == ITEM_CLASS_WEAPON && (1 << SubClass) & 0x02A5F3)
|
||||
{
|
||||
int32 bonus = int32((extraDPS + getDPS())*14.0f) - 767;
|
||||
int32 bonus = int32((extraDPS + DPS) * 14.0f) - 767;
|
||||
if (bonus < 0)
|
||||
return 0;
|
||||
return bonus;
|
||||
|
||||
@@ -8032,6 +8032,24 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
|
||||
case ITEM_MOD_SPELL_HEALING_DONE:
|
||||
case ITEM_MOD_SPELL_DAMAGE_DONE:
|
||||
break;
|
||||
case ITEM_MOD_FIRE_RESISTANCE:
|
||||
HandleStatModifier(UNIT_MOD_RESISTANCE_FIRE, BASE_VALUE, float(val), apply);
|
||||
break;
|
||||
case ITEM_MOD_FROST_RESISTANCE:
|
||||
HandleStatModifier(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, float(val), apply);
|
||||
break;
|
||||
case ITEM_MOD_HOLY_RESISTANCE:
|
||||
HandleStatModifier(UNIT_MOD_RESISTANCE_HOLY, BASE_VALUE, float(val), apply);
|
||||
break;
|
||||
case ITEM_MOD_SHADOW_RESISTANCE:
|
||||
HandleStatModifier(UNIT_MOD_RESISTANCE_SHADOW, BASE_VALUE, float(val), apply);
|
||||
break;
|
||||
case ITEM_MOD_NATURE_RESISTANCE:
|
||||
HandleStatModifier(UNIT_MOD_RESISTANCE_NATURE, BASE_VALUE, float(val), apply);
|
||||
break;
|
||||
case ITEM_MOD_ARCANE_RESISTANCE:
|
||||
HandleStatModifier(UNIT_MOD_RESISTANCE_ARCANE, BASE_VALUE, float(val), apply);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8068,27 +8086,6 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
|
||||
if (proto->ArmorDamageModifier > 0)
|
||||
HandleStatModifier(UNIT_MOD_ARMOR, TOTAL_VALUE, float(proto->ArmorDamageModifier), apply);
|
||||
|
||||
if (proto->Block)
|
||||
HandleBaseModValue(SHIELD_BLOCK_VALUE, FLAT_MOD, float(proto->Block), apply);
|
||||
|
||||
if (proto->HolyRes)
|
||||
HandleStatModifier(UNIT_MOD_RESISTANCE_HOLY, BASE_VALUE, float(proto->HolyRes), apply);
|
||||
|
||||
if (proto->FireRes)
|
||||
HandleStatModifier(UNIT_MOD_RESISTANCE_FIRE, BASE_VALUE, float(proto->FireRes), apply);
|
||||
|
||||
if (proto->NatureRes)
|
||||
HandleStatModifier(UNIT_MOD_RESISTANCE_NATURE, BASE_VALUE, float(proto->NatureRes), apply);
|
||||
|
||||
if (proto->FrostRes)
|
||||
HandleStatModifier(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, float(proto->FrostRes), apply);
|
||||
|
||||
if (proto->ShadowRes)
|
||||
HandleStatModifier(UNIT_MOD_RESISTANCE_SHADOW, BASE_VALUE, float(proto->ShadowRes), apply);
|
||||
|
||||
if (proto->ArcaneRes)
|
||||
HandleStatModifier(UNIT_MOD_RESISTANCE_ARCANE, BASE_VALUE, float(proto->ArcaneRes), apply);
|
||||
|
||||
WeaponAttackType attType = BASE_ATTACK;
|
||||
|
||||
if (slot == EQUIPMENT_SLOT_RANGED && (
|
||||
@@ -8123,8 +8120,8 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt
|
||||
attType = OFF_ATTACK;
|
||||
}
|
||||
|
||||
float minDamage = proto->Damage[0].DamageMin;
|
||||
float maxDamage = proto->Damage[0].DamageMax;
|
||||
float minDamage = proto->DamageMin;
|
||||
float maxDamage = proto->DamageMax;
|
||||
|
||||
// If set dpsMod in ScalingStatValue use it for min (70% from average), max (130% from average) damage
|
||||
int32 extraDPS = 0;
|
||||
@@ -8410,7 +8407,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
|
||||
|
||||
float chance = (float)spellInfo->ProcChance;
|
||||
|
||||
if (spellData.SpellPPMRate)
|
||||
if (proto->SpellPPMRate)
|
||||
{
|
||||
if (spellData.SpellId == 52781) // Persuasive Strike
|
||||
{
|
||||
@@ -8425,7 +8422,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
|
||||
}
|
||||
}
|
||||
uint32 WeaponSpeed = GetAttackTime(attType);
|
||||
chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate, spellInfo);
|
||||
chance = GetPPMProcChance(WeaponSpeed, proto->SpellPPMRate, spellInfo);
|
||||
}
|
||||
else if (chance > 100.0f)
|
||||
{
|
||||
@@ -18334,7 +18331,7 @@ void Player::SaveToDB(bool create /*=false*/)
|
||||
stmt->setFloat(index++, finiteAlways(GetPositionY()));
|
||||
stmt->setFloat(index++, finiteAlways(GetPositionZ()));
|
||||
stmt->setFloat(index++, finiteAlways(GetOrientation()));
|
||||
|
||||
|
||||
std::ostringstream ss;
|
||||
ss << m_taxi;
|
||||
stmt->setString(index++, ss.str());
|
||||
@@ -18356,7 +18353,7 @@ void Player::SaveToDB(bool create /*=false*/)
|
||||
|
||||
ss.str().clear();
|
||||
ss << m_taxi.SaveTaxiDestinationsToString();
|
||||
|
||||
|
||||
stmt->setString(index++, ss.str());
|
||||
stmt->setUInt32(index++, GetArenaPoints());
|
||||
stmt->setUInt32(index++, GetHonorPoints());
|
||||
@@ -18389,7 +18386,7 @@ void Player::SaveToDB(bool create /*=false*/)
|
||||
for (uint32 i = 0; i < EQUIPMENT_SLOT_END * 2; ++i)
|
||||
ss << GetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + i) << ' ';
|
||||
stmt->setString(index++, ss.str());
|
||||
|
||||
|
||||
ss.str().clear();
|
||||
// ...and bags for enum opcode
|
||||
for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||
@@ -24825,4 +24822,4 @@ bool Player::IsInWhisperWhiteList(uint64 guid)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1844,7 +1844,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(), GetGUID(), method); }
|
||||
void SendUpdateToOutOfRangeGroupMembers();
|
||||
|
||||
void SetInGuild(uint32 GuildId)
|
||||
void SetInGuild(uint32 GuildId)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_ID);
|
||||
stmt->setUInt32(0, GuildId);
|
||||
@@ -2538,7 +2538,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
CreatureDisplayInfoEntry const* mountDisplayInfo = sCreatureDisplayInfoStore.LookupEntry(GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID));
|
||||
if (!mountDisplayInfo)
|
||||
return GetCollisionHeight(false);
|
||||
|
||||
|
||||
CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelId);
|
||||
if (!mountModelData)
|
||||
return GetCollisionHeight(false);
|
||||
|
||||
@@ -2715,7 +2715,7 @@ float Unit::GetUnitBlockChance() const
|
||||
if (player->CanBlock())
|
||||
{
|
||||
Item* tmpitem = player->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
|
||||
if (tmpitem && !tmpitem->IsBroken() && tmpitem->GetTemplate()->Block)
|
||||
if (tmpitem && !tmpitem->IsBroken())
|
||||
return GetFloatValue(PLAYER_BLOCK_PERCENTAGE);
|
||||
}
|
||||
// is player but has no block ability or no not broken shield equipped
|
||||
@@ -8674,7 +8674,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
|
||||
ItemTemplate const* weapon = item->GetTemplate();
|
||||
|
||||
float weaponDPS = weapon->getDPS();
|
||||
float weaponDPS = weapon->DPS;
|
||||
float attackPower = GetTotalAttackPowerValue(BASE_ATTACK) / 14.0f;
|
||||
float weaponSpeed = float(weapon->Delay) / 1000.0f;
|
||||
basepoints0 = int32((weaponDPS + attackPower) * weaponSpeed);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -865,6 +865,8 @@ class ObjectMgr
|
||||
void LoadGameobjects();
|
||||
void LoadGameobjectRespawnTimes();
|
||||
void LoadItemTemplates();
|
||||
void LoadItemTemplateAddon();
|
||||
void LoadItemScriptNames();
|
||||
void LoadItemLocales();
|
||||
void LoadItemSetNames();
|
||||
void LoadItemSetNameLocales();
|
||||
@@ -1285,7 +1287,6 @@ class ObjectMgr
|
||||
PlayerClassInfo playerClassInfo[MAX_CLASSES];
|
||||
|
||||
void BuildPlayerLevelInfo(uint8 race, uint8 class_, uint8 level, PlayerLevelInfo* plinfo) const;
|
||||
|
||||
PlayerInfo playerInfo[MAX_RACES][MAX_CLASSES];
|
||||
|
||||
typedef std::vector<uint32> PlayerXPperLevel; // [level]
|
||||
|
||||
@@ -178,7 +178,7 @@ void GuildMgr::LoadGuilds()
|
||||
CharacterDatabase.DirectExecute("DELETE gm FROM guild_member gm LEFT JOIN guild g ON gm.guildId = g.guildId WHERE g.guildId IS NULL");
|
||||
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult result = CharacterDatabase.Query("SELECT guildid, gm.guid, rank, pnote, offnote, BankResetTimeMoney, BankRemMoney, "
|
||||
QueryResult result = CharacterDatabase.Query("SELECT gm.guildid, gm.guid, rank, pnote, offnote, BankResetTimeMoney, BankRemMoney, "
|
||||
// 7 8 9 10 11 12
|
||||
"BankResetTimeTab0, BankRemSlotsTab0, BankResetTimeTab1, BankRemSlotsTab1, BankResetTimeTab2, BankRemSlotsTab2, "
|
||||
// 13 14 15 16 17 18
|
||||
|
||||
@@ -232,7 +232,7 @@ void LootStore::ReportUnusedIds(LootIdSet const& ids_set) const
|
||||
|
||||
void LootStore::ReportNotExistedId(uint32 id) const
|
||||
{
|
||||
sLog->outErrorDb("Table '%s' entry %d (%s) not exist but used as loot id in DB.", GetName(), id, GetEntryName());
|
||||
sLog->outErrorDb("Table '%s' entry %d (%s) does not exist but used as loot id in DB.", GetName(), id, GetEntryName());
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1461,16 +1461,17 @@ void LoadLootTemplates_Disenchant()
|
||||
LootIdSet lootIdSet, loodIdSetUsed;
|
||||
uint32 count = LootTemplates_Disenchant.LoadAndCollectLootIds(lootIdSet);
|
||||
|
||||
ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
|
||||
for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr)
|
||||
for (uint32 i = 0; i < sItemDisenchantLootStore.GetNumRows(); ++i)
|
||||
{
|
||||
if (uint32 lootid = itr->second.DisenchantID)
|
||||
{
|
||||
if (lootIdSet.find(lootid) == lootIdSet.end())
|
||||
LootTemplates_Disenchant.ReportNotExistedId(lootid);
|
||||
else
|
||||
loodIdSetUsed.insert(lootid);
|
||||
}
|
||||
ItemDisenchantLootEntry const* disenchant = sItemDisenchantLootStore.LookupEntry(i);
|
||||
if (!disenchant)
|
||||
continue;
|
||||
|
||||
uint32 lootid = disenchant->Id;
|
||||
if (lootIdSet.find(lootid) == lootIdSet.end())
|
||||
LootTemplates_Disenchant.ReportNotExistedId(lootid);
|
||||
else
|
||||
loodIdSetUsed.insert(lootid);
|
||||
}
|
||||
|
||||
for (LootIdSet::const_iterator itr = loodIdSetUsed.begin(); itr != loodIdSetUsed.end(); ++itr)
|
||||
|
||||
@@ -280,160 +280,153 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data)
|
||||
// Only _static_ data send in this packet !!!
|
||||
void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_ITEM_QUERY_SINGLE");
|
||||
uint32 item;
|
||||
recv_data >> item;
|
||||
uint32 count, type;
|
||||
recv_data >> count >> type;
|
||||
|
||||
sLog->outDetail("STORAGE: Item Query = %u", item);
|
||||
if (type != DB2_REPLY_SPARSE && type != DB2_REPLY_ITEM)
|
||||
return;
|
||||
|
||||
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item);
|
||||
if (pProto)
|
||||
for (uint32 i = 0; i < count; ++i)
|
||||
{
|
||||
std::string Name = pProto->Name1;
|
||||
std::string Description = pProto->Description;
|
||||
uint32 item;
|
||||
recv_data >> item;
|
||||
recv_data.read_skip<uint64>();
|
||||
WorldPacket data2(SMSG_DB_REPLY, 700);
|
||||
ByteBuffer data;
|
||||
data2 << uint32(type);
|
||||
data2 << uint32(item);
|
||||
|
||||
int loc_idx = GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item);
|
||||
if (proto)
|
||||
{
|
||||
if (ItemLocale const* il = sObjectMgr->GetItemLocale(pProto->ItemId))
|
||||
data << uint32(item);
|
||||
if (type == DB2_REPLY_ITEM)
|
||||
{
|
||||
ObjectMgr::GetLocaleString(il->Name, loc_idx, Name);
|
||||
ObjectMgr::GetLocaleString(il->Description, loc_idx, Description);
|
||||
data << uint32(proto->Class);
|
||||
data << uint32(proto->SubClass);
|
||||
data << int32(proto->Unk0);
|
||||
data << uint32(proto->Material);
|
||||
data << uint32(proto->DisplayInfoID);
|
||||
data << uint32(proto->InventoryType);
|
||||
data << uint32(proto->Sheath);
|
||||
}
|
||||
}
|
||||
// guess size
|
||||
WorldPacket data(SMSG_ITEM_QUERY_SINGLE_RESPONSE, 600);
|
||||
data << pProto->ItemId;
|
||||
data << pProto->Class;
|
||||
data << pProto->SubClass;
|
||||
data << int32(pProto->Unk0); // new 2.0.3, not exist in wdb cache?
|
||||
data << Name;
|
||||
data << uint8(0x00); //pProto->Name2; // blizz not send name there, just uint8(0x00); <-- \0 = empty string = empty name...
|
||||
data << uint8(0x00); //pProto->Name3; // blizz not send name there, just uint8(0x00);
|
||||
data << uint8(0x00); //pProto->Name4; // blizz not send name there, just uint8(0x00);
|
||||
data << pProto->DisplayInfoID;
|
||||
data << pProto->Quality;
|
||||
data << pProto->Flags;
|
||||
data << pProto->Flags2;
|
||||
data << pProto->BuyPrice;
|
||||
data << pProto->SellPrice;
|
||||
data << pProto->InventoryType;
|
||||
data << pProto->AllowableClass;
|
||||
data << pProto->AllowableRace;
|
||||
data << pProto->ItemLevel;
|
||||
data << pProto->RequiredLevel;
|
||||
data << pProto->RequiredSkill;
|
||||
data << pProto->RequiredSkillRank;
|
||||
data << pProto->RequiredSpell;
|
||||
data << pProto->RequiredHonorRank;
|
||||
data << pProto->RequiredCityRank;
|
||||
data << pProto->RequiredReputationFaction;
|
||||
data << pProto->RequiredReputationRank;
|
||||
data << int32(pProto->MaxCount);
|
||||
data << int32(pProto->Stackable);
|
||||
data << pProto->ContainerSlots;
|
||||
data << pProto->StatsCount; // item stats count
|
||||
for (uint32 i = 0; i < pProto->StatsCount; ++i)
|
||||
{
|
||||
data << pProto->ItemStat[i].ItemStatType;
|
||||
data << pProto->ItemStat[i].ItemStatValue;
|
||||
}
|
||||
data << pProto->ScalingStatDistribution; // scaling stats distribution
|
||||
data << uint32(0);
|
||||
for (int i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i)
|
||||
{
|
||||
data << pProto->Damage[i].DamageMin;
|
||||
data << pProto->Damage[i].DamageMax;
|
||||
data << pProto->Damage[i].DamageType;
|
||||
}
|
||||
|
||||
// resistances (7)
|
||||
data << pProto->Armor;
|
||||
data << pProto->HolyRes;
|
||||
data << pProto->FireRes;
|
||||
data << pProto->NatureRes;
|
||||
data << pProto->FrostRes;
|
||||
data << pProto->ShadowRes;
|
||||
data << pProto->ArcaneRes;
|
||||
|
||||
data << pProto->Delay;
|
||||
data << pProto->AmmoType;
|
||||
data << pProto->RangedModRange;
|
||||
|
||||
for (int s = 0; s < MAX_ITEM_PROTO_SPELLS; ++s)
|
||||
{
|
||||
// send DBC data for cooldowns in same way as it used in Spell::SendSpellCooldown
|
||||
// use `item_template` or if not set then only use spell cooldowns
|
||||
SpellInfo const* spell = sSpellMgr->GetSpellInfo(pProto->Spells[s].SpellId);
|
||||
if (spell)
|
||||
else if (type == DB2_REPLY_SPARSE)
|
||||
{
|
||||
bool db_data = pProto->Spells[s].SpellCooldown >= 0 || pProto->Spells[s].SpellCategoryCooldown >= 0;
|
||||
data << uint32(proto->Quality);
|
||||
data << uint32(proto->Flags);
|
||||
data << uint32(proto->Flags2);
|
||||
data << int32(proto->BuyPrice);
|
||||
data << uint32(proto->SellPrice);
|
||||
data << uint32(proto->InventoryType);
|
||||
data << int32(proto->AllowableClass);
|
||||
data << int32(proto->AllowableRace);
|
||||
data << uint32(proto->ItemLevel);
|
||||
data << uint32(proto->RequiredLevel);
|
||||
data << uint32(proto->RequiredSkill);
|
||||
data << uint32(proto->RequiredSkillRank);
|
||||
data << uint32(proto->RequiredSpell);
|
||||
data << uint32(proto->RequiredHonorRank);
|
||||
data << uint32(proto->RequiredCityRank);
|
||||
data << uint32(proto->RequiredReputationFaction);
|
||||
data << uint32(proto->RequiredReputationRank);
|
||||
data << int32(proto->MaxCount);
|
||||
data << int32(proto->Stackable);
|
||||
data << uint32(proto->ContainerSlots);
|
||||
|
||||
data << pProto->Spells[s].SpellId;
|
||||
data << pProto->Spells[s].SpellTrigger;
|
||||
data << uint32(-abs(pProto->Spells[s].SpellCharges));
|
||||
for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x)
|
||||
data << uint32(proto->ItemStat[x].ItemStatType);
|
||||
|
||||
if (db_data)
|
||||
{
|
||||
data << uint32(pProto->Spells[s].SpellCooldown);
|
||||
data << uint32(pProto->Spells[s].SpellCategory);
|
||||
data << uint32(pProto->Spells[s].SpellCategoryCooldown);
|
||||
}
|
||||
else
|
||||
{
|
||||
data << uint32(spell->RecoveryTime);
|
||||
data << uint32(spell->Category);
|
||||
data << uint32(spell->CategoryRecoveryTime);
|
||||
}
|
||||
for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x)
|
||||
data << int32(proto->ItemStat[x].ItemStatValue);
|
||||
|
||||
for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x)
|
||||
data << int32(proto->ItemStat[x].ItemStatUnk1);
|
||||
|
||||
for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x)
|
||||
data << int32(proto->ItemStat[x].ItemStatUnk2);
|
||||
|
||||
data << uint32(proto->ScalingStatDistribution);
|
||||
data << uint32(proto->DamageType);
|
||||
data << uint32(proto->Delay);
|
||||
data << float(proto->RangedModRange);
|
||||
|
||||
for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
|
||||
data << int32(proto->Spells[x].SpellId);
|
||||
|
||||
for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
|
||||
data << uint32(proto->Spells[x].SpellTrigger);
|
||||
|
||||
for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
|
||||
data << int32(proto->Spells[x].SpellCharges);
|
||||
|
||||
for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
|
||||
data << int32(proto->Spells[x].SpellCooldown);
|
||||
|
||||
for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
|
||||
data << uint32(proto->Spells[x].SpellCategory);
|
||||
|
||||
for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x)
|
||||
data << int32(proto->Spells[x].SpellCategoryCooldown);
|
||||
|
||||
data << uint32(proto->Bonding);
|
||||
|
||||
// item name
|
||||
std::string name = proto->Name1;
|
||||
data << uint16(name.length() + 1);
|
||||
data << name;
|
||||
|
||||
for (uint32 i = 0; i < 3; ++i) // other 3 names
|
||||
data << uint16(0);
|
||||
|
||||
std::string desc = proto->Description;
|
||||
data << uint16(desc.length() + 1);
|
||||
data << desc;
|
||||
|
||||
data << uint32(proto->PageText);
|
||||
data << uint32(proto->LanguageID);
|
||||
data << uint32(proto->PageMaterial);
|
||||
data << uint32(proto->StartQuest);
|
||||
data << uint32(proto->LockID);
|
||||
data << int32(proto->Material);
|
||||
data << uint32(proto->Sheath);
|
||||
data << int32(proto->RandomProperty);
|
||||
data << int32(proto->RandomSuffix);
|
||||
data << uint32(proto->ItemSet);
|
||||
data << uint32(proto->MaxDurability);
|
||||
|
||||
data << uint32(proto->Area);
|
||||
data << uint32(proto->Map);
|
||||
data << uint32(proto->BagFamily);
|
||||
data << uint32(proto->TotemCategory);
|
||||
|
||||
for (uint32 x = 0; x < MAX_ITEM_PROTO_SOCKETS; ++x)
|
||||
data << uint32(proto->Socket[x].Color);
|
||||
|
||||
for (uint32 x = 0; x < MAX_ITEM_PROTO_SOCKETS; ++x)
|
||||
data << uint32(proto->Socket[x].Content);
|
||||
|
||||
data << uint32(proto->socketBonus);
|
||||
data << uint32(proto->GemProperties);
|
||||
data << float(proto->ArmorDamageModifier);
|
||||
data << int32(proto->Duration);
|
||||
data << uint32(proto->ItemLimitCategory);
|
||||
data << uint32(proto->HolidayId);
|
||||
data << float(proto->StatScalingFactor); // StatScalingFactor
|
||||
data << uint32(proto->Field130); // archaeology unk
|
||||
data << uint32(proto->Field131); // archaeology findinds count
|
||||
}
|
||||
else
|
||||
{
|
||||
data << uint32(item | 0x80000000); // sometimes with | 0x80000000
|
||||
data << uint32(0);
|
||||
data << uint32(0);
|
||||
data << uint32(0);
|
||||
data << uint32(-1);
|
||||
data << uint32(0);
|
||||
data << uint32(-1);
|
||||
}
|
||||
|
||||
data2 << uint32(data.size());
|
||||
data2.append(data);
|
||||
}
|
||||
data << pProto->Bonding;
|
||||
data << Description;
|
||||
data << pProto->PageText;
|
||||
data << pProto->LanguageID;
|
||||
data << pProto->PageMaterial;
|
||||
data << pProto->StartQuest;
|
||||
data << pProto->LockID;
|
||||
data << int32(pProto->Material);
|
||||
data << pProto->Sheath;
|
||||
data << pProto->RandomProperty;
|
||||
data << pProto->RandomSuffix;
|
||||
data << pProto->Block;
|
||||
data << pProto->ItemSet;
|
||||
data << pProto->MaxDurability;
|
||||
data << pProto->Area;
|
||||
data << pProto->Map; // Added in 1.12.x & 2.0.1 client branch
|
||||
data << pProto->BagFamily;
|
||||
data << pProto->TotemCategory;
|
||||
for (int s = 0; s < MAX_ITEM_PROTO_SOCKETS; ++s)
|
||||
{
|
||||
data << pProto->Socket[s].Color;
|
||||
data << pProto->Socket[s].Content;
|
||||
}
|
||||
data << pProto->socketBonus;
|
||||
data << pProto->GemProperties;
|
||||
data << pProto->RequiredDisenchantSkill;
|
||||
data << pProto->ArmorDamageModifier;
|
||||
data << uint32(abs(pProto->Duration)); // added in 2.4.2.8209, duration (seconds)
|
||||
data << pProto->ItemLimitCategory; // WotLK, ItemLimitCategory
|
||||
data << pProto->HolidayId; // Holiday.dbc?
|
||||
SendPacket(&data);
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_QUERY_SINGLE - NO item INFO! (ENTRY: %u)", item);
|
||||
WorldPacket data(SMSG_ITEM_QUERY_SINGLE_RESPONSE, 4);
|
||||
data << uint32(item | 0x80000000);
|
||||
SendPacket(&data);
|
||||
|
||||
data2 << uint32(type);
|
||||
_player->GetSession()->SendPacket(&data2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -981,25 +974,6 @@ void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket)
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleSetAmmoOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
if (!GetPlayer()->isAlive())
|
||||
{
|
||||
GetPlayer()->SendEquipError(EQUIP_ERR_YOU_ARE_DEAD, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_AMMO");
|
||||
uint32 item;
|
||||
|
||||
recv_data >> item;
|
||||
|
||||
if (!item)
|
||||
GetPlayer()->RemoveAmmo();
|
||||
else
|
||||
GetPlayer()->SetAmmo(item);
|
||||
}
|
||||
|
||||
void WorldSession::SendEnchantmentLog(uint64 Target, uint64 Caster, uint32 ItemID, uint32 SpellID)
|
||||
{
|
||||
WorldPacket data(SMSG_ENCHANTMENTLOG, (8+8+4+4+1)); // last check 2.0.10
|
||||
|
||||
@@ -40,7 +40,7 @@ void InitOpcodes()
|
||||
}
|
||||
|
||||
memset(opcodeTable, 0, sizeof(opcodeTable));
|
||||
|
||||
|
||||
//DEFINE_OPCODE_HANDLER(MSG_NULL_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_BOOTME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
||||
@@ -658,7 +658,7 @@ void InitOpcodes()
|
||||
//DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
//DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
//DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_SET_AMMO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetAmmoOpcode );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_SET_AMMO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
||||
//DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode );
|
||||
@@ -707,7 +707,7 @@ void InitOpcodes()
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
||||
//DEFINE_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
//DEFINE_OPCODE_HANDLER(SMSG_RESET_RANGED_COMBAT_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
////DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
//DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
//DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_CANCEL_GROWTH_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode );
|
||||
//DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
@@ -919,7 +919,7 @@ void InitOpcodes()
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_NEEDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_BOOT_VOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode );
|
||||
////DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
//DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_LFD_PLAYER_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPlayerLockInfoRequestOpcode);
|
||||
//DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
|
||||
//DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode );
|
||||
|
||||
@@ -137,6 +137,9 @@ enum CharterTypes
|
||||
ARENA_TEAM_CHARTER_5v5_TYPE = 5
|
||||
};
|
||||
|
||||
#define DB2_REPLY_SPARSE 2442913102
|
||||
#define DB2_REPLY_ITEM 1344507586
|
||||
|
||||
//class to deal with packet processing
|
||||
//allows to determine if next packet is safe to be processed
|
||||
class PacketFilter
|
||||
@@ -478,7 +481,6 @@ class WorldSession
|
||||
void HandleDelIgnoreOpcode(WorldPacket& recvPacket);
|
||||
void HandleSetContactNotesOpcode(WorldPacket& recvPacket);
|
||||
void HandleBugOpcode(WorldPacket& recvPacket);
|
||||
void HandleSetAmmoOpcode(WorldPacket& recvPacket);
|
||||
void HandleItemNameQueryOpcode(WorldPacket& recvPacket);
|
||||
|
||||
void HandleAreaTriggerOpcode(WorldPacket& recvPacket);
|
||||
|
||||
@@ -1992,7 +1992,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
|
||||
{
|
||||
case FORM_CAT:
|
||||
{
|
||||
int32 basePoints = int32(std::min(oldPower, FurorChance));
|
||||
int32 basePoints = std::min<int32>(oldPower, FurorChance);
|
||||
target->SetPower(POWER_ENERGY, 0);
|
||||
target->CastCustomSpell(target, 17099, &basePoints, NULL, NULL, true, NULL, this);
|
||||
}
|
||||
|
||||
@@ -513,7 +513,7 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme
|
||||
// wand case
|
||||
if ((m_caster->getClassMask() & CLASSMASK_WAND_USERS) != 0 && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
if (Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK))
|
||||
m_spellSchoolMask = SpellSchoolMask(1 << pItem->GetTemplate()->Damage[0].DamageType);
|
||||
m_spellSchoolMask = SpellSchoolMask(1 << pItem->GetTemplate()->DamageType);
|
||||
|
||||
if (originalCasterGUID)
|
||||
m_originalCasterGUID = originalCasterGUID;
|
||||
|
||||
@@ -694,8 +694,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
|
||||
Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK);
|
||||
if (item)
|
||||
{
|
||||
float dmg_min = item->GetTemplate()->Damage->DamageMin;
|
||||
float dmg_max = item->GetTemplate()->Damage->DamageMax;
|
||||
float dmg_min = item->GetTemplate()->DamageMin;
|
||||
float dmg_max = item->GetTemplate()->DamageMax;
|
||||
if (dmg_max == 0.0f && dmg_min > dmg_max)
|
||||
damage += int32(dmg_min);
|
||||
else
|
||||
|
||||
@@ -1344,13 +1344,19 @@ void World::SetInitialWorldSettings()
|
||||
sLog->outString("Loading Item Random Enchantments Table...");
|
||||
LoadRandomEnchantmentsTable();
|
||||
|
||||
sLog->outString("Loading Disables");
|
||||
DisableMgr::LoadDisables(); // must be before loading quests and items
|
||||
sLog->outString("Loading Disables...");
|
||||
DisableMgr::LoadDisables(); // must be before loading quests and items
|
||||
|
||||
sLog->outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
|
||||
sLog->outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
|
||||
sObjectMgr->LoadItemTemplates();
|
||||
|
||||
sLog->outString("Loading Item set names..."); // must be after LoadItemPrototypes
|
||||
sLog->outString("Loading Item Extra Data..."); // must be after LoadItemPrototypes
|
||||
sObjectMgr->LoadItemTemplateAddon();
|
||||
|
||||
sLog->outString("Loading Item Scripts..."); // must be after LoadItemPrototypes
|
||||
sObjectMgr->LoadItemScriptNames();
|
||||
|
||||
sLog->outString("Loading Item set names..."); // must be after LoadItemPrototypes
|
||||
sObjectMgr->LoadItemSetNames();
|
||||
|
||||
sLog->outString("Loading Creature Model Based Info Data...");
|
||||
|
||||
@@ -266,7 +266,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
|
||||
// Corpse
|
||||
PREPARE_STATEMENT(CHAR_LOAD_CORPSES, "SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, flags, dynFlags, time, corpseType, instanceId, phaseMask, corpseGuid, guid FROM corpse WHERE corpseType <> 0", CONNECTION_SYNCH)
|
||||
PREPARE_STATEMENT(CHAR_ADD_CORPSE, "INSERT INTO corpse (corpseGuid, guid, posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, flags, dynFlags, time, corpseType, instanceId, phaseMask) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
|
||||
PREPARE_STATEMENT(CHAR_ADD_CORPSE, "INSERT INTO corpse (corpseGuid, guid, posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, flags, dynFlags, time, corpseType, instanceId, phaseMask) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC)
|
||||
PREPARE_STATEMENT(CHAR_DEL_CORPSE, "DELETE FROM corpse WHERE corpseGuid = ?", CONNECTION_ASYNC)
|
||||
PREPARE_STATEMENT(CHAR_DEL_PLAYER_CORPSES, "DELETE FROM corpse WHERE guid = ? AND corpseType <> 0", CONNECTION_ASYNC)
|
||||
PREPARE_STATEMENT(CHAR_DEL_OLD_CORPSES, "DELETE FROM corpse WHERE corpseType = 0 OR time < (UNIX_TIMESTAMP(NOW()) - ?)", CONNECTION_ASYNC)
|
||||
|
||||
@@ -108,7 +108,7 @@ class ByteBuffer
|
||||
{
|
||||
++_bitpos;
|
||||
if (_bitpos > 7)
|
||||
{
|
||||
{
|
||||
_bitpos = 0;
|
||||
_curbitval = read<uint8>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user