RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

petelixer's and petpowerscrolls

bugs

Squire
i noticed others looking for this stuff as i was
pet elixers rais a pets stats resists.
pet powerscrolls i added a few to the fats ones for my mercs weopon skills.
so if you have the fats you probly already have most.
also resistgems rais resist on armor
hope someone finds them usefull.
 

Attachments

  • Gem'n'Elixers.zip
    31.8 KB · Views: 33

michelle78

Sorceror
I installed this system today and everything works as stated. i was wondering how you give out the pet power scrolls on your shard, I have not successfully been able to get them to drop on a mob?
 

michelle78

Sorceror
Just for anyone else having an issue with getting the powerscrolls to drop, the following method is working. Not all of the items are from the package are included in my example, but adjust, hack away at and modify as needed.

Code:
          public override bool OnBeforeDeath()
        {
           
                switch (Utility.Random(12))
                {
                    case 0: PackItem(new PetPower120()); break;
                    case 1: PackItem(new PetPower110()); break;
                    case 2: PackItem(new PetPower115()); break;
                    case 3: PackItem(new DamageMaxElixer()); break;
                    case 4: PackItem(new DamageMinElixer()); break;
                    case 5: PackItem(new DruidSpellbook()); break;
                    case 6: PackItem(new ArmElixer()); break;
                    case 7: PackItem(new ColdResistElixer()); break;
                    case 8: PackItem(new EnergyResistElixer()); break;
                    case 9: PackItem(new FireResistElixer()); break;
                    case 10: PackItem(new PoisonResistElixer()); break;
                    case 11: PackItem(new PhysicalResistElixer()); break;
                }
         
            return base.OnBeforeDeath();
        }
 

bugs

Squire
i put in my basecreature also in my treasurechestmod.
basecreature way drops in player'spack with little sound dodo or something.
i have a mob that drops them. drops just to mobs pack
Code:
        public override void GenerateLoot()
        {
            AddLoot( LootPack.AosSuperBoss, 3 );
//start
 
                          if ( 0.15 > Utility.RandomDouble() )//0.25
 
                      switch ( Utility.Random(3))
                {
                    case 0: AddItem(new AstralPantherDeed() ); break;
                    case 1: AddItem(new AstralWolfDeed() ); break;
                    case 2: AddItem(new SpiritOfTheStag() ); break;
 
                }
           
                          if ( 0.25 > Utility.RandomDouble() )//0.25
                {
                int level;
 
                double random = Utility.RandomDouble();
 
                if ( 0.30 >= random )
                level = 120;
 
                else if ( 0.40 >= random )
                    level = 115;
 
                else
                level = 110;
 
                      switch ( Utility.Random(13))
                {
                    case 0: AddItem(new PetPowerScroll(SkillName.Magery, level) ); break;
                    case 1: AddItem(new PetPowerScroll(SkillName.EvalInt, level) ); break;
                    case 2: AddItem(new PetPowerScroll(SkillName.Meditation, level) ); break;
                    case 3: AddItem(new PetPowerScroll(SkillName.MagicResist, level) ); break;
                    case 4: AddItem(new PetPowerScroll(SkillName.Tactics, level) ); break;
                    case 5: AddItem(new PetPowerScroll(SkillName.Wrestling, level) ); break;
                    case 6: AddItem(new PetPowerScroll(SkillName.Parry, level) ); break;
                    case 7: AddItem(new PetPowerScroll(SkillName.Healing, level) ); break;
                    case 8: AddItem(new PetPowerScroll(SkillName.Swords, level) ); break;
                    case 9: AddItem(new PetPowerScroll(SkillName.Fencing, level) ); break;
                    case 10: AddItem(new PetPowerScroll(SkillName.Macing, level) ); break;
                    case 11: AddItem(new PetPowerScroll(SkillName.Archery, level) ); break;
                    case 12: AddItem(new PetPowerScroll(SkillName.Anatomy, level) ); break;
 
                }
            }
          }
  //end
        public override int GetMaxResistance( ResistanceType type )
        {
            if ( AccessLevel > AccessLevel.GameMaster )
                return int.MaxValue;
 
            int max = 80;//base.GetMaxResistance( type );
            return max;
        }
