[Socket System Help]

gametec

Well-Known Member
Feb 5, 2014
337
47
Shard Name
Untitled
The Problem:
Lines 6-11:
These lines will change every so often to accommodate the SocketMount and SocketCreature buffs....
What I am having issues with is finding a way to have a creature utilize a HasBreath effect. This is just an example as I am just testing the system thus far. It's still very unstable, but works the way it should between Socket Mob and Gem interactions. I just can't seem to get the buffs added correctly.

I've asked for assistance, but it's been a while since I've scripted anything new for RunUO, let alone ServUO and so I'm requesting a little help; pay for play negotiable if we get an end result. Thanks.

Code:
switch (Utility.Random(3))
{
    case 0:
        {
            bsm.UsedSockets += 1;
            bsm.Hue = 68;
            bsm.AugmentList = bsm.AugmentList + "\n" + m_Augmentation.Name;
            from.SendMessage(55, "You have successfully enhanced the Socket Horse!");
            bsm.ActiveSpeed = 5.0;
            m_Augmentation.Delete();
            break;
        }
    case 1:
        {
            from.SendMessage(55, "You have failed in your attempt to enhance the Socket Horse!");
            m_Augmentation.Delete();
            break;
        }
    case 2:
        {
            bsm.Kill();
            from.SendMessage(55, "The power in the gem was too strong and killed your Socket Horse!");
            m_Augmentation.Delete();
            break;
        }
}
 

gametec

Well-Known Member
Feb 5, 2014
337
47
Shard Name
Untitled
the buffs would go where that line is... that line was a test to see if I could change the ActiveSpeed and it worked. The problem I am having is that I get the error below ALL the time when trying to add breath attacks associated with each gem.

bool BreathPoisonDamage = bsm.HasBreath; //Works
bsm.PoisonDamage = Utility.Random(25, 50); //Works


bsm.BreathPoisonDamage = Utility.Random(25, 50); //Throws Error Below

Property or indexer 'Server.Mobiles.BaseCreature.BreathPoisonDamage' cannot be assigned to -- it is read only
If I just wanted to add BreathPoisonDamage to a mobile I can do it like this:
Code:
public virtual int BreathPoisonDamage { get { return 0; } }
So how would I add it to an item that modifies an attribute like that to a mobile? This is the main issue is that I don't know how to do it. So I have put my thinking cap on, tail between my legs, and I'm waiting for someone to teach me. lol

Attached is the beta system... it's really not production server ready; I will release the final project when I fix these issues I am having. This is an alternative to MetaPets.... it allows you to use a non-xml socket system to add buffs to bonded pets using gems. I plan on extending this system for all pets, but at the moment it only covers a new class of mount called SocketMounts.
 

Attachments

Last edited:

Lokai

Moderator
ServUO Developer
Dec 4, 2014
1,157
173
Western New York State
Shard Name
Test Center
Donate
Donate money to this user
What you would probably need is to do one of the following:

1. Change BaseCreature so that the readonly properties have both setters and getters.

or

2. In your derived classes, such as BaseSocketMount, override any "socketable" properties like this:

Code:
     private int my_BreathPoisonDamage;
     public override int BreathPoisonDamage { get { return my_BreathPoisonDamage; } }
     public void SetBreathPoisonDamage( int damage )
     {
          my_BreathPoisonDamage = damage;
     }
Then, this would work:

Code:
bsm.SetBreathPoisonDamage( Utility.Random(25, 50) );