private void HandleEquipAwakeItemCmd(CommandParser.Command param) { int num = 0; int.TryParse(param.GetParam(1), out num); int index = 0; int.TryParse(param.GetParam(2), out index); ulong itemID = 0uL; ulong.TryParse(param.GetParam(3), out itemID); PetDataEx pet = Globals.Instance.Player.TeamSystem.GetPet(num); if (pet == null) { global::Debug.LogErrorFormat("can't find the pet, slot = {0}", new object[] { num }); return; } MC2S_EquipAwakeItem mC2S_EquipAwakeItem = new MC2S_EquipAwakeItem(); mC2S_EquipAwakeItem.PetID = pet.Data.ID; mC2S_EquipAwakeItem.Index = index; mC2S_EquipAwakeItem.ItemID = itemID; Globals.Instance.CliSession.Send(417, mC2S_EquipAwakeItem); }
private void OnEquipBtnClick(GameObject go) { PetDataEx curPetDataEx = this.mBaseScene.CurPetDataEx; if (curPetDataEx != null && this.mItemInfo != null && !curPetDataEx.IsAwakeItemEquip(this.mIndex)) { int @int = GameConst.GetInt32(24); if ((ulong)curPetDataEx.Data.Level < (ulong)((long)@int)) { GameUIManager.mInstance.ShowMessageTip("petJueXing9", @int); return; } ItemDataEx itemByInfoID = Globals.Instance.Player.ItemSystem.GetItemByInfoID(this.mItemInfo.ID); if (itemByInfoID != null) { MC2S_EquipAwakeItem mC2S_EquipAwakeItem = new MC2S_EquipAwakeItem(); mC2S_EquipAwakeItem.PetID = ((curPetDataEx.GetSocketSlot() != 0) ? curPetDataEx.Data.ID : 100uL); mC2S_EquipAwakeItem.Index = this.mIndex; mC2S_EquipAwakeItem.ItemID = itemByInfoID.Data.ID; Globals.Instance.CliSession.Send(417, mC2S_EquipAwakeItem); } } }