Exemple #1
0
        public override void GiveRewards()
        {
            base.GiveRewards();

            MasteryInfo.LearnMastery(Owner, SkillName.Discordance, 3);

            SkillMasterySpell.SetActiveMastery(Owner, SkillName.Discordance);
        }
Exemple #2
0
        public override void GiveRewards()
        {
            base.GiveRewards();

            MasteryInfo.LearnMastery(Owner, SkillName.Peacemaking, 3);

            SkillMasterySpell.SetActiveMastery(Owner, SkillName.Peacemaking);
        }
Exemple #3
0
        public override void GiveRewards()
        {
            base.GiveRewards();

            MasteryInfo.LearnMastery(Owner, SkillName.Provocation, 3);

            SkillMasterySpell.SetActiveMastery(Owner, SkillName.Provocation);
        }
Exemple #4
0
        public static int GetMasteryFocusLevel(Mobile from)
        {
            if (from.Skills.CurrentMastery == SkillName.Spellweaving)
            {
                return(Math.Max(1, MasteryInfo.GetMasteryLevel(from, SkillName.Spellweaving)));
            }

            return(0);
        }
Exemple #5
0
        public static SkillMasteryPrimer GetPrimer(SkillName name, Volume volume = Volume.One)
        {
            MasteryInfo info = MasteryInfo.Infos.FirstOrDefault(i => i.MasterySkill == name && i.Volume == volume);

            if (info == null)
            {
                return(null);
            }

            return(new SkillMasteryPrimer(info.SpellID, name));
        }
Exemple #6
0
        public override void AddProperty(ObjectPropertyList list)
        {
            base.AddProperty(list);

            if (RootParent is Mobile)
            {
                SkillName sk = ((Mobile)RootParent).Skills.CurrentMastery;

                if (sk > 0)
                {
                    list.Add(MasteryInfo.GetLocalization(sk));
                }
            }
        }
Exemple #7
0
        public override void AddProperty(ObjectPropertyList list)
        {
            base.AddProperty(list);

            if (RootParent is Mobile)
            {
                SkillName sk = ((Mobile)RootParent).Skills.CurrentMastery;

                if (sk > 0)
                {
                    list.Add(MasteryInfo.GetLocalization(sk));

                    if (sk == SkillName.Spellweaving)
                    {
                        list.Add(1060485, ArcanistSpell.GetMasteryFocusLevel((Mobile)RootParent).ToString()); // strength bonus ~1_val~
                    }
                }
            }
        }
Exemple #8
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
                Volume = reader.ReadInt();
                Skill  = (SkillName)reader.ReadInt();
                break;

            case 0:

                Skill = (SkillName)reader.ReadInt();
                int id = reader.ReadInt();

                Volume = MasteryInfo.GetVolume(id, Skill);
                break;
            }
        }
Exemple #9
0
        public ChooseMasteryGump(PlayerMobile user, TimeForLegendsQuest quest)
            : base(50, 50)
        {
            Quest = quest;
            User  = user;

            AddImage(0, 0, 8000);
            AddImage(20, 37, 8001);
            AddImage(20, 107, 8002);
            AddImage(20, 177, 8001);
            AddImage(20, 247, 8002);
            AddImage(20, 317, 8001);
            AddImage(20, 387, 8002);
            AddImage(20, 457, 8003);

            AddHtmlLocalized(125, 40, 345, 16, 1156340, false, false); // Choose Your Path

            int y = 60;

            foreach (SkillName skName in MasteryInfo.Skills)
            {
                Skill sk = User.Skills[skName];

                if (sk == null || skName == SkillName.Discordance || skName == SkillName.Provocation || skName == SkillName.Peacemaking)
                {
                    continue;
                }

                if (sk.IsMastery && sk.VolumeLearned == 0)
                {
                    AddButton(30, y, 4005, 4007, (int)skName + 1, GumpButtonType.Reply, 0);

                    AddHtmlLocalized(75, y, 200, 16, MasteryInfo.GetLocalization(skName), 0x000F, false, false);

                    y += 20;
                }
            }
        }
Exemple #10
0
    public Champion(int a_ID, string a_Key, string a_Name, string a_Title, double a_Price, bool a_Owned, int a_Kills, int a_Deaths, int a_Wins, int a_Losses, int a_CreepScore, MasteryInfo a_MasteryInfo, ViabilityInfo a_Viability)
    {
        ID = a_ID;
        Name = a_Name;
        Key = a_Key;
        Title = a_Title;
        Price = a_Price;
        Owned = a_Owned;
        Mastery = a_MasteryInfo;
        Viability = a_Viability;

        Kills = a_Kills;
        Deaths = a_Deaths;
        CreepScore = a_CreepScore;

        Wins = a_Wins;
        Losses = a_Losses;

        if (Champions.ContainsKey(a_ID) == false)
        {
            Champions.Add(a_ID, this);
        }
    }
