884 lines
37 KiB
C#
884 lines
37 KiB
C#
|
//This code create by CodeEngine
|
|||
|
|
|||
|
using System;
|
|||
|
using Module.Log;
|
|||
|
using Google.ProtocolBuffers;
|
|||
|
using System.Collections;
|
|||
|
using Games.Item;
|
|||
|
using Games.GlobeDefine;
|
|||
|
using GCGame.Table;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
namespace SPacket.SocketInstance
|
|||
|
{
|
|||
|
public class GC_UPDATEITEMHandler : Ipacket
|
|||
|
{
|
|||
|
private int m_LastItemStackCount = 0;
|
|||
|
|
|||
|
public uint Execute(PacketDistributed ipacket)
|
|||
|
{
|
|||
|
GC_UPDATEITEM packet = (GC_UPDATEITEM)ipacket;
|
|||
|
if (null == packet) return (uint)PACKET_EXE.PACKET_EXE_ERROR;
|
|||
|
int packtype = packet.Packtype;
|
|||
|
GameItemContainer.Type containertype = (GameItemContainer.Type)packtype;
|
|||
|
//取得物品容器
|
|||
|
GameItemContainer Container = GameManager.gameManager.PlayerDataPool.GetItemContainer(containertype);
|
|||
|
if (Container == null)
|
|||
|
{
|
|||
|
return (uint)PACKET_EXE.PACKET_EXE_CONTINUE;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
//初始化标志,移动到最后
|
|||
|
}
|
|||
|
|
|||
|
List<int> itemsIndex = new List<int>();
|
|||
|
UInt64 RawGuidID = GlobeVar.INVALID_GUID;
|
|||
|
bool hasEquip = false;
|
|||
|
bool hasEquipItem = false;
|
|||
|
for (int num = 0;num < packet.packInfoCount;num++)
|
|||
|
{
|
|||
|
GCPackItemInfo packitemInfo = packet.packInfoList[num];
|
|||
|
if (packitemInfo == null)
|
|||
|
continue;
|
|||
|
GCItemInfo itemInfo = packitemInfo.ItemInfo;
|
|||
|
int packindex = packitemInfo.Packindex;
|
|||
|
|
|||
|
//取得物品
|
|||
|
GameItem item = Container.GetItem(packindex);
|
|||
|
bool isHas = item.IsValid();
|
|||
|
if (item != null)
|
|||
|
{
|
|||
|
int nRawId = item.DataID;
|
|||
|
|
|||
|
//物品分解的判断一下
|
|||
|
if(containertype == GameItemContainer.Type.TYPE_BACKPACK
|
|||
|
&& BackPackLogic.Instance()!=null
|
|||
|
&& nRawId!=-1
|
|||
|
&& (itemInfo.Dataid==-1 || nRawId!= itemInfo.Dataid))
|
|||
|
{
|
|||
|
BackPackLogic.Instance().DelAnalyGameItem(item);
|
|||
|
}
|
|||
|
|
|||
|
//ID
|
|||
|
item.DataID = itemInfo.Dataid;
|
|||
|
//Debug.LogError("DataId : " + item.DataID);
|
|||
|
//署名ID
|
|||
|
item.SignDataID = itemInfo.SignGuid;
|
|||
|
if(itemInfo.HasSignname)
|
|||
|
{
|
|||
|
item.SignName = itemInfo.Signname;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.SignName = "";
|
|||
|
}
|
|||
|
//GUID
|
|||
|
item.Guid = itemInfo.Guid;
|
|||
|
//绑定
|
|||
|
if (itemInfo.HasBindflag)
|
|||
|
{
|
|||
|
if (itemInfo.Bindflag == 1)
|
|||
|
{
|
|||
|
item.BindFlag = true;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.BindFlag = false;
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.BindFlag = false;
|
|||
|
}
|
|||
|
//叠加数量
|
|||
|
if (itemInfo.HasStackcount)
|
|||
|
{
|
|||
|
item.StackCount = itemInfo.Stackcount;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.StackCount = 1;
|
|||
|
}
|
|||
|
|
|||
|
//背包的戒指自动请求穿戴
|
|||
|
if (item.GetClass() == (int)ItemClass.PRIZE
|
|||
|
&&(item.GetSubClass() == (int)PrizeSubClass.SINGLERING
|
|||
|
|| item.GetSubClass() == (int)PrizeSubClass.MARRIEDRING
|
|||
|
|| item.GetSubClass() == (int)PrizeSubClass.DIVORCEDRING))
|
|||
|
{
|
|||
|
ReqEquipMarryRing req = new ReqEquipMarryRing();
|
|||
|
req.flag = 1;
|
|||
|
req.SendMsg();
|
|||
|
}
|
|||
|
|
|||
|
Tab_CommonItem commonItem = TableManager.GetCommonItemByID(item.DataID, 0);
|
|||
|
if (GlobalData.IsLoginProcessEnd) //登录完毕
|
|||
|
{
|
|||
|
if (commonItem != null)
|
|||
|
{
|
|||
|
if (AdvanceCanadvanceCtr.GetInstance() != null)
|
|||
|
{
|
|||
|
AdvanceCanadvanceCtr.GetInstance().JudgeShowCanAdvanceIcon();
|
|||
|
}
|
|||
|
if (commonItem.CanShortCutUse == 1
|
|||
|
&& containertype == GameItemContainer.Type.TYPE_BACKPACK //数量增加 而且是背包物品 的时候才会打开快捷使用界面
|
|||
|
&& GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Level >= commonItem.MinLevelRequire) //获得的时候需要快捷使用
|
|||
|
{
|
|||
|
//判断当前数量的变化
|
|||
|
if (GlobalData.m_ItemStackCounDic.ContainsKey(item.Guid))
|
|||
|
{
|
|||
|
m_LastItemStackCount = GlobalData.m_ItemStackCounDic[item.Guid];
|
|||
|
GlobalData.m_ItemStackCounDic[item.Guid] = item.StackCount;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
GlobalData.m_ItemStackCounDic.Add(item.Guid, item.StackCount);
|
|||
|
m_LastItemStackCount = 0;
|
|||
|
}
|
|||
|
if (item.StackCount > m_LastItemStackCount)
|
|||
|
{
|
|||
|
if (GameManager.gameManager.PlayerDataPool.ClientCustomDateManager.PlayerCustomData.autoMedicInfo.autoHpIdList.Contains(item.DataID)
|
|||
|
|| GameManager.gameManager.PlayerDataPool.ClientCustomDateManager.PlayerCustomData.autoMedicInfo.autoMpIdList.Contains(item.DataID))
|
|||
|
{
|
|||
|
GameManager.gameManager.PlayerDataPool.ClientCustomDateManager.SortAutoItemDataList();
|
|||
|
}
|
|||
|
|
|||
|
bool hasFind = false;
|
|||
|
for (int index = 0; index < GlobalData.MyShortCutItemGuidList.Count; index++)
|
|||
|
{
|
|||
|
if (GlobalData.MyShortCutItemGuidList[index] == item.Guid)
|
|||
|
{
|
|||
|
hasFind = true;
|
|||
|
}
|
|||
|
}
|
|||
|
if (!hasFind && item.DataID != -1 && item.StackCount > 0 && !GlobalData.MyShortCutItemGuidList.Contains(item.Guid))
|
|||
|
{
|
|||
|
GlobalData.MyShortCutItemGuidList.Add(item.Guid);
|
|||
|
}
|
|||
|
if(ShortCutItemControl.CanShow)
|
|||
|
{
|
|||
|
UIManager.ShowUI(UIInfo.ShortCutItem, delegate (bool bSucess, object param)
|
|||
|
{
|
|||
|
if (bSucess)
|
|||
|
{
|
|||
|
if (ShortCutItemControl.Instance)
|
|||
|
ShortCutItemControl.Instance.InitMyitem();
|
|||
|
}
|
|||
|
});
|
|||
|
}
|
|||
|
}else
|
|||
|
{
|
|||
|
if (GlobalData.MyShortCutItemGuidList.Contains(item.Guid))
|
|||
|
GlobalData.MyShortCutItemGuidList.Remove(item.Guid);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
//没有登录完毕 同步物品数量
|
|||
|
if (!GlobalData.IsLoginProcessEnd && containertype == GameItemContainer.Type.TYPE_BACKPACK)
|
|||
|
{
|
|||
|
if (commonItem != null
|
|||
|
&& GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Level >= commonItem.MinLevelRequire
|
|||
|
&& commonItem.ClassID == (int)ItemClass.PRIZE && item.StackCount != 0
|
|||
|
&& item.GetSubClass() != (int)PrizeSubClass.SPEAKER)
|
|||
|
{
|
|||
|
if (GlobalData.m_ItemStackCounDic.ContainsKey(item.Guid))
|
|||
|
{
|
|||
|
GlobalData.m_ItemStackCounDic[item.Guid] = itemInfo.Stackcount;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
GlobalData.m_ItemStackCounDic.Add(item.Guid, itemInfo.Stackcount);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//创建时间
|
|||
|
item.CreateTime = itemInfo.Createtime;
|
|||
|
|
|||
|
item.IsFrenzy = itemInfo.HasFrenzy;
|
|||
|
|
|||
|
//强化等级
|
|||
|
if (itemInfo.HasEnchancelevel)
|
|||
|
{
|
|||
|
item.EnchanceLevel = itemInfo.Enchancelevel;
|
|||
|
item.StrengthLevel = itemInfo.Enchancelevel;
|
|||
|
item.StrengPerfect.Clear();
|
|||
|
for (int i = 0; i < itemInfo.enchancelvladdpercentCount; ++i)
|
|||
|
{
|
|||
|
item.StrengPerfect.Add(itemInfo.GetEnchancelvladdpercent(i));
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.EnchanceLevel = 0;
|
|||
|
item.StrengthLevel = 0;
|
|||
|
item.StrengPerfect.Clear();
|
|||
|
}
|
|||
|
//强化经验
|
|||
|
if (itemInfo.HasEnchanceexp)
|
|||
|
{
|
|||
|
item.EnchanceExp = itemInfo.Enchanceexp;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.EnchanceExp = 0;
|
|||
|
}
|
|||
|
//强化总经验
|
|||
|
if (itemInfo.HasEnctotaltexp)
|
|||
|
{
|
|||
|
item.EnchanceTotalExp = itemInfo.Enctotaltexp;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.EnchanceTotalExp = 0;
|
|||
|
}
|
|||
|
//打星等级
|
|||
|
if (itemInfo.HasStarlevel)
|
|||
|
{
|
|||
|
item.StarLevel = itemInfo.Starlevel;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.StarLevel = 0;
|
|||
|
}
|
|||
|
//打星次数
|
|||
|
if (itemInfo.HasStartimes)
|
|||
|
{
|
|||
|
item.StarTimes = itemInfo.Startimes;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.StarTimes = 0;
|
|||
|
}
|
|||
|
//动态参数
|
|||
|
if (itemInfo.HasDynamicdata1)
|
|||
|
{
|
|||
|
item.DynamicData[0] = itemInfo.Dynamicdata1;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.DynamicData[0] = 0;
|
|||
|
}
|
|||
|
if (itemInfo.HasDynamicdata2)
|
|||
|
{
|
|||
|
item.DynamicData[1] = itemInfo.Dynamicdata2;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.DynamicData[1] = 0;
|
|||
|
}
|
|||
|
if (itemInfo.HasDynamicdata3)
|
|||
|
{
|
|||
|
item.DynamicData[2] = itemInfo.Dynamicdata3;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.DynamicData[2] = 0;
|
|||
|
}
|
|||
|
if (itemInfo.HasDynamicdata4)
|
|||
|
{
|
|||
|
item.DynamicData[3] = itemInfo.Dynamicdata4;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.DynamicData[3] = 0;
|
|||
|
}
|
|||
|
if (itemInfo.HasDynamicdata5)
|
|||
|
{
|
|||
|
item.DynamicData[4] = itemInfo.Dynamicdata5;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.DynamicData[4] = 0;
|
|||
|
}
|
|||
|
if (itemInfo.HasDynamicdata6)
|
|||
|
{
|
|||
|
item.DynamicData[5] = itemInfo.Dynamicdata6;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.DynamicData[5] = 0;
|
|||
|
}
|
|||
|
if (itemInfo.HasDynamicdata7)
|
|||
|
{
|
|||
|
item.DynamicData[6] = itemInfo.Dynamicdata7;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.DynamicData[6] = 0;
|
|||
|
}
|
|||
|
if (itemInfo.HasDynamicdata8)
|
|||
|
{
|
|||
|
item.DynamicData[7] = itemInfo.Dynamicdata8;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.DynamicData[7] = 0;
|
|||
|
}
|
|||
|
|
|||
|
// 当前使用次数(暂时只有特殊礼包三会用到)
|
|||
|
if (itemInfo.HasUsedcount == true)
|
|||
|
{
|
|||
|
item.UsedCount = itemInfo.Usedcount;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.UsedCount = 0;
|
|||
|
}
|
|||
|
|
|||
|
//有使用限制次数的物品
|
|||
|
if (itemInfo.HasAlreadyusedcount == true)
|
|||
|
{
|
|||
|
item.UsedLimitCount = itemInfo.Alreadyusedcount;
|
|||
|
}
|
|||
|
|
|||
|
if (item.IsEquipMent() || item.IsMagicMent())
|
|||
|
{
|
|||
|
//装备评分
|
|||
|
if (itemInfo.HasEnchancescore)
|
|||
|
{
|
|||
|
item.CombatValue = itemInfo.Enchancescore;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.CombatValue = 0;
|
|||
|
}
|
|||
|
|
|||
|
//装备完美值
|
|||
|
if (itemInfo.HasEnchanceperfectid)
|
|||
|
{
|
|||
|
item.StrengthPerfect = itemInfo.Enchanceperfectid;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.StrengthPerfect = 0;
|
|||
|
}
|
|||
|
item.StrengPerfect.Clear();
|
|||
|
for (int i = 0; i < itemInfo.enchancelvladdpercentCount; ++i)
|
|||
|
{
|
|||
|
item.StrengPerfect.Add(itemInfo.GetEnchancelvladdpercent(i));
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
//基础属性
|
|||
|
//item.BaseOriginAttrs.Clear();
|
|||
|
//for (int i = 0; i < packet.basicbaptizepropvalueCount; ++i)
|
|||
|
//{
|
|||
|
// item.BaseOriginAttrs.Add(item.GetBaseAttr(i, packet.GetBasicbaptizepropvalue(i)));
|
|||
|
//}
|
|||
|
|
|||
|
item.BaseAttrs.Clear();
|
|||
|
for (int i = 0; i < itemInfo.basicbaptizepropvalueCount; ++i)
|
|||
|
{
|
|||
|
item.BaseAttrs.Add(item.GetBaseAttr(i, itemInfo.GetBasicbaptizepropvalue(i), itemInfo.GetBasicpropaddvalue(i)));
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
//词条
|
|||
|
item.ExAttrs.Clear();
|
|||
|
if (itemInfo.propbarpropidCount > 0)
|
|||
|
{
|
|||
|
var equipAttrTab = TableManager.GetEquipBaptizeByID((int)item.GetQuality(), 0);
|
|||
|
for (int i = 0; i < itemInfo.propbarpropidCount; ++i)
|
|||
|
{
|
|||
|
var exProp = item.GetXilianAttr(itemInfo.GetPropbarpropid(i), itemInfo.GetPropbarpropsubid(i), itemInfo.GetPropbarpropvalue(i));
|
|||
|
if (exProp != null && equipAttrTab != null && i < equipAttrTab.PropBarFixedNumber)
|
|||
|
{
|
|||
|
exProp.IsFixedImg = true;
|
|||
|
}
|
|||
|
item.ExAttrs.Add(exProp);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//洗练词条
|
|||
|
item.ExAttrsNew.Clear();
|
|||
|
if (itemInfo.newpropbarpropidCount > 0)
|
|||
|
{
|
|||
|
var equipAttrTab = TableManager.GetEquipBaptizeByID((int)item.GetQuality(), 0);
|
|||
|
for (int i = 0; i < itemInfo.newpropbarpropidCount; ++i)
|
|||
|
{
|
|||
|
var exProp = item.GetXilianAttr(itemInfo.GetNewpropbarpropid(i), itemInfo.GetNewpropbarpropsubid(i), itemInfo.GetNewpropbarpropvalue(i));
|
|||
|
if (exProp != null && equipAttrTab != null && i < equipAttrTab.PropBarFixedNumber)
|
|||
|
{
|
|||
|
exProp.IsFixedImg = true;
|
|||
|
}
|
|||
|
item.ExAttrsNew.Add(exProp);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//洗练积分
|
|||
|
if (itemInfo.HasPropbarbaptizetimes)
|
|||
|
{
|
|||
|
item.XilianPoint = itemInfo.Propbarbaptizetimes;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.XilianPoint = 0;
|
|||
|
}
|
|||
|
|
|||
|
//置换次数
|
|||
|
if (itemInfo.HasPropbarreplacetimes)
|
|||
|
{
|
|||
|
item.ZhihuanTimes = itemInfo.Propbarreplacetimes;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.ZhihuanTimes = 0;
|
|||
|
}
|
|||
|
|
|||
|
//耐久
|
|||
|
if (itemInfo.HasDurable)
|
|||
|
{
|
|||
|
item.Durable = itemInfo.Durable;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.Durable = 0;
|
|||
|
}
|
|||
|
|
|||
|
//level
|
|||
|
if (itemInfo.HasEquipwearlevel)
|
|||
|
{
|
|||
|
item.EquipUseLevel = itemInfo.Equipwearlevel;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.EquipUseLevel = item.GetEquipLevel();
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
//珍品
|
|||
|
if (itemInfo.HasIstreasure)
|
|||
|
{
|
|||
|
item.IsRare = itemInfo.Istreasure > 0;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.IsRare = false;
|
|||
|
}
|
|||
|
|
|||
|
//失魂
|
|||
|
if (itemInfo.HasInvalidexpiretime)
|
|||
|
{
|
|||
|
item.ShihunTime = itemInfo.Invalidexpiretime;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.ShihunTime = 0;
|
|||
|
}
|
|||
|
|
|||
|
//宝石
|
|||
|
item.GemItems.Clear();
|
|||
|
int gemCnt = itemInfo.Holeamount;
|
|||
|
var playerLevel = ObjManager.Instance.MainPlayer.BaseAttr.Level;
|
|||
|
|
|||
|
int gemLimit = item.GetEquipGemSlotCnt();
|
|||
|
for (int i = 0; i < gemLimit; ++i)
|
|||
|
{
|
|||
|
var consumeTab = TableManager.GetEquipPunchConsumeByID(i);
|
|||
|
if (consumeTab.OpenLevel <= playerLevel)
|
|||
|
{
|
|||
|
item.GemItems.Add(new GemData() { IsOpen = true });
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item.GemItems.Add(new GemData() { IsOpen = false });
|
|||
|
}
|
|||
|
}
|
|||
|
for (int i = 0; i < itemInfo.gemidCount; ++i)
|
|||
|
{
|
|||
|
item.GemItems[i].DataID = itemInfo.GetGemid(i);
|
|||
|
item.GemItems[i].Level = itemInfo.GetGemlvl(i);
|
|||
|
}
|
|||
|
//item.UpdateGemSuit();
|
|||
|
|
|||
|
if (itemInfo.gemsuitindexidCount > 0)
|
|||
|
{
|
|||
|
item._GemSuit1 = itemInfo.gemsuitindexidList[0];
|
|||
|
|
|||
|
if (itemInfo.gemsuitindexidCount > 1)
|
|||
|
item._GemSuit2 = itemInfo.gemsuitindexidList[1];
|
|||
|
|
|||
|
if (itemInfo.gemsuitindexidCount > 2)
|
|||
|
item._GemSuit3 = itemInfo.gemsuitindexidList[2];
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
item._GemSuit1 = -1;
|
|||
|
item._GemSuit2 = -1;
|
|||
|
item._GemSuit3 = -1;
|
|||
|
}
|
|||
|
if (Singleton<ObjManager>.GetInstance() != null && Singleton<ObjManager>.GetInstance().MainPlayer != null)
|
|||
|
{
|
|||
|
if (item.Guid == Singleton<ObjManager>.GetInstance().MainPlayer.AutoEquipGuid)
|
|||
|
RawGuidID = item.Guid;
|
|||
|
}
|
|||
|
if (item.IsEquipMent())
|
|||
|
{
|
|||
|
item.UpdateGemSuit();
|
|||
|
hasEquip = true;
|
|||
|
}
|
|||
|
|
|||
|
if (!item.IsValid() || (commonItem != null && commonItem.ClassID == (int)ItemClass.STRENGTHEN))
|
|||
|
hasEquipItem = true;
|
|||
|
|
|||
|
if (item.DataID != -1)
|
|||
|
itemsIndex.Add(packindex);
|
|||
|
|
|||
|
//装备评分
|
|||
|
if (item.IsEquipMent())
|
|||
|
{
|
|||
|
item.EnchanceScore = CombatValue.CalculateEquipSingle(item);
|
|||
|
|
|||
|
item.BaseCombat = CombatValue.CalculateBaseAttr(item);
|
|||
|
item.BaseCombat += CombatValue.CalculateXilian(item.ExAttrs, item.DataID);
|
|||
|
//item.BaseCombat += CombatValue.CalculateGemOpen(item);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//法宝战力
|
|||
|
if (item.IsMagicMent())
|
|||
|
{
|
|||
|
item.EnchanceScore = CombatValue.CalculateMagicSingle(item);
|
|||
|
}
|
|||
|
|
|||
|
// 自动穿戴
|
|||
|
if (item.IsEquipMent() && containertype == GameItemContainer.Type.TYPE_BACKPACK)
|
|||
|
{
|
|||
|
// 仅当游戏背包初始化话后,才允许出现自动穿戴
|
|||
|
if(GameManager.gameManager.PlayerDataPool.HasInitBackPack && GameManager.gameManager.PlayerDataPool.HasInitEquipPack)
|
|||
|
{
|
|||
|
EquipAutoUseLogic.OnGetEquip(item);
|
|||
|
}
|
|||
|
}
|
|||
|
//境界相关信息更新
|
|||
|
if(Singleton<ObjManager>.Instance.MainPlayer != null)
|
|||
|
MeridiaSoulData.Instance.CheckIsHasUp();
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
//更新界面
|
|||
|
switch (containertype)
|
|||
|
{
|
|||
|
//物品背包
|
|||
|
case GameItemContainer.Type.TYPE_BACKPACK:
|
|||
|
{
|
|||
|
if(!isHas)
|
|||
|
{
|
|||
|
Hashtable tab = new Hashtable();
|
|||
|
tab["dataID"] = item.DataID;
|
|||
|
tab["type"] = Games.LogicObj.Obj_Fellow.FellowDialogType.GetGameItem;
|
|||
|
Games.Events.EventDispatcher.Instance.SendMessage(Games.Events.EventId.FellowDialogEvent, tab);
|
|||
|
}
|
|||
|
|
|||
|
if (AdvanceCanadvanceCtr.GetInstance() != null)
|
|||
|
{
|
|||
|
AdvanceCanadvanceCtr.GetInstance().JudgeShowCanAdvanceIcon();
|
|||
|
}
|
|||
|
|
|||
|
//自动选择药
|
|||
|
//if (Singleton<ObjManager>.GetInstance().MainPlayer)
|
|||
|
//{
|
|||
|
// Singleton<ObjManager>.GetInstance().MainPlayer.UpdateSelectDrug();
|
|||
|
// //自动出售
|
|||
|
// for(int n = 0;n<itemsIndex.Count;n++)
|
|||
|
// {
|
|||
|
// Singleton<ObjManager>.GetInstance().MainPlayer.UpdateSellItem(itemsIndex[n]);
|
|||
|
// }
|
|||
|
//}
|
|||
|
|
|||
|
// 仓库界面内的背包
|
|||
|
if (CangKuLogic.Instance() != null)
|
|||
|
{
|
|||
|
CangKuLogic.Instance().UpdateBackPack();
|
|||
|
}
|
|||
|
|
|||
|
//进阶装备(卸下之后类型变为0,要在这边刷新一下)
|
|||
|
if (AdvanceMountPanelCtr.Instance)
|
|||
|
{
|
|||
|
AdvanceMountPanelCtr.Instance.showPanel.equipPanel.InitEquipItem();
|
|||
|
}
|
|||
|
|
|||
|
//进阶界面
|
|||
|
if(AdvanceMountPanelCtr.Instance)
|
|||
|
{
|
|||
|
AdvanceMountPanelCtr.Instance.RefreshItemPanel();
|
|||
|
AdvanceMountPanelCtr.Instance.showPanel.skillPanel.RefreshSkillItemRedIconState();
|
|||
|
}
|
|||
|
|
|||
|
//主界面快捷使用
|
|||
|
if(SkillBarLogic.Instance())
|
|||
|
{
|
|||
|
SkillBarLogic.Instance().RefreshShortCutItem();
|
|||
|
}
|
|||
|
|
|||
|
//戒指升级消耗
|
|||
|
if(RingPanelCtr.Instance)
|
|||
|
{
|
|||
|
RingPanelCtr.Instance.RefreshConsumeRemain();
|
|||
|
}
|
|||
|
|
|||
|
//进阶技能消耗页面
|
|||
|
if(AdvanceSkillTips.Instance)
|
|||
|
{
|
|||
|
AdvanceSkillTips.Instance.RefreshOwnItemCount();
|
|||
|
}
|
|||
|
|
|||
|
if (FunctionExLogic.Instance())
|
|||
|
{
|
|||
|
FunctionExLogic.Instance().UpdateBackPackFull();
|
|||
|
}
|
|||
|
|
|||
|
if (SkillBarLogic.Instance() && itemInfo.Dataid == PlayerPreferenceData.ShortCutItemId)
|
|||
|
{
|
|||
|
SkillBarLogic.Instance().SetUseItem();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
if (itemInfo.Dataid == PlayerPreferenceData.ShortCutItemId)
|
|||
|
{
|
|||
|
GlobalData._IsRefreshShortcutItem = true;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//物品刷新Base
|
|||
|
if (CommonItem_Base.Instance)
|
|||
|
CommonItem_Base.Instance.RefreshItemRemainCount();
|
|||
|
if (ChildSkillLearnItemPanel.Instance)
|
|||
|
ChildSkillLearnItemPanel.Instance.RefreshItemCount();
|
|||
|
|
|||
|
//装备副本界面
|
|||
|
if (StroyCopySceneRootCtrl.GteInstance() && StroyCopySceneRootCtrl.GteInstance().isActiveAndEnabled)
|
|||
|
{
|
|||
|
StroyCopySceneRootCtrl.GteInstance().RefreshItemCount();
|
|||
|
}
|
|||
|
|
|||
|
SkillRootLogic.CanAnySkillLvUp();
|
|||
|
if(SkillRootLogic.Instance())
|
|||
|
SkillRootLogic.Instance().UpdateRedTips();
|
|||
|
}
|
|||
|
break;
|
|||
|
//装备槽位
|
|||
|
case GameItemContainer.Type.TYPE_EQUIPPACK:
|
|||
|
{
|
|||
|
if (BackPackLogic.Instance() != null)
|
|||
|
{
|
|||
|
BackPackLogic.Instance().UpdateEquipPack();
|
|||
|
}
|
|||
|
if (RoleViewLogic.Instance() != null)
|
|||
|
{
|
|||
|
//RoleViewLogic.Instance().UpdateEquipPack();
|
|||
|
}
|
|||
|
//自动强化装备选择
|
|||
|
if (Singleton<ObjManager>.GetInstance().MainPlayer
|
|||
|
&& VipData.GetVipLv() >= GlobeVar.USE_AUTOFIGHT_VIPLEVEL
|
|||
|
&& Singleton<ObjManager>.GetInstance().MainPlayer.BaseAttr.Level >= GlobeVar.MAX_AUTOEQUIT_LIVE)
|
|||
|
{
|
|||
|
if (RawGuidID != GlobeVar.INVALID_GUID)
|
|||
|
{
|
|||
|
GameItem item1 = Container.GetItemByGuid(RawGuidID);
|
|||
|
if (item1!=null && item1.IsValid())
|
|||
|
{
|
|||
|
Singleton<ObjManager>.GetInstance().MainPlayer.AutoEquipGuid = item1.Guid;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
Singleton<ObjManager>.GetInstance().MainPlayer.AutoEquipGuid = GlobeVar.INVALID_GUID;
|
|||
|
Singleton<ObjManager>.GetInstance().MainPlayer.UpdateSelectEquip();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
break;
|
|||
|
|
|||
|
case GameItemContainer.Type.TYPE_ADVANCEPACK:
|
|||
|
{
|
|||
|
if(AdvanceMountPanelCtr.Instance)
|
|||
|
{
|
|||
|
AdvanceMountPanelCtr.Instance.showPanel.equipPanel.InitEquipItem();
|
|||
|
}
|
|||
|
}
|
|||
|
break;
|
|||
|
|
|||
|
case GameItemContainer.Type.TYPE_BUYBACKPACK:
|
|||
|
{
|
|||
|
BackPackLogic backPack = BackPackLogic.Instance();
|
|||
|
if (backPack != null)
|
|||
|
{
|
|||
|
backPack.UpdateBuyBackPack();
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
break;
|
|||
|
|
|||
|
case GameItemContainer.Type.TYPE_STORAGEPACK:
|
|||
|
if(CangKuLogic.Instance() != null)
|
|||
|
{
|
|||
|
CangKuLogic.Instance().UpdateCangKu();
|
|||
|
CangKuLogic.Instance().UpdateBackPack();
|
|||
|
}
|
|||
|
break;
|
|||
|
};
|
|||
|
}
|
|||
|
|
|||
|
if (containertype == GameItemContainer.Type.TYPE_BACKPACK)
|
|||
|
{
|
|||
|
GameManager.gameManager.PlayerDataPool.HasInitBackPack = true;
|
|||
|
GameManager.gameManager.PlayerDataPool.FellowBookData.IsHaveCanUsePetItem();
|
|||
|
if (BackPackLogic.Instance() != null)
|
|||
|
{
|
|||
|
// 局部更新
|
|||
|
BackPackLogic.Instance().UpdateBackPackByIndex(-1);
|
|||
|
}
|
|||
|
}
|
|||
|
else if (containertype == GameItemContainer.Type.TYPE_EQUIPPACK)
|
|||
|
{
|
|||
|
GameManager.gameManager.PlayerDataPool.HasInitEquipPack = true;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
GameManager.gameManager.PlayerDataPool.CalculateEquipSuit();
|
|||
|
if (EquipEnhanceQianghua.Instance() != null)
|
|||
|
{
|
|||
|
EquipEnhanceQianghua.Instance().UpdateEquip();
|
|||
|
}
|
|||
|
if (EquipEnhanceXilian.Instance() != null)
|
|||
|
{
|
|||
|
EquipEnhanceXilian.Instance().UpdateEquip();
|
|||
|
}
|
|||
|
|
|||
|
if(EquipFrenzy.Instance != null)
|
|||
|
{
|
|||
|
EquipFrenzy.Instance.OnEquipUpdate();
|
|||
|
}
|
|||
|
if(BackPackLogic.Instance()!=null)
|
|||
|
{
|
|||
|
BackPackLogic.Instance().UpdateSuitLevel();
|
|||
|
BackPackLogic.Instance().UpdateEquipCombatTips();
|
|||
|
}
|
|||
|
if (ExtraFunTipRoot.Instance())
|
|||
|
{
|
|||
|
ExtraFunTipRoot.Instance().UpdateEquipFunTip();
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
if (EquipXilianRoot.Instance() != null)
|
|||
|
{
|
|||
|
EquipXilianRoot.Instance().UpdateEquip();
|
|||
|
}
|
|||
|
|
|||
|
if (EquipEnhanceXiangqian.Instance() != null)
|
|||
|
{
|
|||
|
EquipEnhanceXiangqian.Instance().UpdateEquip();
|
|||
|
}
|
|||
|
|
|||
|
EquipEnhanceRoot.CanAnyEquipXiangqian();
|
|||
|
|
|||
|
if (hasEquip)
|
|||
|
{
|
|||
|
|
|||
|
if (EquipQianghuaRoot.Instance() != null)
|
|||
|
{
|
|||
|
EquipQianghuaRoot.Instance().UpdateEquip();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
if (EquipGemLvUpRoot.Instance() != null)
|
|||
|
{
|
|||
|
EquipGemLvUpRoot.Instance().UpdateEquip();
|
|||
|
}
|
|||
|
|
|||
|
if (EquipEnhanceHecheng.Instance() != null)
|
|||
|
{
|
|||
|
bool isCanItemCombine = false;
|
|||
|
for (int num = 0; num < packet.packInfoCount; num++)
|
|||
|
{
|
|||
|
GCPackItemInfo packitemInfo = packet.packInfoList[num];
|
|||
|
if (packitemInfo == null)
|
|||
|
continue;
|
|||
|
GCItemInfo itemInfo = packitemInfo.ItemInfo;
|
|||
|
int packindex = packitemInfo.Packindex;
|
|||
|
|
|||
|
//取得物品
|
|||
|
GameItem item = Container.GetItem(packindex);
|
|||
|
|
|||
|
if (!item.IsValid())
|
|||
|
{
|
|||
|
isCanItemCombine = true;
|
|||
|
}
|
|||
|
else if (ItemCombine.CanItemCombine(item.DataID))
|
|||
|
{
|
|||
|
isCanItemCombine = true;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
if (isCanItemCombine)
|
|||
|
{
|
|||
|
EquipEnhanceHecheng.Instance().UpdateItem();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
if (MarketSystemLogic.Instance())
|
|||
|
{
|
|||
|
MarketSystemLogic.Instance().UpdateBackPackItems();
|
|||
|
}
|
|||
|
if (MarketPlayerShopSellPage.Instance())
|
|||
|
{
|
|||
|
MarketPlayerShopSellPage.Instance().UpdatePacketItem();
|
|||
|
}
|
|||
|
|
|||
|
if (LiveSkillLogic.Instance())
|
|||
|
{
|
|||
|
LiveSkillLogic.Instance().UpdateSelectedItem();
|
|||
|
}
|
|||
|
|
|||
|
if (SkillRootLogic.Instance())
|
|||
|
{
|
|||
|
SkillRootLogic.Instance().UpdateSkillCost();
|
|||
|
}
|
|||
|
|
|||
|
if (YuanBaoShopLogic.Instance())
|
|||
|
{
|
|||
|
YuanBaoShopLogic.Instance().UpdateLimitInfo();
|
|||
|
}
|
|||
|
|
|||
|
if (SysShopController.Instance())
|
|||
|
{
|
|||
|
SysShopController.Instance().UpdateLimitInfo();
|
|||
|
}
|
|||
|
|
|||
|
if (CommunityGiveFlowerLogic.Instance())
|
|||
|
{
|
|||
|
CommunityGiveFlowerLogic.Instance().InitGiveFlower();
|
|||
|
}
|
|||
|
|
|||
|
if (ExtraFunTipRoot.Instance())
|
|||
|
ExtraFunTipRoot.Instance().UpdateEquipEnhance();
|
|||
|
|
|||
|
EquipEnhanceRoot.HeChengRedTipsUpdate();
|
|||
|
EquipEnhanceRoot.UpdateFrenzyRedTips();
|
|||
|
|
|||
|
Games.Events.EventDispatcher.Instance.SendMessage(Games.Events.EventId.FRESHSAMEUSETIP, null);
|
|||
|
Games.Events.EventDispatcher.Instance.Dispatch(Games.Events.EventId.FRESHSAMEUSETIP, null);
|
|||
|
Games.Events.EventDispatcher.Instance.SendMessage(Games.Events.EventId.MagicItemUpdate, null);
|
|||
|
|
|||
|
// 页外Icon红点更新相关
|
|||
|
MagicMain.UpdateRedPoint();
|
|||
|
MarryRoot.UpdateRedTips();
|
|||
|
AdvanceBase.UpdateAllRedPoint();
|
|||
|
if (SceneItemUseTip.Instance() != null)
|
|||
|
SceneItemUseTip.Instance().ShowSceneItems();
|
|||
|
if (CangKuLogic.Instance() != null)
|
|||
|
{
|
|||
|
CangKuLogic.Instance().UpdateCangKu();
|
|||
|
}
|
|||
|
//enter your logic
|
|||
|
return (uint)PACKET_EXE.PACKET_EXE_CONTINUE;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|