Exemplo n.º 1
0
        private void OnPlayerShowChanged(GameEvent ge, EventParameter parameter)
        {
            MsgData_sPlayerShowChanged data = parameter.msgParameter as MsgData_sPlayerShowChanged;

            //玩家自身数据层的更新
            if (data.RoleID == PlayerData.Instance.RoleID)
            {
                PlayerData.Instance.OnShowChanged(data.Type, data.Value);
            }

            //角色更新
            ActorObj obj = CoreEntry.gActorMgr.GetActorByServerID(data.RoleID);
            if (obj != null)
            {
                BaseAttr attr = obj.mBaseAttr;
                switch ((EModelChange)data.Type)
                {
                    case EModelChange.MODEL_CHANGE_WING:
                        attr.Wing = data.Value;
                        obj.ChangeWing(SceneLoader.GetWingModelID(attr.FashionState == 0 ? attr.FashionWing : 0, attr.Wing, attr.Prof));
                        break;
                    case EModelChange.MODEL_CHANGE_WEAPON:
                        attr.Weapon = data.Value;
                        obj.ChangeWeapon(SceneLoader.GetWeaponModelID(attr.FashionState == 0 ? attr.FashionWeapon : 0, attr.ShenBing, attr.Weapon, attr.Prof));
                        break;
                    case EModelChange.MODEL_CHANGE_DRESS:
                        attr.Dress = data.Value;
                        obj.ChangeClothes(SceneLoader.GetClothesModelID(attr.FashionState == 0 ? attr.FashionDress : 0, attr.Dress, attr.Prof,attr.EquipStarMin));
                        break;
                    case EModelChange.MODEL_CHANGE_EQUIPSTAR:
                        attr.EquipStarMin = data.Value;
                        obj.ChangeClothes(SceneLoader.GetClothesModelID(attr.FashionState == 0 ? attr.FashionDress : 0, attr.Dress, attr.Prof,attr.EquipStarMin));
                        break;
                    case EModelChange.MODEL_CHANGE_FASHION_WING:
                        attr.FashionWing = data.Value;
                        obj.ChangeWing(SceneLoader.GetWingModelID(attr.FashionState == 0 ? attr.FashionWing : 0, attr.Wing, attr.Prof));
                        break;
                    case EModelChange.MODEL_CHANGE_ZHENFA:
                        attr.ZhenFa = data.Value;
                        obj.ChangeZhenFa(data.Value);
                        break;
                    case EModelChange.MODEL_CHANGE_FACTION:
                        attr.Faction = data.Value;
                        obj.ChangeFaction(data.Value);
                        break;
                    case EModelChange.MODEL_CHANGE_FASHION_DRESS:
                        attr.FashionDress = data.Value;
                        obj.ChangeClothes(SceneLoader.GetClothesModelID(attr.FashionState == 0 ? attr.FashionDress : 0, attr.Dress, attr.Prof,attr.EquipStarMin));
                        break;
                    case EModelChange.MODEL_CHANGE_FASHION_WEAPON:
                        attr.FashionWeapon = data.Value;
                        obj.ChangeWeapon(SceneLoader.GetWeaponModelID(attr.FashionState == 0 ? attr.FashionWeapon : 0, attr.ShenBing, attr.Weapon, attr.Prof));
                        break;
                    case EModelChange.MODEL_CHANGE_SHENBING:
                        attr.ShenBing = data.Value;
                        obj.ChangeWeapon(SceneLoader.GetWeaponModelID(attr.FashionWeapon, attr.ShenBing, attr.Weapon, attr.Prof));
                        break;
                    case EModelChange.MODEL_CHANGE_RIDE:
                        obj.FuckHorse(data.Value);
                        break;
                    case EModelChange.MODEL_CHANGE_MAGICKEY:
                        obj.ShowMagicKey(data.Value);
                        break;
                    case EModelChange.MODEL_CHANGE_MAGICKEY_STAR: // 法宝星级
                        obj.ShowMagicKeyByStar(data.Value);
                        break;
                    case EModelChange.MODEL_CHANGE_PK_STATUS:
                        obj.ChangePKStatus(data.Value);
                        break;
                    case EModelChange.MODEL_CHANGE_GUANZHI:
                        attr.Lord = data.Value;                     
                        obj.Health.OnCreateHPBar();
                        break;
                    case EModelChange.MODEL_CHANGE_FASHION:
                        attr.FashionState = data.Value;
                        obj.ChangeWing(SceneLoader.GetWingModelID(attr.FashionState == 0 ? attr.FashionWing : 0, attr.Wing, attr.Prof));
                        obj.ChangeClothes(SceneLoader.GetClothesModelID(attr.FashionState == 0 ? attr.FashionDress : 0, attr.Dress, attr.Prof,attr.EquipStarMin));
                        obj.ChangeWeapon(SceneLoader.GetWeaponModelID(attr.FashionState == 0 ? attr.FashionWeapon : 0, attr.ShenBing, attr.Weapon, attr.Prof));
                        break;
                    case EModelChange.MODEL_CHANGE_EQUIP_TITLE:
                        obj.ChangeHeroTitle(data.Value);
                        break;
                    case EModelChange.MODEL_CHANGE_UNEQUIP_TITLE:
                        obj.ChangeHeroTitle(0);
                        break;
                    default:
                        break;
                }
            }
        }