Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // C1 07 跨服使用物品 #tagCMCrossUseItem |
| | | |
| | | public class CC107_tagCMCrossUseItem : GameNetPackBasic |
| | | { |
| | | public uint ItemID; //物品ID, 默认使用1个 |
| | | |
| | | public CC107_tagCMCrossUseItem() |
| | | { |
| | | combineCmd = (ushort)0x03FE; |
| | | _cmd = (ushort)0xC107; |
| | | } |
| | | |
| | | public override void WriteToBytes() |
| | | { |
| | | WriteBytes(ItemID, NetDataType.DWORD); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 84b954533e6f7c048922fb89c1f85665 |
| | | timeCreated: 1547517487 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public byte DayPKCount; // 当日已PK次数
|
| | | public byte DayWinCount; // 当日已胜利次数
|
| | | public byte DayBuyCount; // 当日已购买次数
|
| | | public byte DayItemAddCount; // 当日物品增加次数
|
| | |
|
| | | public HC101_tagMCCrossRealmPKPlayerInfo () {
|
| | | _cmd = (ushort)0xC101;
|
| | |
| | | TransBytes (out DayPKCount, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out DayWinCount, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out DayBuyCount, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out DayItemAddCount, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | {
|
| | | if (!TryGetValidPos(_clntPos, ref _adjustPos))
|
| | | {
|
| | | Debug.LogErrorFormat("服务端给定坐标: {0} 映射至客户端坐标: {1} 为客户端无法矫正的障碍点...当前地图: {2}",
|
| | | Debug.LogWarningFormat("服务端给定坐标: {0} 映射至客户端坐标: {1} 为客户端无法矫正的障碍点...当前地图: {2}",
|
| | | new Vector2(sPosX, sPosY), new Vector2(_clntPos.x, _clntPos.z), PlayerDatas.Instance.baseData.MapID);
|
| | | return;
|
| | | }
|
| | |
| | | {
|
| | | SwitchHand(false);
|
| | | }
|
| | |
|
| | | // 替换当前衣服上的武器
|
| | | Transform _secondaryNode = m_ClothesModel.transform.GetChildTransformDeeply(GAStaticDefine.SecondaryBindBoneName[JobSetup.Job - 1]);
|
| | | m_SecondaryModel.transform.SetParent(_secondaryNode);
|
| | | m_SecondaryModel.transform.localPosition = Vector3.zero;
|
| | | m_SecondaryModel.transform.localRotation = Quaternion.identity;
|
| | |
|
| | | SecondaryID = itemID;
|
| | | OnPutonSecondary(SecondaryID, m_SecondaryModel);
|
| | | ShowSecondaryEffect();
|
| | | }
|
| | |
| | | OnPutonSecondary(SecondaryID, m_HandModel);
|
| | | }
|
| | |
|
| | | SecondaryID = itemID;
|
| | | RequestShadow();
|
| | | }
|
| | |
|
| | |
| | | if (onOrOff)
|
| | | {
|
| | | EquipInfo _equipInfo;
|
| | | int _itemID = 4100;
|
| | | int _itemID = 7000;
|
| | |
|
| | | if (!m_EquipDict.TryGetValue((int)RoleEquipType.retFashionClothes, out _equipInfo))
|
| | | {
|
| | | if (!m_EquipDict.TryGetValue((int)RoleEquipType.retClothes, out _equipInfo))
|
| | | {
|
| | | _itemID = 4100;
|
| | | _itemID = 7000;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | _itemID = (int)_equipInfo.itemID;
|
| | | }
|
| | |
|
| | | var _itemConfig = Config.Instance.Get<ItemConfig>(_itemID);
|
| | | int _resID = ModelResConfig.GetHandByClothesID(_itemConfig.ChangeOrd);
|
| | | int _resID = 7000;
|
| | | if (_itemID != 7000)
|
| | | {
|
| | | var _itemConfig = Config.Instance.Get<ItemConfig>(_itemID);
|
| | | _resID = ModelResConfig.GetHandByClothesID(_itemConfig.ChangeOrd);
|
| | | }
|
| | |
|
| | | if (m_HandModel)
|
| | | {
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | m_HandModel = null;
|
| | | HandResID = 0;
|
| | | }
|
| | | }
|
| | |
| | | PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | | PackModelInterface modelInterface { get { return ModelCenter.Instance.GetModel<PackModelInterface>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | CrossServerOneVsOneModel crossOneVsOneModel { get { return ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>(); } }
|
| | |
|
| | | public PreciousItem currentShowItem { get; private set; }
|
| | | public event Action showItemRefreshEvent;
|
| | |
| | | {
|
| | | isGetNewItem = false;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= RefreshRealm;
|
| | | CrossServerOneVsOnePlayerInfo.Instance.UpdateMatchNumEvent -= UpdateCrossOneVsOneMatchNum;
|
| | | }
|
| | |
|
| | | public void OnSwitchAccount()
|
| | |
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += RefreshRealm;
|
| | | CrossServerOneVsOnePlayerInfo.Instance.UpdateMatchNumEvent += UpdateCrossOneVsOneMatchNum;
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateCrossOneVsOneMatchNum()
|
| | | {
|
| | | if (!TryRemindMatchTick()) return;
|
| | | |
| | | var itemModels = playerPack.GetItemModelsById(PackType.rptItem,1506);
|
| | | if(itemModels != null && itemModels.Count > 0)
|
| | | {
|
| | | var itemModel = itemModels[0];
|
| | | OnGetPreciousItem(PackType.rptItem,itemModel.itemInfo.ItemGUID);
|
| | | }
|
| | | }
|
| | |
|
| | | private bool TryRemindMatchTick()
|
| | | {
|
| | | if (NewBieCenter.Instance.inGuiding || !CrossServerOneVsOnePKSeason.Instance.isSatisfyMatch) return false;
|
| | | int remainNum = CrossServerOneVsOnePlayerInfo.Instance.GetDayRemainNum();
|
| | | if (remainNum > 0) return false;
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | | private void RefreshRealm(PlayerDataRefresh type)
|
| | | {
|
| | | int realmLv = PlayerDatas.Instance.baseData.realmLevel;
|
| | |
| | |
|
| | | private void ClickBuyTimes()
|
| | | {
|
| | | if(!CrossServerOneVsOnePKSeason.Instance.isSatisfyMatch)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("CrossMatching21");
|
| | | return;
|
| | | }
|
| | |
|
| | | int remainNum = CrossServerOneVsOnePlayerInfo.Instance.GetDayRemainNum();
|
| | | if (remainNum >= crossServerModel.freeMaxMatchNum)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("CrossMatching13");
|
| | | return;
|
| | | }
|
| | | if (!crossServerModel.TryGetBuyMatchTimes("CrossMatching21")) return;
|
| | |
|
| | | WindowCenter.Instance.Open<CrossSeverOneVsOneBuyMatchTimesWin>();
|
| | | }
|
| | |
| | | return false;
|
| | |
|
| | | }
|
| | |
|
| | | public bool TryGetBuyMatchTimes(string key)
|
| | | {
|
| | | if (!CrossServerOneVsOnePKSeason.Instance.isSatisfyMatch)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip(key);
|
| | | return false;
|
| | | }
|
| | |
|
| | | int remainNum = CrossServerOneVsOnePlayerInfo.Instance.GetDayRemainNum();
|
| | | if (remainNum >= freeMaxMatchNum)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("CrossMatching13");
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region 历史记录
|
| | |
| | |
|
| | | public int DayBuyCount { get; private set; } // 当日已购买次数
|
| | |
|
| | | public int DayItemAddCount { get; private set; } // 当日物品增加次数
|
| | |
|
| | | private int preDayPkCount;
|
| | | CrossServerOneVsOneModel crossServerModel { get { return ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>(); } }
|
| | | public event Action UpdatePlayerInfoEvent;
|
| | | public event Action UpdateMatchNumEvent;
|
| | |
|
| | | public void InitData()
|
| | | {
|
| | | preDayPkCount = 0;
|
| | | Score = 0;
|
| | | DanLV = 0;
|
| | | PKCount = 0;
|
| | |
| | | this.PKCount = playerInfo.PKCount;
|
| | | this.WinCount = playerInfo.WinCount;
|
| | | this.CWinCount = playerInfo.CWinCount;
|
| | | this.DayPKCount = playerInfo.DayPKCount;
|
| | | this.DayBuyCount = playerInfo.DayBuyCount;
|
| | | this.DayWinCount = playerInfo.DayWinCount;
|
| | | this.DayItemAddCount = playerInfo.DayItemAddCount;
|
| | | this.DayPKCount = playerInfo.DayPKCount;
|
| | |
|
| | | if (this.preDayPkCount != playerInfo.DayPKCount)
|
| | | {
|
| | | this.preDayPkCount = playerInfo.DayPKCount;
|
| | | if (UpdateMatchNumEvent != null)
|
| | | {
|
| | | UpdateMatchNumEvent();
|
| | | }
|
| | | }
|
| | | |
| | | if (UpdatePlayerInfoEvent != null)
|
| | | {
|
| | | UpdatePlayerInfoEvent();
|
| | |
| | |
|
| | | public int GetDayRemainNum()
|
| | | {
|
| | | int remainNum = DayBuyCount + crossServerModel.freeMaxMatchNum - DayPKCount;
|
| | | int remainNum = DayBuyCount + DayItemAddCount + crossServerModel.freeMaxMatchNum - DayPKCount;
|
| | | return remainNum > 0 ? remainNum : 0;
|
| | | }
|
| | |
|
| | |
| | | return isReach;
|
| | | }
|
| | | break;
|
| | | case 127:
|
| | | int remainNum = CrossServerOneVsOnePlayerInfo.Instance.GetDayRemainNum();
|
| | | if (!CrossServerOneVsOnePKSeason.Instance.isSatisfyMatch
|
| | | || remainNum > 0)
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | }
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | |
| | | fashionModel.jumpFashionDress = useItemModel.chinItemModel.EffectValueA1;
|
| | | break;
|
| | | }
|
| | | if (useItemModel.itemId == 951)
|
| | | {
|
| | | int startLockIndex = singlePack.openGridCount - playerPack.InitBagGridCnt;
|
| | | int chooseGridCnt = singlePack.openGridCount + GetExtendGridCnt(startLockIndex);
|
| | | modelInterface.OpenGrid(chooseGridCnt, PackType.rptItem);
|
| | | return;
|
| | | }
|
| | |
|
| | | if(playerPack.CheckIsDrugById(useItemModel.itemInfo.ItemID))
|
| | | switch(useItemModel.chinItemModel.ID)
|
| | | {
|
| | | case 951:
|
| | | int startLockIndex = singlePack.openGridCount - playerPack.InitBagGridCnt;
|
| | | int chooseGridCnt = singlePack.openGridCount + GetExtendGridCnt(startLockIndex);
|
| | | modelInterface.OpenGrid(chooseGridCnt, PackType.rptItem);
|
| | | return;
|
| | | case 1506:
|
| | | var crossOneVsOneModel = ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>();
|
| | | if (!crossOneVsOneModel.TryGetBuyMatchTimes("CrossMatching26"))
|
| | | {
|
| | | return;
|
| | | }
|
| | | break;
|
| | | }
|
| | | if (playerPack.CheckIsDrugById(useItemModel.itemInfo.ItemID))
|
| | | {
|
| | | if(CheckItemUselimit(useItemModel.chinItemModel))
|
| | | {
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if(itemModel.chinItemModel.Type == 59)
|
| | | {
|
| | | playerPack.SetWashAttrPointModel(itemModel.itemInfo.ItemGUID);
|
| | |
| | | return itemModel;
|
| | | }
|
| | |
|
| | | public List<ItemModel> GetItemModelsById(PackType type, int id)
|
| | | {
|
| | | List<ItemModel> itemModels= null;
|
| | | if (playerPackDict.ContainsKey(type))
|
| | | {
|
| | | var singlePack = playerPackDict[type];
|
| | | singlePack.GetItemCountByID(id,out itemModels);
|
| | | }
|
| | | return itemModels;
|
| | | }
|
| | |
|
| | | public string GetItemGUIDByID(int itemId)
|
| | | {
|
| | | string guid = string.Empty;
|
| | |
| | | {
|
| | | m_RealmLV.SetSprite("NoRealm");
|
| | | }
|
| | | m_RealmLV.SetNativeSize();
|
| | |
|
| | | }
|
| | |
|
| | |
| | | sendInfo.NPCID = (uint)NPcID;
|
| | | sendInfo.PosX = (ushort)Posx;
|
| | | sendInfo.PosY = (ushort)PosY;
|
| | | GameNetSystem.Instance.SendToCrossServer(sendInfo);
|
| | | GameNetSystem.Instance.SendInfo(sendInfo);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | |
|
| | | public void ShowSitDownPlayer(RawImage _rawImage, int _job)
|
| | | {
|
| | | ShowPlayer(_rawImage, _job);
|
| | | var clothes = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retClothes);
|
| | | var flashClothes = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retFashionClothes);
|
| | | var clothesId = clothes == null ? 0 : (int)clothes.itemInfo.ItemID;
|
| | | var flashClothesId = flashClothes == null ? 0 : flashClothes.itemInfo.ItemID;
|
| | |
|
| | | var weapon = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retWeapon);
|
| | | var flashWeapon = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retFashionWeapon);
|
| | | var weaponId = weapon == null ? 0 : (int)weapon.itemInfo.ItemID;
|
| | | var flashWeaponId = flashWeapon == null ? 0 : flashWeapon.itemInfo.ItemID;
|
| | |
|
| | | var wings = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retWing);
|
| | | var wingsId = wings == null ? 0 : (int)wings.itemInfo.ItemID;
|
| | |
|
| | | var flahsSecondary = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retFashionWeapon2);
|
| | | var secondary = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retWeapon2);
|
| | | var secondaryId = secondary == null ? 0 : (int)secondary.itemInfo.ItemID;
|
| | | var flashSecondaryId = flahsSecondary == null ? 0 : flahsSecondary.itemInfo.ItemID;
|
| | |
|
| | | int suitLevel = 0;
|
| | | if (clothes != null)
|
| | | {
|
| | | if (clothes.itemInfo.IsSuite == 1)
|
| | | {
|
| | | if (clothes.GetUseDataModel(30) != null && clothes.GetUseDataModel(30)[0] != 0)
|
| | | {
|
| | | suitLevel = clothes.GetUseDataModel(30)[0];
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | Dictionary<int, int> dict = null;
|
| | | EquipShowSwitch.IsGodWeaponEffectOn(PlayerDatas.Instance.baseData.equipShowSwitch, out dict);
|
| | | if (dict != null && dict.ContainsKey(2))
|
| | | {
|
| | | dict.Remove(2);
|
| | | }
|
| | | var data = new UI3DPlayerExhibitionData
|
| | | {
|
| | | job = _job,
|
| | | fashionClothesId = flashClothesId,
|
| | | fashionWeaponId = flashWeaponId,
|
| | | fashionSecondaryId = flashSecondaryId,
|
| | | clothesId = clothesId,
|
| | | suitLevel = suitLevel,
|
| | | weaponId = weaponId,
|
| | | wingsId = wingsId,
|
| | | secondaryId = secondaryId,
|
| | | isDialogue = false,
|
| | | godWeapons = dict
|
| | | };
|
| | | ShowOtherPlayer(_rawImage, data);
|
| | | if (playerModel != null)
|
| | | {
|
| | | playerModel.SitDown();
|