예제 #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                int nCost = 0;

                if (targeted is HenchmanFighterItem && from.Backpack != null)
                {
                    Item hench = targeted as Item;
                    HenchmanFighterItem thing = (HenchmanFighterItem)hench;

                    nCost = thing.HenchDead;
                    if (BeggingPose(from) > 0)                       // LET US SEE IF THEY ARE BEGGING - WIZARD
                    {
                        nCost = nCost - (int)((from.Skills[SkillName.Begging].Value * 0.005) * nCost);
                    }

                    Container pack      = from.Backpack;
                    int       toConsume = nCost;

                    if (nCost < 1)
                    {
                        m_BaseHealer.SayTo(from, "Your friend is not dead.");
                    }
                    else if (pack.ConsumeTotal(typeof(Gold), toConsume))
                    {
                        thing.Name      = "fighter henchman";
                        thing.HenchDead = 0;
                        thing.InvalidateProperties();
                        from.SendMessage(String.Format("You pay {0} gold.", toConsume));
                        from.PlaySound(0x214);
                        m_BaseHealer.SayTo(from, "Your henchman is back in the land of the living.");
                    }
                    else
                    {
                        m_BaseHealer.SayTo(from, "It would cost you {0} gold to have them resurrected.", toConsume);
                        from.SendMessage("You do not have enough gold.");
                    }
                }
                else if (targeted is HenchmanWizardItem && from.Backpack != null)
                {
                    Item hench = targeted as Item;
                    HenchmanWizardItem thing = (HenchmanWizardItem)hench;

                    nCost = thing.HenchDead;
                    if (BeggingPose(from) > 0)                       // LET US SEE IF THEY ARE BEGGING - WIZARD
                    {
                        nCost = nCost - (int)((from.Skills[SkillName.Begging].Value * 0.005) * nCost);
                    }

                    Container pack      = from.Backpack;
                    int       toConsume = nCost;

                    if (nCost < 1)
                    {
                        m_BaseHealer.SayTo(from, "Your friend is not dead.");
                    }
                    else if (pack.ConsumeTotal(typeof(Gold), toConsume))
                    {
                        thing.Name      = "wizard henchman";
                        thing.HenchDead = 0;
                        thing.InvalidateProperties();
                        from.SendMessage(String.Format("You pay {0} gold.", toConsume));
                        from.PlaySound(0x214);
                        m_BaseHealer.SayTo(from, "Your henchman is back in the land of the living.");
                    }
                    else
                    {
                        m_BaseHealer.SayTo(from, "It would cost you {0} gold to have them resurrected.", toConsume);
                        from.SendMessage("You do not have enough gold.");
                    }
                }
                else if (targeted is HenchmanArcherItem && from.Backpack != null)
                {
                    Item hench = targeted as Item;
                    HenchmanArcherItem thing = (HenchmanArcherItem)hench;

                    nCost = thing.HenchDead;
                    if (BeggingPose(from) > 0)                       // LET US SEE IF THEY ARE BEGGING - WIZARD
                    {
                        nCost = nCost - (int)((from.Skills[SkillName.Begging].Value * 0.005) * nCost);
                    }

                    Container pack      = from.Backpack;
                    int       toConsume = nCost;

                    if (nCost < 1)
                    {
                        m_BaseHealer.SayTo(from, "Your friend is not dead.");
                    }
                    else if (pack.ConsumeTotal(typeof(Gold), toConsume))
                    {
                        thing.Name      = "archer henchman";
                        thing.HenchDead = 0;
                        thing.InvalidateProperties();
                        from.SendMessage(String.Format("You pay {0} gold.", toConsume));
                        from.PlaySound(0x214);
                        m_BaseHealer.SayTo(from, "Your henchman is back in the land of the living.");
                    }
                    else
                    {
                        m_BaseHealer.SayTo(from, "It would cost you {0} gold to have them resurrected.", toConsume);
                        from.SendMessage("You do not have enough gold.");
                    }
                }
                else if (targeted is HenchmanMonsterItem && from.Backpack != null)
                {
                    Item hench = targeted as Item;
                    HenchmanMonsterItem thing = (HenchmanMonsterItem)hench;

                    nCost = thing.HenchDead;
                    if (BeggingPose(from) > 0)                       // LET US SEE IF THEY ARE BEGGING - WIZARD
                    {
                        nCost = nCost - (int)((from.Skills[SkillName.Begging].Value * 0.005) * nCost);
                    }

                    Container pack      = from.Backpack;
                    int       toConsume = nCost;

                    if (nCost < 1)
                    {
                        m_BaseHealer.SayTo(from, "Your friend is not dead.");
                    }
                    else if (pack.ConsumeTotal(typeof(Gold), toConsume))
                    {
                        thing.Name      = "creature henchman";
                        thing.HenchDead = 0;
                        thing.InvalidateProperties();
                        from.SendMessage(String.Format("You pay {0} gold.", toConsume));
                        from.PlaySound(0x214);
                        m_BaseHealer.SayTo(from, "Your henchman is back in the land of the living.");
                    }
                    else
                    {
                        m_BaseHealer.SayTo(from, "It would cost you {0} gold to have them resurrected.", toConsume);
                        from.SendMessage("You do not have enough gold.");
                    }
                }
                else
                {
                    m_BaseHealer.SayTo(from, "That does not need my services.");
                }
            }
예제 #2
0
        public void ItemTarget(Item hench)
        {
            if (hench is HenchmanFighterItem && CheckSequence())
            {
                HenchmanFighterItem friend = (HenchmanFighterItem)hench;

                if (friend.HenchDead > 0)
                {
                    friend.Name      = "fighter henchman";
                    friend.HenchDead = 0;
                    friend.InvalidateProperties();
                    Caster.PlaySound(0x214);
                }
                else
                {
                    Caster.SendMessage("They are not dead.");
                }
            }
            else if (hench is HenchmanWizardItem && CheckSequence())
            {
                HenchmanWizardItem friend = (HenchmanWizardItem)hench;

                if (friend.HenchDead > 0)
                {
                    friend.Name      = "wizard henchman";
                    friend.HenchDead = 0;
                    friend.InvalidateProperties();
                    Caster.PlaySound(0x214);
                }
                else
                {
                    Caster.SendMessage("They are not dead.");
                }
            }
            else if (hench is HenchmanArcherItem && CheckSequence())
            {
                HenchmanArcherItem friend = (HenchmanArcherItem)hench;

                if (friend.HenchDead > 0)
                {
                    friend.Name      = "archer henchman";
                    friend.HenchDead = 0;
                    friend.InvalidateProperties();
                    Caster.PlaySound(0x214);
                }
                else
                {
                    Caster.SendMessage("They are not dead.");
                }
            }
            else if (hench is HenchmanMonsterItem && CheckSequence())
            {
                HenchmanMonsterItem friend = (HenchmanMonsterItem)hench;

                if (friend.HenchDead > 0)
                {
                    friend.Name      = "creature henchman";
                    friend.HenchDead = 0;
                    friend.InvalidateProperties();
                    Caster.PlaySound(0x214);
                }
                else
                {
                    Caster.SendMessage("They are not dead.");
                }
            }
            else
            {
                Caster.SendMessage("This prayer didn't seem to work.");
            }
            FinishSequence();
        }