In Scripts/Mobiles/PlayerMobile.cs, alla fine del metodo OnDamage aggiungere:
Subito dopo aggiungere questo metodo:
Scripts/Mobiles/Mounts/BaseMount.cs, aggiungere in cima:
Nella dichiarazione delle variabili, aggiungere:
Modificare cosi' il metodo Serialize:
Aggiungere questi metodi:
Aggiungere al metodo Deserialize:
Per finire, aggiungere in Unicorn.cs e in Kirin.cs:
Nota: tutti i dati sono accurati come da specifiche OSI. Ringraziate Antares per i cliloc e gli effetti.
codice:
if ( Core.AOS ) CheckMountAbility( from );
codice:
private bool CheckMountAbility( Mobile attacker ) { if ( !this.Player || !this.Mounted ) return false; BaseMount mount = (BaseMount)this.Mount; if ( ( mount == null ) || ( mount.Rider != this ) ) return false; if ( mount is Unicorn ) { // For an unicorn to cure its rider, they must be poisoned and have less than 40 hps. if ( !this.Poisoned || ( this.Hits >= 40 ) ) return false; // Enforce the ability delay. if ( DateTime.Now < mount.NextMountAbility ) return false; if ( this.CurePoison( this ) ) { this.SendMessage( 0x3B2, "Your mount senses you are in danger and aids you with magic." ); this.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist ); this.PlaySound( 0x1E0 ); // Cure spell effect. this.PlaySound( 0xA9 ); // Unicorn's whinny. mount.NextMountAbility = DateTime.Now + mount.MountAbilityDelay; return true; } } else if ( mount is Kirin ) { if ( ( attacker == null ) || ( attacker == this ) ) return false; // For a Ki-rin to cast a lightning bolt, its rider must have less than 30 hps. if ( this.Hits >= 30 ) return false; // Enforce the ability delay. if ( DateTime.Now < mount.NextMountAbility ) return false; // Lightning effect. attacker.BoltEffect( 0 ); // 35~100 damage, unresistable, by the Ki-rin. attacker.Damage( Utility.RandomMinMax( 35, 100 ), (BaseCreature)mount ); this.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1042534 ); // Your mount calls down the forces of nature on your opponent. this.FixedParticles( 0, 0, 0, 0x13A7, EffectLayer.Waist ); this.PlaySound( 0x29 ); // Thunder sound this.PlaySound( 0xA9 ); // Ki-rin's whinny. mount.NextMountAbility = DateTime.Now + mount.MountAbilityDelay; return true; } return false; }
codice:
using System;
codice:
private DateTime m_NextMountAbility;
codice:
public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.Write( (int) 1 ); // version writer.Write( m_Rider ); writer.Write( m_InternalItem ); writer.Write( m_NextMountAbility ); }
codice:
public virtual TimeSpan MountAbilityDelay { get{ return TimeSpan.Zero; } } [CommandProperty( AccessLevel.GameMaster )] public DateTime NextMountAbility { get{ return m_NextMountAbility; } set{ m_NextMountAbility = value; } }
codice:
case 1: { m_Rider = reader.ReadMobile(); m_InternalItem = reader.ReadItem(); m_NextMountAbility = reader.ReadDateTime(); if ( m_InternalItem == null ) Delete(); break; }
codice:
public override TimeSpan MountAbilityDelay{ get{ return TimeSpan.FromHours( 1.0 ); } }
Commenta