sahisahi
Member
My poly gump has a polar bear, im trying to change it to a Bear with different hue and name, i created a ''new'' bear and added it to the poly gump,
not working so far, i still polymorph into polear bear it is due the BodyID?
PolymorphGump.cs:
The 'new' bear file wich is a clone of the polarbear xD
And Polymorph.cs spell just in case:
Sorry for being so annoying
not working so far, i still polymorph into polear bear it is due the BodyID?
PolymorphGump.cs:
Code:
using System.Collections.Generic;
using Server.Gumps;
using Server.Network;
using Server.Spells;
using Server.Spells.Seventh;
using Solaris.CliLocHandler;
namespace Server.Custom.Polymorph
{
public enum StatModType
{
None,
Strength,
Dexterity,
Intelligence,
Armor,
MinDamage,
MaxDamage,
SwingSpeed
}
public class StatMod
{
private readonly int m_Value;
private readonly StatModType m_Type;
public int Value { get { return m_Value; } }
public StatModType Type { get { return m_Type; } }
public StatMod(StatModType type, int value)
{
m_Type = type;
m_Value = value;
}
}
public class PolymorphEntry
{
//Syntax---> PolymorphEntry(MenuGraphic, BodyId, Cliloc#/String, StatMods, SkillRequired). Check the first example
public static readonly PolymorphEntry Chicken = new PolymorphEntry(8401, 0xD0, 1015236, new[] { new StatMod(StatModType.Strength, -0), new StatMod(StatModType.Dexterity, -0) }, 40.0);
public static readonly PolymorphEntry Dog = new PolymorphEntry(8405, 0xD9, 1015237, new[] { new StatMod(StatModType.Strength, -0), new StatMod(StatModType.Dexterity, -0) }, 40.0);
public static readonly PolymorphEntry Cat = new PolymorphEntry(8475, 0xC9, "Gato", new[] { new StatMod(StatModType.Strength, -0), new StatMod(StatModType.Dexterity, -0) }, 40.0);
public static readonly PolymorphEntry Wolf = new PolymorphEntry(8426, 0xE1, 1015238, new[] { new StatMod(StatModType.Armor, 0), new StatMod(StatModType.MinDamage, 5), new StatMod(StatModType.MaxDamage, 10), new StatMod(StatModType.SwingSpeed, 250) }, 40.0);
public static readonly PolymorphEntry Panther = new PolymorphEntry(8473, 0xD6, 1015239, new[] { new StatMod(StatModType.Dexterity, 0), new StatMod(StatModType.Armor, 0), new StatMod(StatModType.MinDamage, 0), new StatMod(StatModType.MaxDamage, 0), new StatMod(StatModType.SwingSpeed, 250) }, 40.0);
public static readonly PolymorphEntry Gorilla = new PolymorphEntry(8437, 0x1D, 1015240, new[] { new StatMod(StatModType.Armor, 0), new StatMod(StatModType.MinDamage, 0), new StatMod(StatModType.MaxDamage, 0), new StatMod(StatModType.SwingSpeed, 300) }, 40.0);
public static readonly PolymorphEntry BlackBear = new PolymorphEntry(8399, 0xD3, 1015241, new[] { new StatMod(StatModType.Armor, 0), new StatMod(StatModType.MinDamage, 0), new StatMod(StatModType.MaxDamage, 0), new StatMod(StatModType.SwingSpeed, 300) }, 45.0);
public static readonly PolymorphEntry GrizzlyBear = new PolymorphEntry(8411, 0xD4, 1015242, new[] { new StatMod(StatModType.Armor, 0), new StatMod(StatModType.MinDamage, 0), new StatMod(StatModType.MaxDamage, 0), new StatMod(StatModType.SwingSpeed, 300) }, 45.0);
/////////////////////////////////////////NEW DRUID BEAR/////////////////////////////////////////////////
public static readonly PolymorphEntry OsoPolymorph = new PolymorphEntry(8417, 0xD5, "Druid Bear Form", new[] { new StatMod(StatModType.Armor, 0), new StatMod(StatModType.MinDamage, 0), new StatMod(StatModType.MaxDamage, 0), new StatMod(StatModType.SwingSpeed, 300) }, 45.0);
////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static readonly PolymorphEntry Horse = new PolymorphEntry(8481, 0xCC, "Horse", new[] { new StatMod(StatModType.None, 0) }, 45.0);
public static readonly PolymorphEntry HumanMale = new PolymorphEntry(8397, 0x190, 1015244, new[] { new StatMod(StatModType.None, 0) }, 40.0);
public static readonly PolymorphEntry HumanFemale = new PolymorphEntry(8398, 0x191, 1015254, new[] { new StatMod(StatModType.None, 0) }, 40.0);
public static readonly PolymorphEntry Slime = new PolymorphEntry(8424, 0x33, 1015246, new[] { new StatMod(StatModType.Strength, -0), new StatMod(StatModType.Dexterity, 0), new StatMod(StatModType.MinDamage, 0), new StatMod(StatModType.MaxDamage, 0), new StatMod(StatModType.SwingSpeed, 200) }, 50.0);
public static readonly PolymorphEntry Orc = new PolymorphEntry(8416, 0x11, 1015247, new[] { new StatMod(StatModType.Armor, 0), new StatMod(StatModType.MinDamage, 0), new StatMod(StatModType.MaxDamage, 0), new StatMod(StatModType.SwingSpeed, 300) }, 55.0);
public static readonly PolymorphEntry LizardMan = new PolymorphEntry(8414, 0x24, 1015248, new[] { new StatMod(StatModType.Armor, 0), new StatMod(StatModType.MinDamage, 0), new StatMod(StatModType.MaxDamage, 0), new StatMod(StatModType.SwingSpeed, 300) }, 60.0);
public static readonly PolymorphEntry Gargoyle = new PolymorphEntry(8409, 0x04, 1015249, new[] { new StatMod(StatModType.Strength, 0), new StatMod(StatModType.Dexterity, -0), new StatMod(StatModType.Armor, 0), new StatMod(StatModType.MinDamage, 0), new StatMod(StatModType.MaxDamage, 0), new StatMod(StatModType.SwingSpeed, 350) }, 63.0);
public static readonly PolymorphEntry Ogre = new PolymorphEntry(8415, 0x01, 1015250, new[] { new StatMod(StatModType.Strength, 0), new StatMod(StatModType.Dexterity, -0), new StatMod(StatModType.Armor, 0), new StatMod(StatModType.MinDamage, 0), new StatMod(StatModType.MaxDamage, 0), new StatMod(StatModType.SwingSpeed, 400) }, 68.0);
public static readonly PolymorphEntry Troll = new PolymorphEntry(8425, 0x36, 1015251, new[] { new StatMod(StatModType.Strength, 0), new StatMod(StatModType.Dexterity, -0), new StatMod(StatModType.Armor, 0), new StatMod(StatModType.MinDamage, 0), new StatMod(StatModType.MaxDamage, 00), new StatMod(StatModType.SwingSpeed, 400) }, 70.0);
public static readonly PolymorphEntry Ettin = new PolymorphEntry(8408, 0x02, 1015252, new[] { new StatMod(StatModType.Strength, 0), new StatMod(StatModType.Dexterity, -0), new StatMod(StatModType.Armor, 0), new StatMod(StatModType.MinDamage, 0), new StatMod(StatModType.MaxDamage, 0), new StatMod(StatModType.SwingSpeed, 400) }, 73.0);
public static readonly PolymorphEntry GiantSerpent = new PolymorphEntry(8446, 0x15, "Giant Serpent", new[] { new StatMod(StatModType.Strength, 0), new StatMod(StatModType.Dexterity, -0), new StatMod(StatModType.Armor, 0), new StatMod(StatModType.MinDamage, 0), new StatMod(StatModType.MaxDamage, 0), new StatMod(StatModType.SwingSpeed, 450) }, 75.0);
public static readonly PolymorphEntry Daemon = new PolymorphEntry(8403, 0x09, 1015253, new[] { new StatMod(StatModType.Strength, 0), new StatMod(StatModType.Dexterity, -0), new StatMod(StatModType.Armor, -0) }, 85.0);
public static readonly PolymorphEntry Dragon = new PolymorphEntry(8406, 0x3B, "Dragon", new[] { new StatMod(StatModType.Strength, 150), new StatMod(StatModType.Dexterity, -0), new StatMod(StatModType.Armor, 0), new StatMod(StatModType.MinDamage, 1), new StatMod(StatModType.MaxDamage, 1), new StatMod(StatModType.SwingSpeed, 900) }, 98.0);
private static readonly PolymorphEntry[] m_Entries = new[]
{
Chicken,
Dog,
Cat,
Wolf,
Panther,
Gorilla,
BlackBear,
GrizzlyBear,
OsoPolymorph,
Horse,
HumanMale,
HumanFemale,
Slime,
Orc,
LizardMan,
Gargoyle,
Ogre,
Troll,
Ettin,
GiantSerpent,
Daemon,
Dragon
};
private readonly int m_Art;
private readonly int m_Body;
private readonly int m_Num;
private readonly string m_LocName;
private readonly StatMod[] m_StatMods;
private readonly double m_SkillRequired;
private static Dictionary<int, PolymorphEntry> m_PolymorphEntries;
public static void Initialize()
{
m_PolymorphEntries = new Dictionary<int, PolymorphEntry>();
for (int i = 0; i < m_Entries.Length; ++i)
m_PolymorphEntries.Add(m_Entries[i].ArtID, m_Entries[i]);
}
public int ArtID { get { return m_Art; } }
public int BodyID { get { return m_Body; } }
public int LocNumber { get { return m_Num; } }
public string LocName { get { return m_LocName; } }
public StatMod[] StatMods { get { return m_StatMods; } }
public double SkillRequired { get { return m_SkillRequired; } }
static public Dictionary<int, PolymorphEntry> EntryInfo { get { return m_PolymorphEntries; } }
private PolymorphEntry(int Art, int Body, int LocNum, StatMod[] StatMods, double SkillRequired)
{
m_Art = Art;
m_Body = Body;
m_Num = LocNum;
m_StatMods = StatMods;
m_SkillRequired = SkillRequired;
}
private PolymorphEntry(int Art, int Body, string LocName, StatMod[] StatMods, double SkillRequired)
{
m_Art = Art;
m_Body = Body;
m_LocName = LocName;
m_StatMods = StatMods;
m_SkillRequired = SkillRequired;
}
public string GetName()
{
if (m_LocName != null)
return m_LocName;
if (m_Num > 0)
return CliLoc.LocToString(m_Num);
return "Name error";
}
}
public class PolymorphGump : Gump
{
private class PolymorphCategory
{
private readonly int m_Num;
private readonly PolymorphEntry[] m_Entries;
public PolymorphCategory(int num, params PolymorphEntry[] entries)
{
m_Num = num;
m_Entries = entries;
}
public PolymorphEntry[] Entries { get { return m_Entries; } }
public int LocNumber { get { return m_Num; } }
}
private static readonly PolymorphCategory[] Categories = new[]
{
new PolymorphCategory( 1015235, // Animals
PolymorphEntry.Chicken,
PolymorphEntry.Dog,
PolymorphEntry.Cat,
PolymorphEntry.Wolf,
PolymorphEntry.Panther,
PolymorphEntry.Gorilla,
PolymorphEntry.BlackBear,
PolymorphEntry.GrizzlyBear,
PolymorphEntry.OsoPolymorph,
PolymorphEntry.Horse,
PolymorphEntry.HumanMale ),
new PolymorphCategory( 1015245, // Monsters
PolymorphEntry.Slime,
PolymorphEntry.Orc,
PolymorphEntry.LizardMan,
PolymorphEntry.Gargoyle,
PolymorphEntry.Ogre,
PolymorphEntry.Troll,
PolymorphEntry.Ettin,
PolymorphEntry.GiantSerpent,
PolymorphEntry.Daemon,
PolymorphEntry.Dragon,
PolymorphEntry.HumanFemale )
};
private readonly Mobile m_Caster;
private readonly Item m_Scroll;
public PolymorphGump(Mobile caster, Item scroll)
: base(50, 50)
{
m_Caster = caster;
m_Scroll = scroll;
int x;
AddPage(0);
AddBackground(0, 0, 585, 393, 5054);
AddBackground(195, 36, 387, 275, 3000);
AddHtmlLocalized(0, 0, 510, 18, 1015234, false, false); // <center>Polymorph Selection Menu</center>
AddHtmlLocalized(60, 355, 150, 18, 1011036, false, false); // OKAY
AddButton(25, 355, 4005, 4007, 1, GumpButtonType.Reply, 1);
AddHtmlLocalized(320, 355, 150, 18, 1011012, false, false); // CANCEL
AddButton(285, 355, 4005, 4007, 0, GumpButtonType.Reply, 2);
int y = 35;
for (int i = 0; i < Categories.Length; i++)
{
PolymorphCategory cat = Categories[i];
AddHtmlLocalized(5, y, 150, 25, cat.LocNumber, true, false);
AddButton(155, y, 4005, 4007, 0, GumpButtonType.Page, i + 1);
y += 25;
}
for (int i = 0; i < Categories.Length; i++)
{
PolymorphCategory cat = Categories[i];
AddPage(i + 1);
for (int c = 0; c < cat.Entries.Length; c++)
{
PolymorphEntry entry = cat.Entries[c];
x = 198 + (c % 3) * 129;
y = 38 + (c / 3) * 67;
AddHtml(x, y, 100, 18, entry.GetName(), false, false);
AddItem(x + 20, y + 25, entry.ArtID);
AddRadio(x, y + 20, 210, 211, false, (c << 8) + i);
}
}
}
public override void OnResponse(NetState state, RelayInfo info)
{
if (info.ButtonID == 1 && info.Switches.Length > 0)
{
int cnum = info.Switches[0];
int cat = cnum % 256;
int ent = cnum >> 8;
if (cat >= 0 && cat < Categories.Length)
{
if (ent >= 0 && ent < Categories[cat].Entries.Length)
{
if (m_Caster.Skills[SkillName.Magery].Base < Categories[cat].Entries[ent].SkillRequired)
m_Caster.SendAsciiMessage("No tienes la suficiente magia para transformarte en eso");
else
{
Spell spell = new PolymorphSpell(m_Caster, m_Scroll, Categories[cat].Entries[ent]);
spell.Cast();
}
}
}
}
}
}
}
The 'new' bear file wich is a clone of the polarbear xD
Code:
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
namespace Server.Mobiles
{
// CorpseName( "Cadaver de Oso Druida" )]
[TypeAlias( "Server.Mobiles.OsoDruida" )]
public class OsoPolymorph : BaseCreature
{
[Constructable]
public OsoPolymorph() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
{
Name = "Druid Bear Form";
Body = 213;
Hue = 1156;
//Name = "Oso Polar";
BaseSoundID = 0xA3;
// IsRenamed; true;
SetStr( 116, 140 );
Hue = 1940;
SetDex( 81, 105 );
SetInt( 26, 50 );
SetHits( 120, 204 );
SetMana( 0 );
SetDamage( 20, 22 );
SetDamageType( ResistanceType.Physical, 0 );
SetResistance( ResistanceType.Physical, 25, 35 );
SetResistance( ResistanceType.Cold, 60, 80 );
SetResistance( ResistanceType.Poison, 15, 25 );
SetResistance( ResistanceType.Energy, 10, 15 );
SetSkill( SkillName.MagicResist, 145.1, 160.0 );
SetSkill( SkillName.Tactics, 160.1, 190.0 );
SetSkill( SkillName.Wrestling, 145.1, 170.0 );
Fame = 1500;
VirtualArmor = 0;
Tamable = false;
ControlSlots = 1;
MinTameSkill = 35.1;
}
public override int Hue
{
get
{
return 1156;
}
}
public override void OnSingleClick( Mobile from )
{
PrivateOverheadMessage( MessageType.Label, 25, true, "[Oso Druida]", from.NetState );
// base.OnSingleClick( from );
// PrivateOverheadMessage( MessageType.Label, 2548, true, "[Velocidad de Ataque Extremadamente Baja]", from.NetState );
base.OnSingleClick( from );
}
public override int Meat{ get{ return 2; } }
//public virtual int Hides{ get{ return 0; } }
//public virtual HideType HideType{ get{ return HideType.Regular; } }
//public override int Scales{ get{ return 1; } }
//public override ScaleType ScaleType{ get{ return ( PolarBearSkin); } }
//public override int Hides{ get{ return 10; } }
//public override int PolarBearSkin { get{ return 3; } }
public override FoodType FavoriteFood{ get{ return FoodType.Fish | FoodType.FruitsAndVegies | FoodType.Meat; } }
public override PackInstinct PackInstinct{ get{ return PackInstinct.Bear; } }
public OsoPolymorph( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
And Polymorph.cs spell just in case:
Code:
using System;
using System.Collections.Generic;
using Server.Custom.Polymorph;
using Server.Items;
using Server.Mobiles;
using Server.Spells.Fifth;
namespace Server.Spells.Seventh
{
public class PolymorphSpell : MagerySpell
{
public override SpellCircle Circle { get { return SpellCircle.Seventh; } }
public override int Sound { get { return 527; } }
public override bool HasNoTarget { get { return true; } }
private static readonly SpellInfo m_Info = new SpellInfo(
"Polymorph", "Vas Ylem Rel",
263,
9002,
Reagent.Bloodmoss,
Reagent.SpidersSilk,
Reagent.MandrakeRoot
);
private readonly int m_NewBody;
private readonly PolymorphEntry m_PolymorphEntry;
public PolymorphSpell( Mobile caster, Item scroll, int body ) : base( caster, scroll, m_Info )
{
m_NewBody = body;
}
public PolymorphSpell( Mobile caster, Item scroll ) : this(caster,scroll,0)
{
}
public PolymorphSpell(Mobile caster, Item scroll, PolymorphEntry polymorphEntry) : base(caster, scroll, m_Info)
{
m_PolymorphEntry = polymorphEntry;
m_NewBody = polymorphEntry.BodyID;
}
public override bool CheckCast()
{
if ( TransformationSpellHelper.UnderTransformation( Caster ) )
{
Caster.SendLocalizedMessage( 1061633 ); // You cannot polymorph while in that form.
return false;
}
if (DisguiseTimers.IsDisguised(Caster))
{
Caster.SendLocalizedMessage( 502167 ); // You cannot polymorph while disguised.
return false;
}
if ( Caster.BodyMod == 183 || Caster.BodyMod == 184 )
{
Caster.SendLocalizedMessage( 1042512 ); // You cannot polymorph while wearing body paint
return false;
}/*
if ( Caster.NameMod != null || Caster.HueMod != -1 )
{
Caster.SendAsciiMessage("You cannot polymorph while incognito");
return false;
}*/
if ( m_NewBody == 0 )
{
Caster.SendGump(new PolymorphGump(Caster, Scroll));
return false;
}
return true;
}
public override void OnCast()
{
if (SphereSpellTarget is BaseWand)
{
BaseWand bw = SphereSpellTarget as BaseWand;
bw.RechargeWand(Caster, this);
}
else if ( TransformationSpellHelper.UnderTransformation( Caster ) )
{
Caster.SendLocalizedMessage( 1061633 ); // You cannot polymorph while in that form.
}
else if (DisguiseTimers.IsDisguised(Caster))
{
Caster.SendLocalizedMessage( 502167 ); // You cannot polymorph while disguised.
}
else if ( Caster.BodyMod == 183 || Caster.BodyMod == 184 )
{
Caster.SendLocalizedMessage( 1042512 ); // You cannot polymorph while wearing body paint
}/*
else if ( !Caster.CanBeginAction( typeof( IncognitoSpell ) ) )
{
DoFizzle();
}*/
else if ( CheckSequence() )
{
StopTimer(Caster); //Reset polymorph spell
if ( Caster.BeginAction( typeof( PolymorphSpell ) ) )
{
if (m_PolymorphEntry.BodyID != 0)
{
if (!((Body)m_PolymorphEntry.BodyID).IsHuman)
{
IMount mt = Caster.Mount;
if (mt != null)
mt.Rider = null;
}
if (m_PolymorphEntry.BodyID == 0x3B) //Dragon, two different body IDs
Caster.BodyMod = Utility.RandomList(0x3B, 0xC);
else
Caster.BodyMod = m_PolymorphEntry.BodyID;
Caster.PlaySound(Sound);
StopTimer(Caster);
Timer t = new InternalTimer(Caster, m_PolymorphEntry);
m_Timers.Add(Caster, t);
t.Start();
BaseArmor.ValidateMobile(Caster);
BaseWeapon.ValidateMobile(Caster);
////////////////////////////////////////////
UndressItem( Caster, Layer.OuterTorso );
UndressItem( Caster, Layer.InnerTorso );
UndressItem( Caster, Layer.MiddleTorso );
UndressItem( Caster, Layer.Pants );
UndressItem( Caster, Layer.Arms );
UndressItem( Caster, Layer.Cloak );
UndressItem( Caster, Layer.Shirt );
UndressItem( Caster, Layer.Pants );
UndressItem( Caster, Layer.InnerLegs );
//UndressItem( Caster, Layer.Shoes );
// UndressItem( Caster, Layer.LeatherShorts );
//UndressItem( Caster, PlateArms );
UndressItem( Caster, Layer.Helm );
///UndressItem( Caster, Layer.OuterLegs );
//UndressItem( Caster, Layer.OuterLegs );
UndressItem( Caster, Layer.Gloves );
UndressItem( Caster, Layer.Waist );
////////////////////////////////////////////////
if (Caster.NameMod != null) //Caster has incognito, need to update name
Caster.NameMod = IncognitoSpell.GetNameMod(Caster.BodyValue);
}
}
else
{
Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
}
}
FinishSequence();
}
///////////////////////
public void UndressItem( Mobile m, Layer layer )
{
Item item = m.FindItemOnLayer( layer );
if ( item != null && item.Movable )
m.PlaceInBackpack( item );
}
///////////////
private static readonly Dictionary<Mobile, Timer> m_Timers = new Dictionary<Mobile, Timer>();
public static bool StopTimer( Mobile m )
{
if (!m_Timers.ContainsKey(m))
return false;
RemoveMorphEffect(m);
//Stop the timer
m_Timers[m].Stop();
//Remove it from the dictionary
m_Timers.Remove( m );
return true;
}
private static void RemoveMorphEffect(Mobile m)
{
m.BodyMod = 0;
string modName = m.Serial + "Polymorph";
m.RemoveStatMod(modName + "Str");
m.RemoveStatMod(modName + "Dex");
m.RemoveStatMod(modName + "Int");
m.VirtualArmorMod = 0;
if (m is PlayerMobile)
{
PlayerMobile pm = ((PlayerMobile) m);
pm.MinDamage = 0;
pm.MaxDamage = 0;
pm.SwingSpeed = 0;
}
m.EndAction(typeof(PolymorphSpell));
BaseArmor.ValidateMobile(m);
if (m.NameMod != null) //Player has incognito, need to update name
m.NameMod = IncognitoSpell.GetNameMod(m.BodyValue);
}
private class InternalTimer : Timer
{
private readonly Mobile m_Owner;
private readonly PolymorphEntry m_PolymorphEntry;
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;
}
}
}
protected override void OnTick()
{
if ( !m_Owner.CanBeginAction( typeof( PolymorphSpell ) ) )
{
m_Owner.BodyMod = 0;
string modName = m_Owner.Serial + "Polymorph";
m_Owner.RemoveStatMod(modName + "Str");
m_Owner.RemoveStatMod(modName + "Dex");
m_Owner.RemoveStatMod(modName + "Int");
m_Owner.VirtualArmorMod = 0;
if (m_Owner is PlayerMobile)
{
PlayerMobile pm = ((PlayerMobile)m_Owner);
pm.MinDamage = 0;
pm.MaxDamage = 0;
pm.SwingSpeed = 0;
}
m_Owner.EndAction( typeof( PolymorphSpell ) );
StopTimer(m_Owner);
BaseArmor.ValidateMobile( m_Owner );
if (m_Owner.NameMod != null) //Player has incognito, need to update name
m_Owner.NameMod = IncognitoSpell.GetNameMod(m_Owner.BodyValue);
}
}
}
}
}
Sorry for being so annoying