public ShieldStaticData() { m_AC = 0; m_breakChance = 0f; m_requiredSkillID = 0; m_requiredSkillTier = ETier.NONE; }
public InitTrainingDialogArgs(String caption, ETier skillRank, SkillStaticData skillData, String skillName) { Caption = caption; SkillRank = skillRank; SkillData = skillData; SkillName = skillName; }
private void RevertTierIncreaseEffects(Skill p_skill, ETier p_tier) { List <SkillEffectStaticData> list; switch (p_tier) { case ETier.EXPERT: list = p_skill.Tier2Effects; break; case ETier.MASTER: list = p_skill.Tier3Effects; break; case ETier.GRAND_MASTER: list = p_skill.Tier4Effects; break; default: list = p_skill.Tier1Effects; break; } foreach (SkillEffectStaticData skillEffectStaticData in list) { if (skillEffectStaticData.Type == ESkillEffectType.LEARN_SPELL) { m_character.SpellHandler.RemoveSpell((ECharacterSpell)skillEffectStaticData.Value); } } }
private void UpdateButton(SkillSelectButton p_btn, ESkillID p_skill) { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); CharacterClassStaticData staticData = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)selectedDummyCharacter.Class); ETier etier = ETier.NONE; for (Int32 i = 0; i < staticData.GrandMasterSkills.Length; i++) { if (staticData.GrandMasterSkills[i] == (Int32)p_skill) { etier = ETier.GRAND_MASTER; } } for (Int32 j = 0; j < staticData.MasterSkills.Length; j++) { if (staticData.MasterSkills[j] == (Int32)p_skill) { etier = ETier.MASTER; } } for (Int32 k = 0; k < staticData.ExpertSkills.Length; k++) { if (staticData.ExpertSkills[k] == (Int32)p_skill) { etier = ETier.EXPERT; } } SkillStaticData staticData2 = StaticDataHandler.GetStaticData <SkillStaticData>(EDataType.SKILL, (Int32)p_skill); p_btn.Init(staticData2, isDefaultSkill(staticData, staticData2), !isStartSkill(staticData, staticData2) && etier != ETier.NONE, selectedDummyCharacter.IsSkillPicked(staticData2.StaticID) || isStartSkill(staticData, staticData2), etier); }
public Boolean IsSkillRequirementFulfilled(Equipment p_equip, EEquipSlots p_slot) { Int32 requiredSkillID = GetRequiredSkillID(p_equip); ETier p_skillTier = GetRequiredSkillTier(p_equip); Int32 skillId = 0; MeleeWeapon meleeWeapon = p_equip as MeleeWeapon; if (meleeWeapon != null) { if (meleeWeapon.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND) { if (meleeWeapon.GetWeaponType() != EEquipmentType.SPEAR) { skillId = 8; } } else if (p_slot == EEquipSlots.OFF_HAND) { skillId = 10; } } MagicFocus magicFocus = p_equip as MagicFocus; if (magicFocus != null && p_slot == EEquipSlots.OFF_HAND) { p_skillTier = ETier.MASTER; } return((requiredSkillID == 0 || HasRequiredSkillTier(requiredSkillID, p_skillTier)) && (skillId == 0 || HasRequiredSkillTier(skillId, ETier.NOVICE))); }
private ETier GetMaxTier(DummyCharacter p_char, SkillStaticData p_skill) { CharacterClassStaticData staticData = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)p_char.Class); ETier result = ETier.NONE; for (Int32 i = 0; i < staticData.GrandMasterSkills.Length; i++) { if (staticData.GrandMasterSkills[i] == p_skill.StaticID) { result = ETier.GRAND_MASTER; } } for (Int32 j = 0; j < staticData.MasterSkills.Length; j++) { if (staticData.MasterSkills[j] == p_skill.StaticID) { result = ETier.MASTER; } } for (Int32 k = 0; k < staticData.ExpertSkills.Length; k++) { if (staticData.ExpertSkills[k] == p_skill.StaticID) { result = ETier.EXPERT; } } return(result); }
public Skill(Int32 p_skillStaticID, ETier p_maxTier) { m_tier1Effects = new List <SkillEffectStaticData>(); m_tier2Effects = new List <SkillEffectStaticData>(); m_tier3Effects = new List <SkillEffectStaticData>(); m_tier4Effects = new List <SkillEffectStaticData>(); m_currentlyAvailableEffects = new List <SkillEffectStaticData>(); m_availableScalingEffects = new List <SkillEffectStaticData>(); m_tier1ScalingEffects = new List <SkillEffectStaticData>(); m_requiredSkillLevelNovice = ConfigManager.Instance.Game.RequiredSkillLevelNovice; m_requiredSkillLevelExpert = ConfigManager.Instance.Game.RequiredSkillLevelExpert; m_requiredSkillLevelMaster = ConfigManager.Instance.Game.RequiredSkillLevelMaster; m_requiredSkillLevelGrandMaster = ConfigManager.Instance.Game.RequiredSkillLevelGrandMaster; m_maxTier = p_maxTier; m_staticData = StaticDataHandler.GetStaticData <SkillStaticData>(EDataType.SKILL, p_skillStaticID); if (m_maxTier >= ETier.NOVICE) { InitSkillEffectData(m_staticData.Tier1Effects, m_tier1Effects); } if (m_maxTier >= ETier.EXPERT) { InitSkillEffectData(m_staticData.Tier2Effects, m_tier2Effects); } if (m_maxTier >= ETier.MASTER) { InitSkillEffectData(m_staticData.Tier3Effects, m_tier3Effects); } if (m_maxTier >= ETier.GRAND_MASTER) { InitSkillEffectData(m_staticData.Tier4Effects, m_tier4Effects); } }
public MagicFocusStaticData() { m_addCritDamage = 0f; m_type = EEquipmentType.MAGIC_FOCUS_ONEHANDED; m_requiredSkillID = 0; m_requiredSkillTier = ETier.NONE; }
public void Init(SkillStaticData p_skill, Boolean p_isDefault, Boolean p_isEnabled, Boolean p_selected, ETier p_maxTier) { m_skill = p_skill; gameObject.SetActive(true); m_icon.spriteName = p_skill.Icon; ETier p_maxTier2 = (p_maxTier <= ETier.NOVICE) ? ETier.NOVICE : p_maxTier; m_skillForTT = new Skill(p_skill.StaticID, p_maxTier2); m_skillForTT.Level = ((!p_selected) ? 0 : 1); m_isDefault = p_isDefault; m_isEnabled = p_isEnabled; m_selected = p_selected; NGUITools.SetActiveSelf(m_selectionEffect, p_selected); if (p_maxTier == ETier.GRAND_MASTER) { m_tierIcon.spriteName = "ICO_skillrank_3"; NGUITools.SetActive(m_tierIcon.gameObject, true); NGUITools.SetActive(m_tierIconBG.gameObject, true); } else if (p_maxTier == ETier.MASTER) { m_tierIcon.spriteName = "ICO_skillrank_2"; NGUITools.SetActive(m_tierIcon.gameObject, true); NGUITools.SetActive(m_tierIconBG.gameObject, true); } else if (p_maxTier == ETier.EXPERT) { m_tierIcon.spriteName = "ICO_skillrank_1"; NGUITools.SetActive(m_tierIcon.gameObject, true); NGUITools.SetActive(m_tierIconBG.gameObject, true); } else { NGUITools.SetActive(m_tierIcon.gameObject, false); NGUITools.SetActive(m_tierIconBG.gameObject, false); } NGUITools.SetActive(m_corners.gameObject, m_isDefault); if (m_selected) { m_icon.color = m_normalColor; m_tierIconBG.color = m_highLightColor; m_corners.color = m_highLightColor; m_frame.color = m_highLightColor; } else if (!m_isEnabled) { m_icon.color = m_disabledColor; m_tierIconBG.color = m_normalColor; m_corners.color = m_normalColor; m_frame.color = m_disabledColor; } else { m_icon.color = m_normalColor; m_tierIconBG.color = m_normalColor; m_corners.color = m_normalColor; m_frame.color = m_normalColor; } }
public TrainingFunction(Int32 p_skillID, ETier p_tier, Character p_character, Int32 p_dialogID, Int32 p_price) { m_skillID = p_skillID; m_tier = p_tier; m_character = p_character; m_dialogID = p_dialogID; m_price = p_price; }
public ArmorStaticData() { m_AC = 0; m_subtype = EEquipmentType.CLOTHING; m_breakChance = 0f; m_requiredSkillID = 0; m_requiredSkillTier = ETier.NONE; }
private static void InitSkills(List <Skill> skillList, Int32[] p_skillIDs, ETier p_maxTier) { for (Int32 i = 0; i < p_skillIDs.Length; i++) { Skill item = new Skill(p_skillIDs[i], p_maxTier); skillList.Add(item); } }
public RangedWeaponStaticData() { m_minDamage = 0; m_maxDamage = 0; m_critDamageFactor = 0f; m_type = EEquipmentType.BOW; m_requiredSkillID = 0; m_requiredSkillTier = ETier.NONE; }
public MeleeWeaponStaticData() { m_minDamage = 0; m_maxDamage = 0; m_CritDamageFactor = 0f; m_type = EEquipmentType.DAGGER; m_requiredSkillID = 0; m_breakChance = 0f; m_requiredSkillTier = ETier.NONE; }
public static Scroll CreateScroll(Int32 p_modelLevel) { ETier etier = ETier.NOVICE; switch (p_modelLevel) { case 3: etier = ETier.EXPERT; break; case 4: etier = ETier.MASTER; break; case 5: etier = ETier.GRAND_MASTER; break; } List <ScrollStaticData> list = new List <ScrollStaticData>(StaticDataHandler.GetIterator <ScrollStaticData>(EDataType.SCROLL)); if (m_scrollTempFilter == null) { m_scrollTempFilter = new List <Int32>(); } m_scrollTempFilter.Clear(); ETier etier2 = (ETier)Random.Range(1, (Int32)(etier + 1)); Single num = 0f; for (Int32 i = 0; i < list.Count; i++) { ScrollStaticData scrollStaticData = list[i]; if (scrollStaticData.ScrollTier == etier && scrollStaticData.SpellTier == etier2 && scrollStaticData.StaticID < 1000) { m_scrollTempFilter.Add(i); num += m_currentEnchantmentMultiplicators[scrollStaticData.MagicSchool]; } } if (m_scrollTempFilter.Count > 0) { Single num2 = Random.Range(0f, num); Single num3 = 0f; for (Int32 j = 0; j < m_scrollTempFilter.Count; j++) { Int32 index = m_scrollTempFilter[j]; num3 += m_currentEnchantmentMultiplicators[list[index].MagicSchool]; if (num2 < num3) { return(CreateItem <Scroll>(list[index].StaticID)); } } } return(null); }
public void DecreaseSkillLevelSilent(Int32 p_skillStaticID) { Skill skill = FindSkill(p_skillStaticID); if (skill != null && skill.Level > 0) { ETier tier = skill.Tier; skill.Level--; if (skill.Tier != tier) { RevertTierIncreaseEffects(skill, tier); } } }
public void DecreaseSkillLevel(Int32 p_skillStaticID) { Skill skill = FindSkill(p_skillStaticID); if (skill != null && skill.Level > 0) { ETier tier = skill.Tier; skill.Level--; if (skill.Tier != tier) { RevertTierIncreaseEffects(skill, tier); } m_character.CalculateCurrentAttributes(); LegacyLogic.Instance.EventManager.InvokeEvent(skill, EEventType.CHARACTER_SKILL_CHANGED, EventArgs.Empty); } }
private static Equipment CreateRandomEquipment(ModelProbability[] p_modelLevels, Single p_prefixChance, Single p_suffixChance, EnchantmentProbability[] p_prefixProbabilities, EnchantmentProbability[] p_suffixProbabilities, EEquipmentType[] p_specificationList) { Equipment item = CreateRandomEquipmentInternal(p_modelLevels, p_prefixChance, p_suffixChance, p_prefixProbabilities, p_suffixProbabilities, p_specificationList); if (item == null) { return(null); } Int32 retriesNumber = ConfigManager.Instance.Game.GenerateCompatibleEquipmentRetriesNumber; if (retriesNumber < 1) { return(item); } Equipment firstItem = item; Character[] members = LegacyLogic.Instance.WorldManager.Party.Members; for (Int32 i = 0; i < retriesNumber; i++) { foreach (Character member in members) { Int32 requiredSkillID = CharacterSkillHandler.GetRequiredSkillID(item); if (requiredSkillID == 0) { return(item); } ETier requiredSkillTier = CharacterSkillHandler.GetRequiredSkillTier(item); Skill skill = member.SkillHandler.FindSkill(requiredSkillID); if (skill != null && skill.MaxTier >= requiredSkillTier) { return(item); } } item = CreateRandomEquipmentInternal(p_modelLevels, p_prefixChance, p_suffixChance, p_prefixProbabilities, p_suffixProbabilities, p_specificationList); if (item == null) { return(null); } } return(firstItem); }
private void OnNextTierButtonClick() { Int32 index = m_skillList.items.IndexOf(m_skillList.selection); foreach (Character character in m_charactersSelected) { Skill skill = character.SkillHandler.FindSkill(m_skillIDMapping[index]); if (skill != null && skill.Tier != skill.MaxTier) { ETier etier = skill.Tier + 1; character.SkillHandler.SetSkillTier(skill.StaticID, etier); AddSpells(character, skill.StaticID, etier); } } FillSkillList(); m_skillList.selection = m_skillList.items[index]; }
private void OnAllTierButtonClick() { foreach (Character character in m_charactersSelected) { List <Skill> availableSkills = character.SkillHandler.AvailableSkills; foreach (Skill skill in availableSkills) { while (skill.Tier < skill.MaxTier) { ETier etier = skill.Tier + 1; character.SkillHandler.SetSkillTier(skill.StaticID, etier); AddSpells(character, skill.StaticID, etier); } } } FillSkillList(); m_skillList.selection = m_skillList.items[0]; }
private void AddSpells(Character p_char, Int32 p_skillID, ETier p_tier) { if (p_skillID == 19 || p_skillID == 20 || p_skillID == 21 || p_skillID == 22 || p_skillID == 23 || p_skillID == 24 || p_skillID == 25) { ECharacterSpell[] values = EnumUtil <ECharacterSpell> .Values; for (Int32 i = 0; i < values.Length; i++) { if (values[i] > 0) { CharacterSpellStaticData staticData = StaticDataHandler.GetStaticData <CharacterSpellStaticData>(EDataType.CHARACTER_SPELLS, (Int32)values[i]); if (staticData != null && staticData.SkillID == (ESkillID)p_skillID && staticData.Tier <= p_tier) { p_char.SpellHandler.AddSpell(values[i]); } } } } }
public void SetSkillTier(Int32 p_skillStaticID, ETier p_skillTier) { Skill skill = FindSkill(p_skillStaticID); if (skill != null) { ETier tier = skill.Tier; skill.Tier = p_skillTier; CheckTierIncreaseEffects(skill); m_character.CalculateCurrentAttributes(); LegacyLogic.Instance.TrackingManager.TrackSkillTrained(skill, m_character); if (tier != p_skillTier) { LegacyLogic.Instance.EventManager.InvokeEvent(skill, EEventType.CHARACTER_SKILL_TIER_CHANGED, new SkillTierChangedEventArgs(skill, m_character)); } LegacyLogic.Instance.EventManager.InvokeEvent(skill, EEventType.CHARACTER_SKILL_CHANGED, EventArgs.Empty); } }
public void Init(SkillStaticData sd, DummyCharacter p_char) { if (sd != null) { ETier maxTier = GetMaxTier(p_char, sd); m_icon.spriteName = sd.Icon; NGUITools.SetActive(m_icon.gameObject, true); NGUITools.SetActive(m_border.gameObject, true); m_skillForTT = new Skill(sd.StaticID, maxTier); m_skillForTT.Level = 1; } else { NGUITools.SetActive(m_icon.gameObject, false); NGUITools.SetActive(m_border.gameObject, false); m_skillForTT = null; } }
public static String GetTierText(ETier p_tier) { switch (p_tier) { case ETier.NOVICE: return(LocaManager.GetText("SKILL_TIER_1")); case ETier.EXPERT: return(LocaManager.GetText("SKILL_TIER_2")); case ETier.MASTER: return(LocaManager.GetText("SKILL_TIER_3")); case ETier.GRAND_MASTER: return(LocaManager.GetText("SKILL_TIER_4")); default: return(String.Empty); } }
public Boolean HasRequiredSkillTier(Int32 p_skillStaticID, ETier p_skillTier) { Skill skill = FindSkill(p_skillStaticID); return(skill != null && skill.Tier >= p_skillTier); }
private Boolean IsSkillRequirementFulfilled(Int32 p_skillID, ETier p_tier) { Character selectedCharacter = LegacyLogic.Instance.WorldManager.Party.SelectedCharacter; return(selectedCharacter.SkillHandler.HasRequiredSkillTier(p_skillID, p_tier)); }
public SkillTierBonusEventArgs(ETier p_tier, Character p_chara, String p_skillName) { Tier = p_tier; Chara = p_chara; SkillName = p_skillName; }
public ScrollStaticData() { m_spellID = 0; m_scrollTier = ETier.NONE; }