Hello, I've started to customize my Uo for playng solo and sometimes with my friends.
I am new in this, but little by little I am learning new things and going ahead on the project.
Now I am in a dead point because I need few more things to change and i really don't know how to do. Make lots of ties like I've done for other things i've changed has only caused crashes :(
so I've renounced to do it triyng by myself :( and I am looking for someone kind and patient who can helps me. Any kind of help will be appreciated. Thank you!
Here the things i still have to script and that i am not able to do by myself.

1) I wanted to change damage done in PVP from the one done in PVM, so I've tried to customize for example magic arrow with a line like this:
Magic arrow modified string:
if (target is PlayerMobile)
                {
                    damage = Utility.Random(2, 4);

                    if (CheckResisted((PlayerMobile)target))
                    {
                        damage *= 0.75;

                        ((PlayerMobile)target).SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
                    }

                    damage *= GetDamageScalar((PlayerMobile)target);
                }
                else if (target is BaseCreature)
                        {
                            damage = 8;
                        }

It worked well, but when i've done the same things with fireball, the server crashes on second cast of it.
So I've tought that is better recode the main spell and the base weapon script with a code that make *2 dmg against not player mobiles, but I don't know how to do it well. Maybe someone can help me?

2) I would like to do a combat system based on the fact that "An Ort"(dispell) works for remove bless stats (blessed with potion or spells) and curse stat (clumsy weaken and or feeblemind) form a player, and blessing spells has no effect on cursed target (without anorting him before). Same things for curse spells that has no effect on blessed target

3) I've setted that can prepare a spell running, but i don't know how to introduce a spellfail check if you move after the spell is prepared and you have to take the target

4) I've successfully changed the healing time with my code, but i wanted to make a different bandage time when player is damaged from mobiles instead of player. But I've no idea on what doesn't work

Healing time dex based:
public static TimeSpan GetDelay(Mobile healer, Mobile patient, bool dead, SkillName skill)
		{
			var resDelay = dead ? 5.0 : 0.0;

			var dex = healer.Dex;
			var ritardo = 100 - dex;
			if (ritardo < 1) ritardo = 1;
			ritardo = ritardo / 4;

            double seconds;

			if (healer == patient)
            {
                if (Core.AOS && Mobile Attacker is PlayerMobile)
                {
                    seconds = ritardo + 6;
                }
                else if (Mbile Attacker is BaseCreature)
                {
                    seconds = 4;
                }
            }
     }

5) can't go out form boat because (i think) the character has got low Z when i try to land. I don't know how to fix it, but I've tried anyway to add a label in the tillerman gump that teleport the character where you point the mouse, but I've done a disaster.

6) tried to do a player command that show the coordinate of the charter, but i've had a bad experience with point2d command...
My boat, melee and spell system are basically the default one from Servuo

Thank you for all the support, help and suggestions you can give to me.
 
(1) Well, this is one method I use to help prevent crashing from mis-cast objects.
C#:
if (Target is PlayerMobile)
{
    PlayerMobile pm = (PlayerMobile) Target;
    damage = Utility.Random(2, 4);

    if (CheckResisted(pm))
    {
        damage *= 0.75;
        pm.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
     }

     damage *= GetDamageScalar(pm);
    
}
I'm not sure if that was your problem....it does help if you tell us what kind of crash it was. You can even post the crash report and we get a good idea of what's going on.

(6) Every mobile has an X, Y, and Z. If you're having troubles locating a mobile based on point2d, you can always just refer to those. You could also refer to the [where command to see how that's done.

Sorry I can't be more helpful right now...I'm at work.
But if you could post your crash report when you make changes to your scripts, it would make it a lot easier to help you.
 
thank you.

Code:
 Exception:
System.ArgumentException: È già stato aggiunto un elemento con la stessa chiave.
   in System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   in System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   in Server.Spells.Spell.StartDelayedDamageContext(IDamageable d, Timer t)
   in Server.Spells.SpellHelper.SpellDamageTimerAOS..ctor(Spell s, IDamageable target, Mobile from, Int32 damage, Int32 phys, Int32 fire, Int32 cold, Int32 pois, Int32 nrgy, Int32 chaos, Int32 direct, TimeSpan delay, DFAlgorithm dfa)
   in Server.Spells.SpellHelper.Damage(Spell spell, TimeSpan delay, IDamageable damageable, Mobile from, Double damage, Int32 phys, Int32 fire, Int32 cold, Int32 pois, Int32 nrgy, DFAlgorithm dfa, Int32 chaos, Int32 direct)
   in Server.Spells.Third.FireballSpell.Target(IDamageable d)
   in Server.Spells.Third.FireballSpell.InternalTarget.OnTarget(Mobile from, Object o)
   in Server.Targeting.Target.Invoke(Mobile from, Object targeted)
   in Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
   in Server.Network.MessagePump.HandleReceive(NetState ns)
   in Server.Network.MessagePump.Slice()
   in Server.Core.Main(String[] args)
 
Well if you want to double damage on spells to creature you could simply go in basecreature and add a scalar *2
 
thank you. can you explain me how and where put the code?
 

Attachments

  • BaseCreature.cs
    247.8 KB · Views: 1
Back