Im trying to make an axe that deals damage bonus and removes mana from playermobiles with higher eval than 50.0

Right now, the bonus gets applied even if defender have 0 evaluating intelligence. heres the code:


Code:
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus) //On hit trigger
        {
       
            if (defender is PlayerMobile)
            {
            if (defender.Skills[SkillName.EvalInt].Value >=50.0);
            {
                if (Utility.RandomDouble() <= 0.42) // 20% chance of scoring a critical hit
                {
                   damageBonus = 1.21;
                    attacker.SendAsciiMessage(45,"You remove mana from your target!");
                    defender.SendAsciiMessage(45,"The hit blows your mind!");
                
                attacker.PlaySound( 0x5C6 );
                defender.PlaySound( 0x5C6 );
                defender.FixedParticles( 0x3709, 1, 30, 0x26ED, 5, 2, EffectLayer.Waist );
                defender.FixedParticles( 0x376A, 1, 30, 0x251E, 5, 3, EffectLayer.Waist );
                //defender.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Head );           
                
                    defender.Mana -= 15;
                }
                else
                {
                    damageBonus = 1.18;
                }
            }
               
            }

            base.OnHit(attacker, defender, damageBonus);
            }
 
Hmm, looks ok. Try changing:

if (defender.Skills[SkillName.EvalInt].Value >=50.0);

To:

if (defender.Skills[SkillName.EvalInt].Fixed >=50.0);
 
Changed it, still have the same problem, im hitting a char with 0 Eval and the remove mana effect happens :/
 
Are they wearing anything that increases their EvalInt to above 50? The code looks good.

You can try:

if (defender.Skills[SkillName.EvalInt].Base >=50.0);

To eliminate any skill bonuses they might have on. I'm kinda puzzled tho, because your code looks fine.
 
Are they wearing anything that increases their EvalInt to above 50? The code looks good.

.


Sorry missed the question, no not wearing anything that give bonus to eval

Sure i send you the file

-edit-
I have a weapon that apply bonus damage vs Players with more than 4 kills, it works fine, so i dont know wheres the issue
[doublepost=1475273699][/doublepost]I think is working now:

Code:
if (defender.Skills.EvalInt.Base >=50)

Will test more tomorrow, im way too sleepy now, heading to bed.

Btw whats the method to not unequip when casting a spell? i want to override some weapons. Saw a method somewhere, just forgot the way it was

Unequiponcast maybe? i dont know.

Well thanks for your help !
 
Last edited:
Yeah, it was working fine for me using the Base version of skills. I'm thinking that something was giving them a little bit of skill in Eval.

For the no unequip, you have to make the weapon spellchanneling...

Attributes.SpellChanneling =1;
 
Yeah, it was working fine for me using the Base version of skills. I'm thinking that something was giving them a little bit of skill in Eval.

For the no unequip, you have to make the weapon spellchanneling...

Attributes.SpellChanneling =1;

Hmm weird, because i did .setallskills 0 before testing.

I have aos disabled, my items have no attritbutes such as spellchanneling.

Thank you

Ah, i found the method:

Code:
public override bool ClearHandsOnCast{ get{ return false; } }

The one that spiritspeak uses, i tried to add it to the axe, it gave me error of course



CS0115: Line 15: 'Server.Items.DwarvenBattleAxe.ClearHandsOnCast': no suitab
le method found to override
 
Last edited:
That method based on spells and is not a valid method on a weapon. They don't share a common base and so the method is out of context.

Spellchanneling on the weapon will do what you're wanting.
 
having a simular issue with my axe


Code:
 public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)//adding hidden weapon procs to an otherwise gimp weapon
        {
            base.OnHit(attacker, defender, damageBonus);


            if (0.005 > Utility.RandomDouble())//2% of the time this weapon will set a defenders hit points to 0 almost killing it
            {
                defender.Hits -= defender.HitsMax;
                attacker.Say("*almost kills their opponent in one swing*");
            }

Errors:
+ Custom Scripts/Test/Doomgiver.cs:
CS0115: Line 41: 'Server.Items.Doomgiver.OnHit(Server.Mobile, Server.Mobile, double)': no suitable method found to override

Any help?
 
Back