Exemple #11
0
        public static SkillMasteryPrimer GetRandom(Volume volume = Volume.Three, Volume exclude = Volume.One)
        {
            List <MasteryInfo> available = new List <MasteryInfo>();

            foreach (MasteryInfo info in MasteryInfo.Infos.Where(i => i.Volume <= volume && i.Volume != exclude && i.SpellID > 705))
            {
                available.Add(info);
            }

            if (available.Count == 0)
            {
                return(null);
            }

            MasteryInfo random = available[Utility.Random(available.Count)];

            SkillMasteryPrimer primer = new SkillMasteryPrimer(random.SpellID, random.MasterySkill);

            available.Clear();
            available.TrimExcess();

            return(primer);
        }
Exemple #12
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info.ButtonID == 0)
            {
                return;
            }

            SkillName n       = (SkillName)info.ButtonID - 1;
            SkillName current = User.Skills.CurrentMastery;

            if (User.Skills[n].Value >= MasteryInfo.MinSkillRequirement)
            {
                User.SendLocalizedMessage(1155886, User.Skills[n].Info.Name); // Your active skill mastery is now set to ~1_MasterySkill~!
                User.Skills.CurrentMastery = n;

                MasteryInfo.OnMasteryChanged(User, current);

                BookOfMasteries.AddToCooldown(User);
            }
            else
            {
                User.SendLocalizedMessage(1156236, String.Format("{0}\t{1}", MasteryInfo.MinSkillRequirement.ToString(), User.Skills[n].Info.Name)); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that mastery.
            }
        }
Exemple #13
0
        public override void AddGumpLayout()
        {
            AddBackground(0, 0, 404, 550, 9380);

            AddHtmlLocalized(0, 40, 404, 16, CenterLoc, "#1151948", 0, false, false); // Switch Mastery

            int       y       = 58;
            SkillName current = User.Skills.CurrentMastery;

            foreach (SkillName skName in MasteryInfo.Skills)
            {
                Skill sk = User.Skills[skName];

                if (sk != null && sk.IsMastery && sk.VolumeLearned > 0)
                {
                    AddButton(30, y, 4005, 4007, (int)skName + 1, GumpButtonType.Reply, 0);

                    AddHtmlLocalized(72, y, 200, 16, MasteryInfo.GetLocalization(skName), skName == current ? C32216(Red) : C32216(Blue), false, false);
                    AddHtmlLocalized(265, y, 100, 16, 1156052, MasteryInfo.GetMasteryLevel(User, skName).ToString(), 0, false, false);

                    y += 24;
                }
            }
        }
