public LokaiSkillTarget(LokaiSkillName lokaiSkill, double value)
     : base(-1, false, TargetFlags.None)
 {
     m_Set        = true;
     m_LokaiSkill = lokaiSkill;
     m_Value      = value;
 }
Exemplo n.º 2
0
 public LokaiSkillMod(LokaiSkillName skill, bool relative, bool obey, double value, Mobile mob)
 {
     m_Skill    = skill;
     m_Relative = relative;
     m_ObeyCap  = obey;
     m_Value    = value;
     m_From     = mob;
 }
Exemplo n.º 3
0
            public int Compare(object x, object y)
            {
                LokaiSkillName a = (LokaiSkillName)x;
                LokaiSkillName b = (LokaiSkillName)y;

                string aName = LokaiSkillInfo.Table[(int)a].Name;
                string bName = LokaiSkillInfo.Table[(int)b].Name;

                return(aName.CompareTo(bName));
            }
Exemplo n.º 4
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_ObeyCap  = reader.ReadBool();
                m_Relative = reader.ReadBool();
                m_Skill    = (LokaiSkillName)reader.ReadInt();
                m_Value    = reader.ReadDouble();
                goto case 0;
            }

            case 0: break;
            }
        }
Exemplo n.º 5
0
 public LokaiSkill this[LokaiSkillName name]
 {
     get { return(this[(int)name]); }
 }
Exemplo n.º 6
0
 public SuccessRating LastCheck(LokaiSkillName name)
 {
     return(m_LastCheck[(int)name]);
 }
Exemplo n.º 7
0
 private bool CheckWeaken(Mobile mob, LokaiSkillName lokaiSkill, int curHits, int maxHits)
 {
     return(GetWeakenChance(mob, lokaiSkill, curHits, maxHits) > Utility.Random(100));
 }
        public void AddLokaiSkill(int index, LokaiSkillName lokaiSkillToMake, double minLokaiSkill, double maxLokaiSkill)
        {
            BuildItem buildItem = m_BuildItems.GetAt(index);

            buildItem.AddLokaiSkill(lokaiSkillToMake, minLokaiSkill, maxLokaiSkill);
        }
 public int AddBuild(Type typeItem, TextDefinition group, TextDefinition name, LokaiSkillName lokaiSkillToMake, double minLokaiSkill, double maxLokaiSkill, Type typeRes, TextDefinition nameRes, int amount)
 {
     return(AddBuild(typeItem, group, name, lokaiSkillToMake, minLokaiSkill, maxLokaiSkill, typeRes, nameRes, amount, "", null));
 }
Exemplo n.º 10
0
        public int AddBuild(Type typeItem, TextDefinition group, TextDefinition name, LokaiSkillName lokaiSkillToMake, double minLokaiSkill, double maxLokaiSkill, Type typeRes, TextDefinition nameRes, int amount, TextDefinition message, object arg)
        {
            BuildItem buildItem = new BuildItem(typeItem, group, name, arg);

            buildItem.AddRes(typeRes, nameRes, amount, message);
            buildItem.AddLokaiSkill(lokaiSkillToMake, minLokaiSkill, maxLokaiSkill);

            DoGroup(group, buildItem);
            return(m_BuildItems.Add(buildItem));
        }
Exemplo n.º 11
0
 public BuildLokaiSkill(LokaiSkillName lokaiSkillToMake, double minLokaiSkill, double maxLokaiSkill)
 {
     m_LokaiSkillToMake = lokaiSkillToMake;
     m_MinLokaiSkill    = minLokaiSkill;
     m_MaxLokaiSkill    = maxLokaiSkill;
 }
Exemplo n.º 12
0
 public LokaiSkillNameValue(LokaiSkillName name, int val)
 {
     Name  = name;
     Value = val;
 }
Exemplo n.º 13
0
 private bool CheckRepairDifficulty(Mobile mob, LokaiSkillName lokaiSkill, int curHits, int maxHits)
 {
     return(false);
 }
Exemplo n.º 14
0
 public static bool UseLokaiSkill(Mobile from, LokaiSkillName name)
 {
     return(UseLokaiSkill(from, (int)name));
 }
