hello everyone im wondering if its possible you could help me iv been racking my brain ..

im trying to add Sean_'s_Jupiter_Weapons_Pack im getting a error
Errors:
+ CUSTOM/ScimitarOfJupiter.cs:
CS0115: Line 87: 'Server.Items.ScimitarOfJupiter.OnHit(Server.Mobile, Server.Mobile)': no suitable method found to override

any one have ideas on how i can get round this? id appreciate the advice :)
Post automatically merged:

sorry forgot to mention im running with servuo
 
Last edited:
Change the OnHit method definition in Scimitar of Jupiter to this:

public override void OnHit( Mobile attacker, IDamageable defender )
 
Thank you Lokai that worked.. although i test the item. (ScimitarOfJupiter ) and its ment to speak.. witch it is not im adding the code its using im still learning and realising some slight code diffrences to servuo from runuo.. :D

public override void OnHit( Mobile attacker, IDamageable defender )
{
base.OnHit( attacker, defender );
if( DateTime.Now >= timeTalk )
{
switch ( Utility.Random( 8 ))
{
case 0: attacker.SendMessage( "You feel the power of JUPITER aiding you in combat!" ); break;
case 1: attacker.Say( "Curse thine Offspring!" ); break;
case 2: attacker.Say( "Thy blood shall soil the land!" ); break;
case 3: attacker.Say( "Feel the wrath of JUPITER!" ); break;
case 4: attacker.Say( "Your death is at hand fiend!" ); break;
case 5: attacker.Say( "There can be only one!" ); break;
case 6: attacker.Say( "I have something to say, i'ts better to burn out than to fade away!" ); break;
case 7: attacker.Say( "Suffer the wrath of JUPITER rogue!" ); break;
//defender.Say( "Forgive my ignorance please!" );
}
timeTalk = DateTime.Now + TimeSpan.FromSeconds(60.0); // To set delay time for sword speech
}

as stated THANK YOU LOKAI i tried that code difference but in wrong order ^_^.. but it now compiles so thank you
if anyone can help or let me know if its possible with servuo to have weapons talking when attacking
 
Last edited:
It looks OK. Maybe move "base.OnHit(attacker, defender)" to the bottom after your additions?
 
i have just tried that it did not work im going to attach the script its self maybe someone can see something i dont as to why its not talking whilst fighting :)
i really appreciate the help. im happy its atleast compiling but id be forever greatful if someone can mange to also help get this talking when in combat
 

Attachments

  • ScimitarOfJupiter.cs
    3.7 KB · Views: 6
There's some issues with Say working correctly in overrides, in my experience.

Simple test would be to convert the Say to SendMessage, to verify the code. Then you might need to convert them to overhead messages.

This is just a guess, I know I've had Say fail until I definitely the mobile as a static in a few things.

Edit: I'm ok mobile and can't open the .cs easily, did you move the base below your custom code?
 
hello felon i tried the sendmassage instead on say till nada compiles but no speaking...
im not entirely sure how to convert them to overhead messages if you have anyideas how i could somewhat convert them to over head im all ears :D

also thanks for the ideas!
 
Got it.

Couple of things, there are two OnHit methods. One is just a public void, and is simply used to pass info from relic code (I guess). The second OnHit is a virtual you can override, but it requires 3 variables, the one we missed here was the double "damageBonus".

The other mistake was putting the base.OnHit in your switch array. When overriding methods, and you want the original to fire off after your custom effects, you must include the base method as your last line before the close brackets. Ultimately it was trying to override the wrong thing without the right information to override it. This should work, it worked in my testing.

C#:
public override void OnHit( Mobile attacker, IDamageable defender, double damageBonus )
        {
            if( DateTime.Now >= timeTalk )
            {
                switch ( Utility.Random( 8 ))
                {
                case 0: attacker.SendMessage( "You feel the power of JUPITER aiding you in combat!" ); break;
                case 1: attacker.Say( "Curse thine Offspring!" ); break;
                case 2: attacker.Say( "Thy blood shall soil the land!" ); break;
                case 3: attacker.Say( "Feel the wrath of JUPITER!" ); break;
                case 4: attacker.Say( "Your death is at hand fiend!" ); break;
                case 5: attacker.Say( "There can be only one!" ); break;
                case 6: attacker.Say( "I have something to say, i'ts better to burn out than to fade away!" ); break;
                case 7: attacker.Say( "Suffer the wrath of JUPITER rogue!" ); break;
                    //defender.Say( "Forgive my ignorance please!" );
                }
                timeTalk = DateTime.Now + TimeSpan.FromSeconds(60.0);    // To set delay time for sword speech
            }
            base.OnHit( attacker, defender, damageBonus );
        }
 
Thank you so very much felon I'll give it a try in a few let you know how it works for me your a legand thanks for the help everyone
 
Thank you so very much felon I'll give it a try in a few let you know how it works for me your a legand thanks for the help everyone
Just want to thank you guys for the help on that one seems I was roughly on the right track somewhat but none the less it's working and doing exactly what I wanted thank you for the help and for saving a little of my hair
 
Back