Exemple #14
0
    public static bool Setup(JSONArray a_Champions)
    {
        if (m_Setup)
            return true;

        if (a_Champions == null)
            return false;

        TextAsset ChampionData = Resources.Load<TextAsset>("Data/Champions");
        JSONArray JSONChampD = JSON.Parse(ChampionData.text).AsArray;
        Dictionary<string, ViabilityInfo> ViabilityInfos = new Dictionary<string, ViabilityInfo>();
        foreach (JSONNode JSONChamp in JSONChampD)
        {
            //voeg champion toe aan dictionary
            if (!ViabilityInfos.ContainsKey(JSONChamp["key"]))
            {
                ViabilityInfos.Add(JSONChamp["key"], new ViabilityInfo());
            }

            //if jungle, etc. show winrate
            ViabilityInfo Viability = ViabilityInfos[JSONChamp["key"]];
            string role = JSONChamp["role"].Value;

            if (role == "Top")
            {
                Viability.Top = JSONChamp["general"]["winPercent"].AsDouble / 100.0;
            }

            else if (role == "Jungle")
            {
                Viability.Jungle = JSONChamp["general"]["winPercent"].AsDouble / 100.0;
            }

            else if (role == "Middle")
            {
                Viability.Mid = JSONChamp["general"]["winPercent"].AsDouble / 100.0;
            }

            else if (role == "ADC")
            {
                Viability.Marksman = JSONChamp["general"]["winPercent"].AsDouble / 100.0;
            }

            else if (role == "Support")
            {
                Viability.Support = JSONChamp["general"]["winPercent"].AsDouble / 100.0;
            }

            Viability.Meta += JSONChamp["general"]["playPercent"].AsDouble / 100.0;

            ViabilityInfos[JSONChamp["key"]] = Viability;
        }
         
        foreach(JSONNode a_Champion in a_Champions)
        {
            var t_Time = (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddMilliseconds(a_Champion["mastery"]["lastPlayTime"].AsInt);

            MasteryInfo t_Mastery;
            if (a_Champion["mastery"].Count > 0)
            {
                t_Mastery = new MasteryInfo
                (
                    a_Champion["mastery"]["championLevel"].AsInt,
                    a_Champion["mastery"]["championPoints"].AsInt,
                    t_Time
                );
            }
            else t_Mastery = MasteryInfo.NoMastery;

            //Debug.Log("You are level " + t_Mastery.Level + " with " + a_Champion["name"] + ".");

            Champion t_Champion = new Champion
            (
                a_Champion["id"].AsInt, // ID
                a_Champion["key"].Value, // Key name
                a_Champion["name"].Value, // Name
                a_Champion["title"].Value, // Title
                a_Champion["price"].AsDouble, // Price
                a_Champion["owned"].AsBool, // Owned
                a_Champion["personal"]["kills"].AsInt, // int a_Kills, 
                a_Champion["personal"]["deaths"].AsInt, // int a_Deaths, 
                a_Champion["personal"]["wins"].AsInt, // int a_Wins, 
                a_Champion["personal"]["losses"].AsInt, // int a_Losses, 
                a_Champion["personal"]["creep_score"].AsInt, // int a_CreepScore,
                t_Mastery,
                ViabilityInfos[a_Champion["key"]]
            );

            // Get image
            JSONNode t_ImageInfo = a_Champion["image"];
            Rect t_Rect = new Rect();

            t_Rect.x = t_ImageInfo["x"].AsFloat;
            t_Rect.y = t_ImageInfo["y"].AsFloat;
            t_Rect.width = t_ImageInfo["w"].AsFloat;
            t_Rect.height = t_ImageInfo["h"].AsFloat;

            // Check if we've loaded it before
            if (m_Textures.ContainsKey(t_ImageInfo["sprite"]) == false)
            {
                string ImageURL = Settings.ChampionImageDirectory + t_ImageInfo["sprite"];
                HTTP.Request(ImageURL, delegate (WWW a_Request)
                {
                    if (m_Textures.ContainsKey(t_ImageInfo["sprite"]) == false)
                        m_Textures.Add(t_ImageInfo["sprite"], a_Request.texture);

                    t_Rect.y = a_Request.texture.height - t_Rect.y - t_Rect.height;
                    t_Champion.Image = Sprite.Create(a_Request.texture, t_Rect, Vector2.zero);
                }, false);
            }
            else
            {
                Texture2D t_Texture = m_Textures[t_ImageInfo["sprite"]];

                t_Rect.y = t_Texture.height - t_Rect.y - t_Rect.height;
                t_Champion.Image = Sprite.Create(t_Texture, t_Rect, Vector2.zero);
            }

            if (Champions.ContainsKey(t_Champion.ID) == false)
                Champions.Add(t_Champion.ID, t_Champion);

            if (Translation.ContainsKey(t_Champion.Name) == false)
                Translation.Add(t_Champion.Name, t_Champion.ID);
        }

        //Debug.Log(Champions.Values.Count + " champions added.");
        m_Setup = true;
        return true;
    }
Exemple #15
0
 private static int GetStrength(Mobile m)
 {
     return(Math.Max(1, MasteryInfo.GetMasteryLevel(m, SkillName.Spellweaving)));
 }
Exemple #16
0
 private static int GetStrength(Mobile m)
 {
     return(m.Skills.CurrentMastery == SkillName.Spellweaving ? MasteryInfo.GetMasteryLevel(m, SkillName.Spellweaving) : 1);
 }
Exemple #17
0
 public override void AddNameProperty(ObjectPropertyList list)
 {
     list.Add(1155882, $"#{MasteryInfo.GetLocalization(Skill)}"); // Primer on ~1_Skill~
 }
Exemple #18
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            list.Add(1155883, String.Format("{0}", GetVolume(MasteryInfo.GetVolume(SpellID, Skill)))); // Volume ~1_Level~
        }
Exemple #19
0
 public override void AddNameProperty(ObjectPropertyList list)
 {
     list.Add(1155882, String.Format("#{0}", MasteryInfo.GetLocalization(SpellID, Skill))); // Primer on ~1_Skill~
 }