Example #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is BaseMagicStaff && from.Backpack != null)
                {
                    BaseMagicStaff ba   = targeted as BaseMagicStaff;
                    BaseWeapon     bw   = targeted as BaseWeapon;
                    Container      pack = from.Backpack;

                    int toConsume   = 0;
                    int spellCircle = 0;
                    int myCharges   = 0;

                    if (bw.IntRequirement == 10)
                    {
                        spellCircle = 1; myCharges = 30;
                    }
                    else if (bw.IntRequirement == 15)
                    {
                        spellCircle = 2; myCharges = 23;
                    }
                    else if (bw.IntRequirement == 20)
                    {
                        spellCircle = 3; myCharges = 18;
                    }
                    else if (bw.IntRequirement == 25)
                    {
                        spellCircle = 4; myCharges = 15;
                    }
                    else if (bw.IntRequirement == 30)
                    {
                        spellCircle = 5; myCharges = 12;
                    }
                    else if (bw.IntRequirement == 35)
                    {
                        spellCircle = 6; myCharges = 9;
                    }
                    else if (bw.IntRequirement == 40)
                    {
                        spellCircle = 7; myCharges = 6;
                    }
                    else if (bw.IntRequirement == 45)
                    {
                        spellCircle = 8; myCharges = 3;
                    }

                    if (bw.IntRequirement < 1)
                    {
                        m_Enchanter.SayTo(from, "That does not need my services.");
                    }
                    else if (ba.Charges <= myCharges)
                    {
                        toConsume = spellCircle * 100;

                        if (BeggingPose(from) > 0)                           // LET US SEE IF THEY ARE BEGGING
                        {
                            toConsume = toConsume - (int)((from.Skills[SkillName.Begging].Value * 0.005) * toConsume);
                        }
                    }
                    else
                    {
                        m_Enchanter.SayTo(from, "That wand has too many charges already.");
                    }

                    if (toConsume == 0)
                    {
                        return;
                    }

                    if (pack.ConsumeTotal(typeof(Gold), toConsume))
                    {
                        if (BeggingPose(from) > 0)
                        {
                            Titles.AwardKarma(from, -BeggingKarma(from), true);
                        }                                                                                                               // DO ANY KARMA LOSS
                        m_Enchanter.SayTo(from, "Your wand is charged.");
                        from.SendMessage(String.Format("You pay {0} gold.", toConsume));
                        Effects.PlaySound(from.Location, from.Map, 0x5C1);
                        ba.Charges = ba.Charges + 5;
                    }
                    else
                    {
                        m_Enchanter.SayTo(from, "It would cost you {0} gold to have that charged.", toConsume);
                        from.SendMessage("You do not have enough gold.");
                    }
                }
                else
                {
                    m_Enchanter.SayTo(from, "That does not need my services.");
                }
            }
Example #2
0
 public MagicStaffTarget(BaseMagicStaff item) : base(6, false, TargetFlags.None)
 {
     m_Item = item;
 }