public void SetLeaderAvatar(AvatarDetailData avatarDetailData) { this.leaderAvatar = new AvatarDataItem((int)avatarDetailData.get_avatar_id(), (int)avatarDetailData.get_avatar_level(), (int)avatarDetailData.get_avatar_star()); WeaponDetailData data = avatarDetailData.get_weapon(); if ((data != null) && (WeaponMetaDataReader.GetWeaponMetaDataByKey((int)data.get_id()) != null)) { WeaponDataItem item = new WeaponDataItem(0, WeaponMetaDataReader.GetWeaponMetaDataByKey((int)data.get_id())) { level = (int)data.get_level() }; this.leaderAvatar.equipsMap[1] = item; } EquipmentSlot[] slotArray = new EquipmentSlot[] { 2, 3, 4 }; List <StigmataDetailData> list = new List <StigmataDetailData> { avatarDetailData.get_stigmata_1(), avatarDetailData.get_stigmata_2(), avatarDetailData.get_stigmata_3() }; for (int i = 0; i < list.Count; i++) { StigmataDetailData data2 = list[i]; if ((data2 != null) && (StigmataMetaDataReader.GetStigmataMetaDataByKey((int)data2.get_id()) != null)) { StigmataDataItem item2 = new StigmataDataItem(0, StigmataMetaDataReader.GetStigmataMetaDataByKey((int)data2.get_id())) { level = (int)data2.get_level() }; int num2 = !data2.get_pre_affix_idSpecified() ? 0 : ((int)data2.get_pre_affix_id()); int num3 = !data2.get_suf_affix_idSpecified() ? 0 : ((int)data2.get_suf_affix_id()); item2.SetAffixSkill(true, num2, num3); this.leaderAvatar.equipsMap[slotArray[i]] = item2; } } foreach (AvatarSkillDetailData data3 in avatarDetailData.get_skill_list()) { if (this.leaderAvatar.GetAvatarSkillBySkillID((int)data3.get_skill_id()) != null) { AvatarSkillDataItem avatarSkillBySkillID = this.leaderAvatar.GetAvatarSkillBySkillID((int)data3.get_skill_id()); foreach (AvatarSubSkillDetailData data4 in data3.get_sub_skill_list()) { if (avatarSkillBySkillID.GetAvatarSubSkillBySubSkillId((int)data4.get_sub_skill_id()) != null) { avatarSkillBySkillID.GetAvatarSubSkillBySubSkillId((int)data4.get_sub_skill_id()).level = (int)data4.get_level(); } } } } }
private void SetupWeapon(WeaponDataItem weaponData) { base.transform.Find("Info/Title/Equipment").gameObject.SetActive(weaponData != null); base.transform.Find("Info/Content/Equipment").gameObject.SetActive(weaponData != null); if (weaponData != null) { base.transform.Find("Info/Title/Equipment/Name").GetComponent <Text>().text = weaponData.GetDisplayTitle(); string prefabPath = MiscData.Config.PrefabPath.WeaponBaseTypeIcon[weaponData.GetBaseType()]; base.transform.Find("Info/Title/Equipment/TypeIcon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(prefabPath); base.transform.Find("Info/Content/Equipment/3dModel").GetComponent <MonoWeaponRenderImage>().SetupView(weaponData, true, 0); base.transform.Find("Info/Content/Equipment/Cost/Num").GetComponent <Text>().text = weaponData.GetCost().ToString(); base.transform.Find("Info/Content/Equipment/Lv").GetComponent <Text>().text = "LV." + weaponData.level; base.transform.Find("Info/Content/Equipment/Star/EquipStar").GetComponent <MonoEquipSubStar>().SetupView(weaponData.rarity, weaponData.GetMaxRarity()); base.transform.Find("Info/Content/Equipment/Star/EquipSubStar").GetComponent <MonoEquipSubStar>().SetupView(weaponData.GetSubRarity(), weaponData.GetMaxSubRarity() - 1); } }
private void ReturnMaterial(StorageDataItemBase input) { WeaponDataItem item = input as WeaponDataItem; List <int> evoPath = WeaponMetaDataReaderExtend.GetEvoPath(item.ID); int num = 0; foreach (int num2 in evoPath) { int accumulateExp = 0; if (num2 == item.ID) { int expType = item.GetExpType(); int exp = item.exp; accumulateExp = EquipmentLevelMetaDataReaderExtend.GetAccumulateExp(item.level, expType) + exp; } else { WeaponMetaData weaponMetaDataByKey = WeaponMetaDataReader.GetWeaponMetaDataByKey(num2); int type = weaponMetaDataByKey.expType; accumulateExp = EquipmentLevelMetaDataReaderExtend.GetAccumulateExp(weaponMetaDataByKey.maxLv, type); } num += accumulateExp; } float num9 = Singleton <PlayerModule> .Instance.playerData.disjoin_equipment_back_exp_percent * 0.01f; int num11 = (int)(num * num9); int[] numArray = new int[] { 0xbbc, 0xbbb, 0xbba, 0xbb9 }; foreach (int num12 in numArray) { float gearExpProvideBase = ItemMetaDataReader.GetItemMetaDataByKey(num12).gearExpProvideBase; float num15 = MaterialExpBonusMetaDataReader.GetMaterialExpBonusMetaDataByKey(num12).weaponExpBonus * 0.01f; int num16 = (int)(gearExpProvideBase * num15); int num17 = num11 / num16; num11 = num11 % num16; if (num17 > 0) { this.AddItem(num12, num17); } } }
public void OnContentClick(BaseEventData data = null) { if (this._isRemoteAvatar) { WeaponDataItem weapon = this._userData.leaderAvatar.GetWeapon(); if (weapon != null) { Singleton <MainUIManager> .Instance.ShowPage(new StorageItemDetailPageContext(weapon, true, true), UIType.Page); } } else { WeaponDataItem storageItem = this._avatarData.GetWeapon(); if (storageItem == null) { this.OnChangeBtnClick(); } else { Singleton <MainUIManager> .Instance.ShowPage(new StorageItemDetailPageContext(storageItem, false, true), UIType.Page); } } }
private void DebugCreateStageWithFullDataSync_Impl(Packet_Level_CreateStageFullData fullData) { Singleton <LevelScoreManager> .Instance.SetDevLevelBeginIntent("Lua/Levels/Common/Level 0.lua", LevelActor.Mode.NetworkedMP, 10, 10, null); Singleton <LevelScoreManager> .Instance.memberList = new List <AvatarDataItem>(); for (int i = 0; i < fullData.AvatarsLength; i++) { MoleMole.MPProtocol.MPAvatarDataItem avatars = fullData.GetAvatars(i); AvatarDataItem item = new AvatarDataItem(avatars.AvatarID, avatars.Level, avatars.Star); ConfigAvatar avatarConfig = AvatarData.GetAvatarConfig(item.AvatarRegistryKey); WeaponDataItem dummyFirstWeaponDataByRole = Singleton <StorageModule> .Instance.GetDummyFirstWeaponDataByRole(avatarConfig.CommonArguments.RoleName, 1); item.equipsMap[1] = dummyFirstWeaponDataByRole; Singleton <LevelScoreManager> .Instance.memberList.Add(item); } Singleton <LevelManager> .Instance.levelActor.SuddenLevelStart(); Singleton <LevelManager> .Instance.levelActor.levelMode = LevelActor.Mode.NetworkedMP; Singleton <MPLevelManager> .Instance.mpMode = fullData.MpMode; if (fullData.MpMode == MPMode.Normal) { Singleton <LevelManager> .Instance.gameMode = new NetworkedMP_Default_GameMode(); } else if (fullData.MpMode == MPMode.PvP_ReceiveNoSend) { Singleton <LevelManager> .Instance.gameMode = new NetworkedMP_PvPTest_GameMode(); } else if (fullData.MpMode == MPMode.PvP_SendNoReceive) { Singleton <LevelManager> .Instance.gameMode = new NetworkedMP_PvPTest_GameMode(); } List <string> avatarSpawnNameList = new List <string> { "Born" }; Singleton <StageManager> .Instance.CreateStage(fullData.StageData.StageName, avatarSpawnNameList, null, false); }