Code:
        public virtual void OnKilledBy( Mobile mob )
        {
            if ( m_Paragon && Paragon.CheckArtifactChance( mob, this ) )
                Paragon.GiveArtifactTo( mob );
        }
 
        public override void OnDeath( Container c )
        {
            MeerMage.StopEffect( this, false );
 
            if ( IsBonded )
            {
                int sound = this.GetDeathSound();
 
                if ( sound >= 0 )
                    Effects.PlaySound( this, this.Map, sound );
 
                Warmode = false;
 
                Poison = null;
                Combatant = null;
 
                Hits = 0;
                Stam = 0;
                Mana = 0;
 
                IsDeadPet = true;
                ControlTarget = ControlMaster;
                ControlOrder = OrderType.Follow;
 
                ProcessDeltaQueue();
                SendIncomingPacket();
                SendIncomingPacket();
 
                List<AggressorInfo> aggressors = this.Aggressors;
 
                for ( int i = 0; i < aggressors.Count; ++i )
                {
                    AggressorInfo info = aggressors[i];
 
                    if ( info.Attacker.Combatant == this )
                        info.Attacker.Combatant = null;
                }
 
                List<AggressorInfo> aggressed = this.Aggressed;
 
                for ( int i = 0; i < aggressed.Count; ++i )
                {
                    AggressorInfo info = aggressed[i];
 
                    if ( info.Defender.Combatant == this )
                        info.Defender.Combatant = null;
                }
 
                Mobile owner = this.ControlMaster;
 
                if ( owner == null || owner.Deleted || owner.Map != this.Map || !owner.InRange( this, 12 ) || !this.CanSee( owner ) || !this.InLOS( owner ) )
                {
                    if ( this.OwnerAbandonTime == DateTime.MinValue )
                        this.OwnerAbandonTime = DateTime.Now;
                }
                else
                {
                    this.OwnerAbandonTime = DateTime.MinValue;
                }
 
                GiftOfLifeSpell.HandleDeath( this );
 
                CheckStatTimers();
            }
            else
            {
                if ( !Summoned && !m_NoKillAwards )
                {
                    int totalFame = Fame / 100;
                    int totalKarma = -Karma / 100;
 
                    List<DamageStore> list = GetLootingRights( this.DamageEntries, this.HitsMax );
 
                    bool givenQuestKill = false;
                    bool givenFactionKill = false;
                    bool givenToTKill = false;
 
                    for ( int i = 0; i < list.Count; ++i )
                    {
                        DamageStore ds = list[i];
 
                        if ( !ds.m_HasRight )
                            continue;
 
                        Titles.AwardFame( ds.m_Mobile, totalFame, true );
                        Titles.AwardKarma(ds.m_Mobile, totalKarma, true);
 
                                #region Alpha Gold Ledger Edit 1
                        GiveGold.GoldTransfer(ds.m_Mobile, c, this);
                        #endregion
 
                        #region daat99 tokens and paragon
                        if (Daat99OWLTR.Ops[13].Setting)
                            GiveTokens.CalculateTokens(ds.m_Mobile, this);
 
                        if (m_Paragon)
                            if (Paragon.CheckArtifactChance(ds.m_Mobile, this))
                                Paragon.GiveArtifactTo(ds.m_Mobile);
                        #endregion
 
                        OnKilledBy( ds.m_Mobile );
 
//sart test
                      if  (Fame > 0 )
                      if  (Fame < 1249 )
                      if ( 0.001 > Utility.RandomDouble() )//0.25
                      {
                        PlaySound( 0x3D );
                        ds.m_Mobile.AddToBackpack(Loot.RandomElixer() );
                      } 
                     
                                       
                      if (Fame > 1250 )
                      if (Fame < 2499 )
                      if ( 0.01 > Utility.RandomDouble() )//0.25
                      {
                        PlaySound( 0x3D );
                        ds.m_Mobile.AddToBackpack(Loot.RandomElixer() );
                      } 
                 
                      if (Fame > 2500 )
                      if  (Fame < 4999 )
                      if ( 0.1 > Utility.RandomDouble() )//0.25
                      {
                        PlaySound( 0x3D );
                      if ( 0.25 > Utility.RandomDouble() )
                      {
                        ds.m_Mobile.AddToBackpack(new StrangeRock() );
                      }
                        else
                      {
                        ds.m_Mobile.AddToBackpack(Loot.RandomElixer() );
                      }
                      }
                   
                      if (Fame > 5000 )
                      if  (Fame < 9999)
                      if ( 0.5 > Utility.RandomDouble() )//0.25
                      {
                        PlaySound( 0x3D );
                      if ( 0.25 > Utility.RandomDouble() )
                      {
                        ds.m_Mobile.AddToBackpack(new StrangeRock() );
                      }
                        else
                      {
                        ds.m_Mobile.AddToBackpack(Loot.RandomElixer() );
                      }
                      }
 
                      if (Fame > 10000 )
                      if  (Fame < 19999)
                      if ( 0.15 > Utility.RandomDouble() )//0.25
                      {
                        PlaySound( 0x3D );
                      if ( 0.25 > Utility.RandomDouble() )
                      {
                        ds.m_Mobile.AddToBackpack(new StrangeRock() );
                      }
                        else
                      {
                        ds.m_Mobile.AddToBackpack(Loot.RandomElixer() );
                      }
                      }
 
                      if  (Fame > 19999)
                      if ( 0.25 > Utility.RandomDouble() )//0.25
                      {
                        PlaySound( 0x3D );
                      if ( 0.25 > Utility.RandomDouble() )
                      {
                        ds.m_Mobile.AddToBackpack(new StrangeRock() );
                      }
                        else
                      {
                        ds.m_Mobile.AddToBackpack(Loot.RandomElixer() );
                      }
                      }
//end test
 
//start
                          if ( 0.01 > Utility.RandomDouble() )//0.25
                        {
                      PlaySound( 0x3D );
                        ds.m_Mobile.AddToBackpack(Loot.RandomElixer() );
                      }
                          if ( 0.001 > Utility.RandomDouble() )//0.25
                        {
                        PlaySound( 0x3D );
                        ds.m_Mobile.AddToBackpack(new StrangeRock() );
                        }
                          if ( 0.001 > Utility.RandomDouble() )//0.25
                        {
                        PlaySound( 0x3D );
                        ds.m_Mobile.AddToBackpack(new PetPower110() );
                        }
                          if ( 0.0001 > Utility.RandomDouble() )//0.25
                        {
                        PlaySound( 0x3D );
                        ds.m_Mobile.AddToBackpack(new PetPower115() );
                        }
                          if ( 0.00001 > Utility.RandomDouble() )//0.25
                        {
                        PlaySound( 0x3D );
                        ds.m_Mobile.AddToBackpack(new PetPower120() );
                        }                   
//end
 
                        if ( !givenFactionKill )
                        {
                            givenFactionKill = true;
                            Faction.HandleDeath( this, ds.m_Mobile );
                        }
 
                        if( !givenToTKill )
                        {
                            givenToTKill = true;
                            TreasuresOfTokuno.HandleKill( this, ds.m_Mobile );
                        }
 
                        if ( givenQuestKill )
                            continue;
 
                        PlayerMobile pm = ds.m_Mobile as PlayerMobile;
 
                        if ( pm != null )
                        {
                            QuestSystem qs = pm.Quest;
 
                            if ( qs != null )
                            {
                                qs.OnKill( this, c );
                                givenQuestKill = true;
                            }
                        }
                    }
                }
 
                base.OnDeath( c );
 
                if ( DeleteCorpseOnDeath )
                    c.Delete();
            }
        }
