sahisahi
Member
Im trying to change the Escort npc keywords to a custom one;
This is my baaaaaaaaaaaad attempt:
errors
Errors:
+ Mobiles/Townfolk/BaseEscortable.cs:
CS0120: Line 187: An object reference is required for the non-static field,
method, or property 'Server.Mobiles.BaseEscortable.GetDestination()'
CS0026: Line 189: Keyword 'this' is not valid in a static property, static m
ethod, or static field initializer
CS0120: Line 190: An object reference is required for the non-static field,
method, or property 'Server.Mobiles.BaseEscortable.SayDestinationTo(Server.Mobil
e)'
CS0026: Line 192: Keyword 'this' is not valid in a static property, static m
ethod, or static field initializer
CS0120: Line 193: An object reference is required for the non-static field,
method, or property 'Server.Mobiles.BaseEscortable.AcceptEscorter(Server.Mobile)
Code:
public override void OnSpeech(SpeechEventArgs e)
{
base.OnSpeech(e);
EDI dest = GetDestination();
if (dest != null && !e.Handled && e.Mobile.InRange(this.Location, 3))
{
if (e.HasKeyword(0x1D)) // *destination*
e.Handled = SayDestinationTo(e.Mobile);
else if (e.HasKeyword(0x1E)) // *i will take thee*
e.Handled = AcceptEscorter(e.Mobile);
}
}
This is my baaaaaaaaaaaad attempt:
Code:
public static void EventSink_Speech(SpeechEventArgs args)
{
Mobile from = args.Mobile;
if (from == null || from.Map == null || !from.Player) return;
EDI dest = GetDestination();
if (dest != null && args.Speech != null && args.Mobile.InRange(this.Location, 3) && args.Speech.ToLower() == "A donde quieres ir")
args.Speech = SayDestinationTo(args.Mobile);
else if (dest != null && args.Speech != null && args.Mobile.InRange(this.Location, 3) && args.Speech.ToLower() == "Ire contigo")
args.Speech = AcceptEscorter(args.Mobile);
}
errors
Errors:
+ Mobiles/Townfolk/BaseEscortable.cs:
CS0120: Line 187: An object reference is required for the non-static field,
method, or property 'Server.Mobiles.BaseEscortable.GetDestination()'
CS0026: Line 189: Keyword 'this' is not valid in a static property, static m
ethod, or static field initializer
CS0120: Line 190: An object reference is required for the non-static field,
method, or property 'Server.Mobiles.BaseEscortable.SayDestinationTo(Server.Mobil
e)'
CS0026: Line 192: Keyword 'this' is not valid in a static property, static m
ethod, or static field initializer
CS0120: Line 193: An object reference is required for the non-static field,
method, or property 'Server.Mobiles.BaseEscortable.AcceptEscorter(Server.Mobile)