1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-23 21:27:46 +00:00

Fixed up how "special" items work (ie: PUG and ARC weapons). No more glitches hopefully.

This commit is contained in:
Filip Maj 2017-07-09 11:39:17 -04:00
parent caf254fd95
commit 77d6cb2e43
5 changed files with 62 additions and 10 deletions

View file

@ -84,11 +84,12 @@ namespace FFXIVClassic_Map_Server
SELECT SELECT
* *
FROM gamedata_items FROM gamedata_items
LEFT JOIN gamedata_items_equipment ON gamedata_items.catalogID = gamedata_items_equipment.catalogID LEFT JOIN gamedata_items_equipment ON gamedata_items.catalogID = gamedata_items_equipment.catalogID
LEFT JOIN gamedata_items_accessory ON gamedata_items.catalogID = gamedata_items_accessory.catalogID LEFT JOIN gamedata_items_accessory ON gamedata_items.catalogID = gamedata_items_accessory.catalogID
LEFT JOIN gamedata_items_armor ON gamedata_items.catalogID = gamedata_items_armor.catalogID LEFT JOIN gamedata_items_armor ON gamedata_items.catalogID = gamedata_items_armor.catalogID
LEFT JOIN gamedata_items_weapon ON gamedata_items.catalogID = gamedata_items_weapon.catalogID LEFT JOIN gamedata_items_weapon ON gamedata_items.catalogID = gamedata_items_weapon.catalogID
LEFT JOIN gamedata_items_graphics ON gamedata_items.catalogID = gamedata_items_graphics.catalogID LEFT JOIN gamedata_items_graphics ON gamedata_items.catalogID = gamedata_items_graphics.catalogID
LEFT JOIN gamedata_items_graphics_extra ON gamedata_items.catalogID = gamedata_items_graphics_extra.catalogID
"; ";
MySqlCommand cmd = new MySqlCommand(query, conn); MySqlCommand cmd = new MySqlCommand(query, conn);

View file

@ -1005,6 +1005,19 @@ namespace FFXIVClassic_Map_Server.Actors
appearanceIds[slot] = graphicId; appearanceIds[slot] = graphicId;
} }
//Handle offhand
if (slot == MAINHAND && item is WeaponItem)
{
WeaponItem wpItem = (WeaponItem)item;
uint graphicId =
(wpItem.graphicsOffhandWeaponId & 0x3FF) << 20 |
(wpItem.graphicsOffhandEquipmentId & 0x3FF) << 10 |
(wpItem.graphicsOffhandVariantId & 0x3FF);
appearanceIds[SetActorAppearancePacket.OFFHAND] = graphicId;
}
} }
Database.SavePlayerAppearance(this); Database.SavePlayerAppearance(this);

View file