Code:
        [Constructable]
        public TreasureLevel4() : base( Utility.RandomList(  0x9ab ) )
        {
            RequiredSkill = 92;
            LockLevel = this.RequiredSkill - Utility.Random( 1, 10 );
            MaxLockLevel = this.RequiredSkill;
            TrapType = TrapType.MagicTrap;
            TrapPower = 4 * Utility.Random( 1, 25 );
 
            DropItem( new Gold( 200, 400 ) );
            DropItem( new BlankScroll( Utility.Random( 1, 4 ) ) );
 
                //start
                      if ( 0.5 > Utility.RandomDouble() )//0.25
                        {
                      if ( 0.25 > Utility.RandomDouble() )
                      {
                        DropItem(new StrangeRock() );
                      }
                      if ( 0.15 > Utility.RandomDouble() )
                      {
                        DropItem(new PetPower115() );
                      }
                        else
                      {
                        DropItem(Loot.RandomElixer() );
                      }
                      }                 
                //end
           
            for( int i = Utility.Random( 1, 4 ); i > 1; i-- )
            {
                Item ReagentLoot = Loot.RandomReagent();
                ReagentLoot.Amount = Utility.Random( 6, 12 );
                DropItem( ReagentLoot );
            }
   
            for ( int i = Utility.Random( 1, 4 ); i > 1; i-- )
                DropItem( Loot.RandomPotion() );
           
            if ( 0.75 > Utility.RandomDouble() ) //75% chance = 3/4
                for (int i = Utility.RandomMinMax(8,16); i > 0; i--)
                    DropItem(Loot.RandomScroll(0, 47, SpellbookType.Regular));
 
            if ( 0.75 > Utility.RandomDouble() ) //75% chance = 3/4
                for (int i = Utility.RandomMinMax(6,12) + 1; i > 0; i--)
                    DropItem( Loot.RandomGem() );
 
            for( int i = Utility.Random( 1, 4 ); i > 1; i-- )
                DropItem( Loot.RandomWand() );
 
            // Magical ArmorOrWeapon
 

nikkor1132

Sorceror
I did notice one Elixer missing that i made and put into this pack. So if you don't mind i will post it so others can dl it for them selfs. Or you can add it into your pack idc just so it's out there for others to use. :cool:
 

Attachments

  • HitPointsElixer.cs
    3.2 KB · Views: 12

Sachin Esha

Wanderer
Just for anyone else having an issue with getting the powerscrolls to drop, the following method is working. Not all of the items are from the package are included in my example, but adjust, hack away at and modify as needed.

Code:
          public override bool OnBeforeDeath()
        {
         
                switch (Utility.Random(12))
                {
                    case 0: PackItem(new PetPower120()); break;
                    case 1: PackItem(new PetPower110()); break;
                    case 2: PackItem(new PetPower115()); break;
                    case 3: PackItem(new DamageMaxElixer()); break;
                    case 4: PackItem(new DamageMinElixer()); break;
                    case 5: PackItem(new DruidSpellbook()); break;
                    case 6: PackItem(new ArmElixer()); break;
                    case 7: PackItem(new ColdResistElixer()); break;
                    case 8: PackItem(new EnergyResistElixer()); break;
                    case 9: PackItem(new FireResistElixer()); break;
                    case 10: PackItem(new PoisonResistElixer()); break;
                    case 11: PackItem(new PhysicalResistElixer()); break;
                }
       
            return base.OnBeforeDeath();
        }
Sorry to sound so Noob but exactly where does this insertion go? Scripts/customs ? Public bool is a new script term i have not seen yet, thanks for the help, Love the Ps's !!! Just need to get them to drop hehe thanks again
 

michelle78

Sorceror
You would have to put this on any creature you wanted to drop the items as loot. Place this before the serial section and after the section containing the stats and resists. I'll show you an ettin dropping these items for example.....This method makes the items appear on death, so they can't be stolen from a pack by a thief

Code:
using System;
using System.Collections;
using Server.Items;
using Server.Targeting;
 
namespace Server.Mobiles
{
    [CorpseName( "an ettins corpse" )]
    public class Ettin : BaseCreature
    {
        [Constructable]
        public Ettin() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
        {
            Name = "an ettin";
            Body = 18;
            BaseSoundID = 367;
 
            SetStr( 136, 165 );
            SetDex( 56, 75 );
            SetInt( 31, 55 );
 
            SetHits( 82, 99 );
 
            SetDamage( 7, 17 );
 
            SetDamageType( ResistanceType.Physical, 100 );
 
            SetResistance( ResistanceType.Physical, 35, 40 );
            SetResistance( ResistanceType.Fire, 15, 25 );
            SetResistance( ResistanceType.Cold, 40, 50 );
            SetResistance( ResistanceType.Poison, 15, 25 );
            SetResistance( ResistanceType.Energy, 15, 25 );
 
            SetSkill( SkillName.MagicResist, 40.1, 55.0 );
            SetSkill( SkillName.Tactics, 50.1, 70.0 );
            SetSkill( SkillName.Wrestling, 50.1, 60.0 );
 
            Fame = 3000;
            Karma = -3000;
 
            VirtualArmor = 38;
        }
 
        public override void GenerateLoot()
        {
            AddLoot( LootPack.Meager );
            AddLoot( LootPack.Average );
            AddLoot( LootPack.Potions );
        }
 
                    public override bool OnBeforeDeath()
        {
     
                switch (Utility.Random(12))
                {
                    case 0: PackItem(new PetPower120()); break;
                    case 1: PackItem(new PetPower110()); break;
                    case 2: PackItem(new PetPower115()); break;
                    case 3: PackItem(new DamageMaxElixer()); break;
                    case 4: PackItem(new DamageMinElixer()); break;
                    case 5: PackItem(new DruidSpellbook()); break;
                    case 6: PackItem(new ArmElixer()); break;
                    case 7: PackItem(new ColdResistElixer()); break;
                    case 8: PackItem(new EnergyResistElixer()); break;
                    case 9: PackItem(new FireResistElixer()); break;
                    case 10: PackItem(new PoisonResistElixer()); break;
                    case 11: PackItem(new PhysicalResistElixer()); break;
                }
   
            return base.OnBeforeDeath();
        }
 
        public override bool CanRummageCorpses{ get{ return true; } }
        public override int TreasureMapLevel{ get{ return 1; } }
        public override int Meat{ get{ return 4; } }
 
        public Ettin( Serial serial ) : base( serial )
        {
        }
 
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );
            writer.Write( (int) 0 );
        }
 
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();
        }
    }
}
 

nikkor1132

Sorceror
Sachin Esha were you still wanting the crafting system? sorry for such a long wait i have been vary busy with life events lately.
 
Top