Exemplo n.º 15
0
        public ResourceGump(Mobile from, TreeHarvestTool tool)
            : base(0, 0)
        {
            m_From = from;
            m_Tool = tool;
            LokaiSkills    skills     = LokaiSkillUtilities.XMLGetSkills(from);
            LokaiSkillName skil       = LokaiSkillName.TreePicking;
            string         lokaiSkill = "Current Tree";

            switch (m_Tool.ResourceType)
            {
            case TreeResourceType.BarkSkin: lokaiSkill += " Carving Skill: "; skil = LokaiSkillName.TreeCarving; break;

            case TreeResourceType.FruitNut: lokaiSkill += " Picking Skill: "; skil = LokaiSkillName.TreePicking; break;

            case TreeResourceType.LeafSpine: lokaiSkill += " Picking Skill: "; skil = LokaiSkillName.TreePicking; break;

            case TreeResourceType.RootBranch: lokaiSkill += " Digging Skill: "; skil = LokaiSkillName.TreeDigging; break;

            case TreeResourceType.SapJuice: lokaiSkill += " Sapping Skill: "; skil = LokaiSkillName.TreeSapping; break;
            }
            lokaiSkill += skills[skil].Value.ToString("F1");

            m_From.CloseGump(typeof(ResourceGump));

            Closable  = true;
            Dragable  = true;
            Resizable = false;
            int bark  = m_Tool.ResourceType == TreeResourceType.BarkSkin ? 2361 : 2360;
            int fruit = m_Tool.ResourceType == TreeResourceType.FruitNut ? 2361 : 2360;
            int leaf  = m_Tool.ResourceType == TreeResourceType.LeafSpine ? 2361 : 2360;
            int root  = m_Tool.ResourceType == TreeResourceType.RootBranch ? 2361 : 2360;
            int sap   = m_Tool.ResourceType == TreeResourceType.SapJuice ? 2361 : 2360;

            AddPage(0);
            AddBackground(40, 40, 404, 445, 9250);
            AddImage(40, 40, from.Female ? 13 : 12, 146);
            AddImage(40, 40, 50981);
            AddImage(40, 40, 60479);
            AddImage(40, 40, 60517);
            AddImage(40, 40, 50617);
            AddImage(40, -30, 50650);
            AddImage(-3, 178, 50497);
            AddImage(95, 81, 11374);
            AddImage(51, 52, 11374);
            AddImage(55, 99, 11374);
            AddImage(56, 135, 11374);
            AddImage(61, 233, 11374);
            AddLabel(57, 57, 1378, @"A");
            AddLabel(99, 84, 1378, @"B");
            AddLabel(60, 102, 1378, @"C");
            AddLabel(61, 137, 1378, @"D");
            AddLabel(66, 236, 1378, @"E");
            AddLabel(70, 300, 1378, @"A");
            AddLabel(70, 330, 1378, @"B");
            AddLabel(70, 360, 1378, @"C");
            AddLabel(70, 390, 1378, @"D");
            AddLabel(70, 420, 1378, @"E");
            AddLabel(170, 54, 0, @"Tree Harvest Tool");
            AddLabel(88, 300, 0, @"Fruit Picking Tool: for harvesting fruit and nuts");
            AddLabel(88, 330, 0, @"Leaf Picking Tool: for harvesting leaves and spines");
            AddLabel(88, 360, 0, @"Carving Tool: for harvesting bark and skin");
            AddLabel(88, 390, 0, @"Sapping Tool: for harvesting sap and juice");
            AddLabel(88, 420, 0, @"Digging Tool: for harvesting roots and buried branches");
            AddLabel(55, 274, 0, lokaiSkill);
            AddButton(55, 304, fruit, 2362, (int)Buttons.FruitNut, GumpButtonType.Reply, 0);
            AddButton(55, 394, sap, 2362, (int)Buttons.SapJuice, GumpButtonType.Reply, 0);
            AddButton(55, 364, bark, 2362, (int)Buttons.BarkSkin, GumpButtonType.Reply, 0);
            AddButton(55, 334, leaf, 2362, (int)Buttons.LeafSpine, GumpButtonType.Reply, 0);
            AddButton(55, 424, root, 2362, (int)Buttons.RootBranch, GumpButtonType.Reply, 0);
            AddItem(300, 65, 0x0C96);
            AddItem(167, 201, 0x194F);
            AddItem(207, 211, 0x0993);
            AddItem(220, 75, 0x0D94);
            AddItem(220, 75, 0x0D96);
            AddItem(270, 145, 0x0CDA);
            AddItem(270, 145, 0x0CDC);
            AddButton(133, 447, 9904, 9905, (int)Buttons.Investigate, GumpButtonType.Reply, 0);
            AddLabel(159, 448, 0, @"Investigate Tree");
        }
Exemplo n.º 16
0
        public void AddLokaiSkill(LokaiSkillName lokaiSkillToMake, double minLokaiSkill, double maxLokaiSkill)
        {
            BuildLokaiSkill buildLokaiSkill = new BuildLokaiSkill(lokaiSkillToMake, minLokaiSkill, maxLokaiSkill);

            m_arBuildLokaiSkill.Add(buildLokaiSkill);
        }