@ -467,6 +467,11 @@ namespace FFXIVClassic_Map_Server.dataobjects
class WeaponItem : EquipmentItem class WeaponItem : EquipmentItem
{ {
//extra graphics
public readonly uint graphicsOffhandWeaponId;
public readonly uint graphicsOffhandEquipmentId;
public readonly uint graphicsOffhandVariantId;
//weapon sheet //weapon sheet
public readonly short attack; public readonly short attack;
public readonly short magicAttack; public readonly short magicAttack;
@ -497,6 +502,13 @@ namespace FFXIVClassic_Map_Server.dataobjects
public WeaponItem(MySqlDataReader reader) public WeaponItem(MySqlDataReader reader)
: base(reader) : base(reader)
{ {
if (!reader.IsDBNull(reader.GetOrdinal("offHandWeaponId")) && !reader.IsDBNull(reader.GetOrdinal("offHandEquipmentId")) && !reader.IsDBNull(reader.GetOrdinal("offHandVarientId")))
{
graphicsOffhandWeaponId = reader.GetUInt32("offHandWeaponId");
graphicsOffhandEquipmentId = reader.GetUInt32("offHandEquipmentId");
graphicsOffhandVariantId = reader.GetUInt32("offHandVarientId");
}
attack = reader.GetInt16("attack"); attack = reader.GetInt16("attack");
magicAttack = reader.GetInt16("magicAttack"); magicAttack = reader.GetInt16("magicAttack");
craftProcessing = reader.GetInt16("craftProcessing"); craftProcessing = reader.GetInt16("craftProcessing");

View file

@ -147,8 +147,10 @@ function equipItem(player, equipSlot, item)
player:GetEquipment():Equip(equipSlot, item); player:GetEquipment():Equip(equipSlot, item);
if (equipSlot == EQUIPSLOT_MAINHAND and gItem:IsNailWeapon() == false and gItem:IsBowWeapon() == false) then graphicSlot = GRAPHICSLOT_MAINHAND; if (equipSlot == EQUIPSLOT_MAINHAND and gItem:IsNailWeapon() == false) then graphicSlot = GRAPHICSLOT_MAINHAND;
elseif (equipSlot == EQUIPSLOT_OFFHAND) then graphicSlot = GRAPHICSLOT_OFFHAND; elseif (equipSlot == EQUIPSLOT_OFFHAND) then graphicSlot = GRAPHICSLOT_OFFHAND;
elseif (equipSlot == EQUIPSLOT_THROWINGWEAPON) then graphicSlot = GRAPHICSLOT_THROWING;
elseif (equipSlot == EQUIPSLOT_PACK) then graphicSlot = GRAPHICSLOT_PACK;
elseif (equipSlot == EQUIPSLOT_HEAD) then graphicSlot = GRAPHICSLOT_HEAD; elseif (equipSlot == EQUIPSLOT_HEAD) then graphicSlot = GRAPHICSLOT_HEAD;
elseif (equipSlot == EQUIPSLOT_BODY) then graphicSlot = GRAPHICSLOT_BODY; elseif (equipSlot == EQUIPSLOT_BODY) then graphicSlot = GRAPHICSLOT_BODY;
elseif (equipSlot == EQUIPSLOT_LEGS) then graphicSlot = GRAPHICSLOT_LEGS; elseif (equipSlot == EQUIPSLOT_LEGS) then graphicSlot = GRAPHICSLOT_LEGS;
@ -162,13 +164,9 @@ function equipItem(player, equipSlot, item)
--Graphic Slot was set, otherwise it's a special case --Graphic Slot was set, otherwise it's a special case
if (graphicSlot ~= nil) then if (graphicSlot ~= nil) then
player:GraphicChange(graphicSlot, item); player:GraphicChange(graphicSlot, item);
if (graphicSlot == GRAPHICSLOT_MAINHAND) then player:GraphicChange(GRAPHICSLOT_OFFHAND, nil); end
elseif (gItem:IsNailWeapon()) then elseif (gItem:IsNailWeapon()) then
player:GraphicChange(GRAPHICSLOT_MAINHAND, item); player:GraphicChange(GRAPHICSLOT_MAINHAND, item);
player:GraphicChange(GRAPHICSLOT_OFFHAND, item); player:GraphicChange(GRAPHICSLOT_OFFHAND, item);
elseif (gItem:IsBowWeapon()) then
player:GraphicChange(GRAPHICSLOT_MAINHAND, item);
--player:GraphicChange(GRAPHICSLOT_OFFHAND, item);
elseif (equipSlot == EQUIPSLOT_EARS) then elseif (equipSlot == EQUIPSLOT_EARS) then
player:GraphicChange(GRAPHICSLOT_R_EAR, item); player:GraphicChange(GRAPHICSLOT_R_EAR, item);
player:GraphicChange(GRAPHICSLOT_L_EAR, item); player:GraphicChange(GRAPHICSLOT_L_EAR, item);
@ -203,6 +201,8 @@ function unequipItem(player, equipSlot, item)
else else
if (equipSlot == EQUIPSLOT_MAINHAND) then player:GraphicChange(GRAPHICSLOT_MAINHAND, nil); if (equipSlot == EQUIPSLOT_MAINHAND) then player:GraphicChange(GRAPHICSLOT_MAINHAND, nil);
elseif (equipSlot == EQUIPSLOT_OFFHAND) then player:GraphicChange(GRAPHICSLOT_OFFHAND, nil); elseif (equipSlot == EQUIPSLOT_OFFHAND) then player:GraphicChange(GRAPHICSLOT_OFFHAND, nil);
elseif (equipSlot == EQUIPSLOT_THROWINGWEAPON) then player:GraphicChange(GRAPHICSLOT_THROWING, nil);
elseif (equipSlot == EQUIPSLOT_PACK) then player:GraphicChange(GRAPHICSLOT_PACK, nil);
elseif (equipSlot == EQUIPSLOT_HEAD) then player:GraphicChange(GRAPHICSLOT_HEAD, nil); elseif (equipSlot == EQUIPSLOT_HEAD) then player:GraphicChange(GRAPHICSLOT_HEAD, nil);
elseif (equipSlot == EQUIPSLOT_WAIST) then player:GraphicChange(GRAPHICSLOT_WAIST, nil); elseif (equipSlot == EQUIPSLOT_WAIST) then player:GraphicChange(GRAPHICSLOT_WAIST, nil);
elseif (equipSlot == EQUIPSLOT_EARS) then player:GraphicChange(GRAPHICSLOT_L_EAR, nil); player:GraphicChange(GRAPHICSLOT_R_EAR, nil); elseif (equipSlot == EQUIPSLOT_EARS) then player:GraphicChange(GRAPHICSLOT_L_EAR, nil); player:GraphicChange(GRAPHICSLOT_R_EAR, nil);

View file

@ -0,0 +1,26 @@
/*
MySQL Data Transfer
Source Host: localhost
Source Database: ffxiv_server
Target Host: localhost
Target Database: ffxiv_server
Date: 7/9/2017 11:38:35 AM
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for gamedata_items_graphics_extra
-- ----------------------------
CREATE TABLE `gamedata_items_graphics_extra` (
`catalogID` int(10) unsigned NOT NULL,
`offHandWeaponId` int(10) unsigned NOT NULL DEFAULT '0',
`offHandEquipmentId` int(10) unsigned NOT NULL DEFAULT '0',
`offHandVarientId` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`catalogID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records
-- ----------------------------
INSERT INTO `gamedata_items_graphics_extra` VALUES ('4020001', '58', '1', '0');
INSERT INTO `gamedata_items_graphics_extra` VALUES ('4070001', '226', '1', '0');