Hi, i need help with this error in Vampire quest:

Errors:
+ Custom/CustomQuests/VampireQuest/VampQuest Arti's/Mid level artis/noammobas
anged.cs:
CS0019: Line 32: Não é possível aplicar o operador '+' a operandos do tipo
long' e 'System.TimeSpan'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

The code of noammobaseranged.cs is:

Code:
 if ( DateTime.Now > (attacker.LastMoveTime + TimeSpan.FromSeconds(0.0 )) || (Core.AOS && WeaponAbility.GetCurrentAbility( attacker ) is MovingShot) )
   {
    if ( attacker.HarmfulCheck( defender ) )
    {
     attacker.DisruptiveAction();
     attacker.Send( new Swing( 0, attacker, defender ) );
     if ( OnFired( attacker, defender ) )
     {
      if ( CheckHit( attacker, defender ) )
       OnHit( attacker, defender );
      else
       OnMiss( attacker, defender );
     }
    }
    return GetDelay( attacker );
   }
 
His error: :)
CS0019: Line 32: You can not apply the operator '+' to operands of type
long 'and' System.TimeSpan '
 
You are doing:
long + timespan.
you need
long + long.

attacker.LastMoveTime + TimeSpan.FromSeconds(0.0 ))
would fail.



try this:
if ( DateTime.Now.Ticks > attacker.LastMoveTime || (Core.AOS && WeaponAbility.GetCurrentAbility( attacker ) is MovingShot) )

Now both should be in long format, comparing 56464544531 for the actual time, and 56464544520 for the last move would be valid.
Now to add time to it you can do: "+ TimeSpan.FromSeconds( 1.0 ).Ticks"
 
Back