Exemplo n.º 17
0
 public LokaiSkillMod(LokaiSkillName skill, Mobile mob)
     : this(skill, true, false, 10.0, mob)
 {
 }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile m = state.Mobile;

            if (info.ButtonID > 299)
            {
                int change = info.ButtonID - 300;
                LokaiSkillUtilities.ChangeShowLokaiSkill(change);
                m.SendGump(new ShowLokaiSkillsGump(m, m_Value));
            }
            else if (info.ButtonID > 199)
            {
                LokaiSkillName showAb     = (LokaiSkillName)(info.ButtonID - 200);
                LokaiSkill     lokaiSkill = LokaiSkillUtilities.XMLGetSkills(m)[showAb];
                int            offset     = ((int)showAb * 17) - 9;
                switch (showAb)
                {
                case LokaiSkillName.Butchering: m.SendGump(new ShowButcheringGump(m, lokaiSkill, offset)); break;

                case LokaiSkillName.Skinning: m.SendGump(new ShowSkinningGump(m, lokaiSkill, offset)); break;

                case LokaiSkillName.DetectEvil: m.SendGump(new ShowDetectEvilGump(m, lokaiSkill, offset)); break;

                case LokaiSkillName.CureDisease: m.SendGump(new ShowCureDiseaseGump(m, lokaiSkill, offset)); break;

                case LokaiSkillName.PickPocket: m.SendGump(new ShowPickPocketGump(m, lokaiSkill, offset)); break;

                case LokaiSkillName.Pilfering: m.SendGump(new ShowPilferingGump(m, lokaiSkill, offset)); break;

                case LokaiSkillName.Ventriloquism: m.SendGump(new ShowVentriloquismGump(m, lokaiSkill, offset)); break;

                case LokaiSkillName.Hypnotism: m.SendGump(new ShowHypnotismGump(m, lokaiSkill, offset)); break;

                case LokaiSkillName.SpeakToAnimals: m.SendGump(new ShowSpeakToAnimalsGump(m, lokaiSkill, offset)); break;

                case LokaiSkillName.Brewing: m.SendGump(new ShowBrewingGump(m, lokaiSkill, offset)); break;

                case LokaiSkillName.Commerce: m.SendGump(new ShowCommerceGump(m, lokaiSkill, offset)); break;

                case LokaiSkillName.Herblore: m.SendGump(new ShowHerbloreGump(m, lokaiSkill, offset)); break;
                }
                m.SendGump(new ShowLokaiSkillsGump(m, m_Value));
            }
            else if (info.ButtonID > 99)
            {
                int useSkill = info.ButtonID - 100;
                if (m.Spell == null && !m.Meditating)
                {
                    if (LokaiSkillInfo.Table[useSkill].Callback != null)
                    {
                        if (m.NextSkillTime <= Core.TickCount || (LokaiSkillName)useSkill == LokaiSkillName.SpeakToAnimals)
                        {
                            m.NextSkillTime = Core.TickCount + (int)LokaiSkillInfo.Table[useSkill].Callback(m).TotalSeconds;
                        }
                        else
                        {
                            m.SendMessage("You must wait to use another skill.");
                        }
                    }
                    else
                    {
                        m.SendMessage("That skill is not yet active.");
                    }
                }
                else
                {
                    m.SendMessage("You are too busy to use that skill now.");
                }

                m.SendGump(new ShowLokaiSkillsGump(m, m_Value));
            }
            else if (info.ButtonID == 19)
            {
                m.SendGump(new ShowLokaiSkillsGump(m, false));
            }
            else if (info.ButtonID == 29)
            {
                m.SendGump(new ShowLokaiSkillsGump(m, true));
            }
        }
Exemplo n.º 19
0
 public LokaiSkillMod(LokaiSkillName skill)
     : this(skill, true, false, 10.0, null)
 {
 }
 public LokaiSkillTarget(LokaiSkillName lokaiSkill)
     : base(-1, false, TargetFlags.None)
 {
     m_Set        = false;
     m_LokaiSkill = lokaiSkill;
 }
Exemplo n.º 21
0
 private int GetWeakenChance(Mobile mob, LokaiSkillName lokaiSkill, int curHits, int maxHits)
 {
     // 40% - (1% per hp lost) - (1% per 10 build lokaiSkill)
     return((40 + (maxHits - curHits)) - (int)((LokaiSkillUtilities.XMLGetSkills(mob)[lokaiSkill].Value) / 10));
 }