Exemple #1
0
 public PolymorphSpell(Mobile caster, Item scroll, PolymorphEntry polymorphEntry)  : base(caster, scroll, m_Info)
 {
     m_PolymorphEntry = polymorphEntry;
     m_NewBody = polymorphEntry.BodyID;
 }
Exemple #2
0
            public InternalTimer(Mobile owner, PolymorphEntry polymorphEntry)
                : base(TimeSpan.Zero)
            {
                m_Owner = owner;
                m_PolymorphEntry = polymorphEntry;

                double val = (owner.Skills[SkillName.Magery].Value) * 0.15;

                if (val > 120)
                    val = 120;

                Delay = TimeSpan.FromMinutes(val);
                Priority = TimerPriority.OneSecond;

                string modName = m_Owner.Serial + "Polymorph";

                PlayerMobile pm = ((PlayerMobile) m_Owner);

                foreach (Custom.Polymorph.StatMod sm in PolymorphEntry.EntryInfo[m_PolymorphEntry.ArtID].StatMods)
                {
                    switch (sm.Type)
                    {
                        case StatModType.Strength:
                            m_Owner.AddStatMod(new StatMod(StatType.Str, modName + "Str", sm.Value, TimeSpan.Zero));
                            break;
                        case StatModType.Dexterity:
                            m_Owner.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", sm.Value, TimeSpan.Zero));
                            break;
                        case StatModType.Intelligence:
                            m_Owner.AddStatMod(new StatMod(StatType.Int, modName + "Int", sm.Value, TimeSpan.Zero));
                            break;
                        case StatModType.Armor:
                            m_Owner.VirtualArmorMod = sm.Value;
                            break;
                        case StatModType.MinDamage:
                            if (pm != null)
                                pm.MinDamage = sm.Value;
                            break;
                        case StatModType.MaxDamage:
                            if (pm != null)
                                pm.MaxDamage = sm.Value;
                            break;
                        case StatModType.SwingSpeed:
                            if (pm != null)
                                pm.SwingSpeed = sm.Value;
                            break;
                        default:
                            break;
                    }
                }
            }