コード例 #1
0
            protected override void OnTick()
            {
                try {
                    TeiravonMobile m_Player      = (TeiravonMobile)World.FindMobile((Serial)m_PlayerSerial);
                    Item           m_TimerHelper = World.FindItem((Serial)m_HelperSerial);

                    if (m_Player == null)
                    {
                        return;
                    }

                    if (m_TimerHelper == null)
                    {
                        return;
                    }

                    if (m_Stats)
                    {
                        m_Player.Str     += m_StrMod;
                        m_Player.Dex     += m_DexMod;
                        m_Player.Int     += m_IntMod;
                        m_Player.MaxMana += m_ManaMaxMod;
                        m_Player.MaxStam += m_StamMaxMod;
                        m_Player.MaxHits += m_HitsMaxMod;
                    }

                    if (m_Skills)
                    {
                        for (int i = 0; i <= 51; i++)
                        {
                            m_Player.Skills[i].Base += m_SkillMods[i];
                        }
                    }

                    if (m_Feat)
                    {
                        m_Player.SetActiveFeats(m_FeatMod, false);
                        m_Player.CheckResistanceBonus();
                    }


                    if (m_MessageOn)
                    {
                        m_Player.SendMessage(m_Message);
                    }

                    if (m_EmoteOn)
                    {
                        m_Player.Emote(m_Emote);
                    }

                    if (m_TimerHelper != null && m_TimerHelper is TimerHelper)
                    {
                        m_TimerHelper.Delete();
                    }

                    if (m_PotionOn)
                    {
                        switch (m_PotionEffect)
                        {
                        case PotionEffect.Chameleon:
                            m_Player.SolidHueOverride = -1;
                            m_Player.SetActivePotions(Server.Items.PotionEffect.Chameleon, false);

                            break;

                        case PotionEffect.Float:
                        case PotionEffect.GreaterFloat:
                        case PotionEffect.LesserFloat:
                            if (m_PotionEffect == PotionEffect.LesserFloat)
                            {
                                m_Player.Z -= 5;
                            }
                            else if (m_PotionEffect == PotionEffect.Float)
                            {
                                m_Player.Z -= 10;
                            }
                            else if (m_PotionEffect == PotionEffect.GreaterFloat)
                            {
                                m_Player.Z -= 15;
                            }

                            m_Player.CantWalk = false;
                            m_Player.SetActivePotions(Server.Items.PotionEffect.LesserFloat, false);
                            m_Player.SetActivePotions(Server.Items.PotionEffect.Float, false);
                            m_Player.SetActivePotions(Server.Items.PotionEffect.GreaterFloat, false);

                            m_Player.Emote("*fall down with a thud!*");

                            break;

                        case PotionEffect.Sustenance:
                            m_Player.SetActivePotions(Server.Items.PotionEffect.Sustenance, false);

                            break;

                        case PotionEffect.GreaterSustenance:
                            m_Player.SetActivePotions(Server.Items.PotionEffect.GreaterSustenance, false);

                            break;

                        case PotionEffect.GenderSwap:
                            m_Player.BodyMod = 0;
                            m_Player.SetActivePotions(Server.Items.PotionEffect.GenderSwap, false);

                            break;

                        case PotionEffect.Invisibility:
                            if (m_Player.GetActivePotions(m_PotionEffect) && m_Player.Hidden)
                            {
                                m_Player.Hidden = false;
                                m_Player.SetActivePotions(PotionEffect.Invisibility, false);
                            }
                            else if (m_Player.GetActivePotions(m_PotionEffect) && !m_Player.Hidden)
                            {
                                m_Player.SetActivePotions(PotionEffect.Invisibility, false);
                            }

                            break;

                        case PotionEffect.ManaRefresh:
                            m_Player.SetActivePotions(Server.Items.PotionEffect.ManaRefresh, false);

                            break;

                        case PotionEffect.TotalManaRefresh:
                            m_Player.SetActivePotions(Server.Items.PotionEffect.TotalManaRefresh, false);

                            break;

                        case PotionEffect.MagicResist:
                            m_Player.SetActivePotions(Server.Items.PotionEffect.MagicResist, false);

                            break;

                        case PotionEffect.Invulnerability:
                            m_Player.SetActivePotions(Server.Items.PotionEffect.Invulnerability, false);
                            m_Player.Blessed = false;
                            break;

                        case PotionEffect.ElvenElixer:
                            m_Player.SetActivePotions(Server.Items.PotionEffect.ElvenElixer, false);

                            break;

                        case PotionEffect.PlantGrowth:
                            m_Player.SetActivePotions(Server.Items.PotionEffect.PlantGrowth, false);

                            break;

                        case PotionEffect.OreRefinement:
                            m_Player.SetActivePotions(Server.Items.PotionEffect.OreRefinement, false);

                            break;

                        case PotionEffect.DwarvenRage:
                            m_Player.SetActivePotions(Server.Items.PotionEffect.DwarvenRage, false);

                            break;

                        case PotionEffect.DrowWeb:
                            m_Player.SetActivePotions(Server.Items.PotionEffect.DrowWeb, false);

                            break;

                        case PotionEffect.DrowPoisonImmune:
                            m_Player.SetActivePotions(Server.Items.PotionEffect.DrowPoisonImmune, false);

                            break;

                        case PotionEffect.OrcGrowth:
                            m_Player.SetActivePotions(Server.Items.PotionEffect.OrcGrowth, false);
                            m_Player.OBody = 0;

                            break;

                        case PotionEffect.HumanEnhance:
                            m_Player.SetActivePotions(Server.Items.PotionEffect.HumanEnhance, false);

                            break;

                        case PotionEffect.PetHeal:
                            m_Player.SetActivePotions(Server.Items.PotionEffect.PetHeal, false);

                            break;
                        }
                    }
                } catch {
                    return;
                }
            }