Beispiel #1
0
        public static float GetPlayerBurnRateMultiplier(Player player, Skill spellskill)
        {
            MUSettings.Init();

            var creatureSkill = player.GetCreatureSkill(Skill.SpellEfficiency, false);

            if (creatureSkill == null)
            {
                return(1.0f);
            }
            if (creatureSkill.AdvancementClass < SkillAdvancementClass.Trained)
            {
                return(1.0f);
            }

            float maximumreduction = 0f;

            if (creatureSkill.AdvancementClass == SkillAdvancementClass.Trained)
            {
                maximumreduction = S_MAXIMUMREDUCTIONTRAINED;
            }
            else if (creatureSkill.AdvancementClass == SkillAdvancementClass.Specialized)
            {
                maximumreduction = S_MAXIMUMREDUCTIONSPEC;
            }

            float sk = (float)creatureSkill.Current / S_MAXIMUMSKILL;

            if (sk > 1.0f)
            {
                sk = 1.0f;
            }
            if (sk < 0.0f)
            {
                sk = 0.0f;
            }
            float reduction = maximumreduction * sk;

            string reductionmsgamount = ((int)Math.Round(100f * reduction)).ToString();

            player.Session.Network.EnqueueSend(new GameMessageSystemChat("Your Spell Efficiency skill reduced component burn by " + reductionmsgamount + "%.", ChatMessageType.Spellcasting));

            return(1f - reduction);
        }
Beispiel #2
0
        public static float GetPlayerSpellWindupSpeedMultiplier(Player player, Spell spell, bool showmessage = true)
        {
            MUSettings.Init();

            var creatureSkill = player.GetCreatureSkill(Skill.ManaConversion, false);

            if (creatureSkill == null)
            {
                return(1.0f);
            }
            if (creatureSkill.AdvancementClass != SkillAdvancementClass.Specialized)
            {
                return(1.0f);
            }

            //Is the spell eligible?
            if (spell.IsHarmful)
            {
                return(1.0f);
            }


            float sk = (float)creatureSkill.Current / S_MAXIMUMSKILL;

            if (sk > 1.0f)
            {
                sk = 1.0f;
            }
            if (sk < 0.0f)
            {
                sk = 0.0f;
            }
            float reduction = S_MAXIMUMREDUCTION * sk;

            if (showmessage)
            {
                string reductionmsgamount = ((int)Math.Round(100f * reduction)).ToString();
                player.Session.Network.EnqueueSend(new GameMessageSystemChat("Your specialized Mana Conversion skill reduced casting time by " + reductionmsgamount + "%.", ChatMessageType.Spellcasting));
            }

            return(1f + reduction);
        }