- ServUO Version
- Publish Unknown
- Ultima Expansion
- Stygian Abyss
Ok general question kind of out of the park here. I have a craftable item which on double click it will produce and mobile with a public enum I want the resource to match the enum when double clicked. but having some issues just need a nudge lol here is code have somewhat an idea but running into issues.
1. MechanicalScorpion scorpion = new MechanicalScorpion(); " I know in this area after the ;ast part the "() there will need to be something in there my enum will need to be in there to call out in the mobile just not quite sure how to do it if someone could just guide me to a example of a script i can look at to see would help.
2. ill post code for OnDoubleClick part im having an issue with not sure excatly how to go about this.
And now ill post the error
Any help would be greatful some examples would be great.
opps ill post my enum from the basecreature mech im going to be spawning from the item.
1. MechanicalScorpion scorpion = new MechanicalScorpion(); " I know in this area after the ;ast part the "() there will need to be something in there my enum will need to be in there to call out in the mobile just not quite sure how to do it if someone could just guide me to a example of a script i can look at to see would help.
2. ill post code for OnDoubleClick part im having an issue with not sure excatly how to go about this.
ondouble click:
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendMessage( "You must have the Statue in your backpack to release the mechanical scorpion." );
}
else if ( this.AllowCharging == true )
{
this.Delete();
from.SendMessage( "You have now freed the Mechanical Scorpion from its Statue!!" );
if ( this.Resource.DullCopper )
{
MechanicalScorpion scorpion = new MechanicalScorpion();
scorpion.Map = from.Map;
scorpion.Location = from.Location;
scorpion.Controlled = true;
scorpion.ControlMaster = from;
scorpion.IsBonded = true;
}
else
{
MechanicalScorpion scorpion = new MechanicalScorpion();
scorpion.Map = from.Map;
scorpion.Location = from.Location;
scorpion.Controlled = true;
scorpion.ControlMaster = from;
scorpion.IsBonded = true;
}
And now ill post the error
error:
Errors:
+ Items/Skill Items/Tinkering/Mechs/MechanicalScorpionStatue.cs:
CS0176: Line 51: Member 'Server.Items.CraftResource.DullCopper' cannot be accessed with an instance reference; qualify it with a type name instead
CS0029: Line 51: Cannot implicitly convert type 'Server.Items.CraftResource' to 'bool'
Any help would be greatful some examples would be great.
opps ill post my enum from the basecreature mech im going to be spawning from the item.
enums:
public enum MaterialType
{
Iron,
DullCopper,
ShadowIron,
Copper,
Bronze,
Gold,
Silver,
Cobalt,
Thorium,
Mythril
}