Guest User

Untitled

a guest
Jul 17th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.71 KB | None | 0 0
  1. using System;
  2. using Server.Mobiles;
  3. using Server.Network;
  4.  
  5. namespace Server.Mobiles
  6. {
  7. [CorpseName( "a unicorn corpse" )]
  8. public class UnicornNHR : BaseMount
  9. {
  10. public override bool AllowMaleRider{ get{ return true; } }
  11. public override bool AllowMaleTamer{ get{ return true; } }
  12.  
  13. public override bool InitialInnocent{ get{ return true; } }
  14.  
  15. public override TimeSpan MountAbilityDelay { get { return TimeSpan.FromHours( 1.0 ); } }
  16.  
  17. public override void OnDisallowedRider( Mobile m )
  18. {
  19. m.SendLocalizedMessage( 1042318 ); // The unicorn refuses to allow you to ride it.
  20. }
  21.  
  22. public override bool DoMountAbility( int damage, Mobile attacker )
  23. {
  24. if( Rider == null || attacker == null ) //sanity
  25. return false;
  26.  
  27. if( Rider.Poisoned && ((Rider.Hits - damage) < 40) )
  28. {
  29. Poison p = Rider.Poison;
  30.  
  31. if( p != null )
  32. {
  33. int chanceToCure = 10000 + (int)(this.Skills[SkillName.Magery].Value * 75) - ((p.Level + 1) * (Core.AOS ? (p.Level < 4 ? 3300 : 3100) : 1750));
  34. chanceToCure /= 100;
  35.  
  36. if( chanceToCure > Utility.Random( 100 ) )
  37. {
  38. if( Rider.CurePoison( this ) ) //TODO: Confirm if mount is the one flagged for curing it or the rider is
  39. {
  40. Rider.LocalOverheadMessage( Server.Network.MessageType.Regular, 0x3B2, true, "Your mount senses you are in danger and aids you with magic." );
  41. Rider.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
  42. Rider.PlaySound( 0x1E0 ); // Cure spell effect.
  43. Rider.PlaySound( 0xA9 ); // Unicorn's whinny.
  44.  
  45. return true;
  46. }
  47. }
  48. }
  49. }
  50.  
  51. return false;
  52. }
  53.  
  54. [Constructable]
  55. public UnicornNHR() : this( "a unicorn" )
  56. {
  57. }
  58.  
  59. [Constructable]
  60. public UnicornNHR( string name ) : base( name, 339, 0x3EBF, AIType.AI_Mage, FightMode.Evil, 10, 1, 0.2, 0.4 )//0x25ce
  61. {
  62. Hue = 0x80C;
  63. BaseSoundID = 0x4BC;
  64.  
  65. SetStr( 296, 325 );
  66. SetDex( 96, 115 );
  67. SetInt( 186, 225 );
  68.  
  69. SetHits( 191, 210 );
  70.  
  71. SetDamage( 16, 22 );
  72.  
  73. SetDamageType( ResistanceType.Physical, 75 );
  74. SetDamageType( ResistanceType.Energy, 25 );
  75.  
  76. SetResistance( ResistanceType.Physical, 55, 65 );
  77. SetResistance( ResistanceType.Fire, 25, 40 );
  78. SetResistance( ResistanceType.Cold, 25, 40 );
  79. SetResistance( ResistanceType.Poison, 55, 65 );
  80. SetResistance( ResistanceType.Energy, 25, 40 );
  81.  
  82. SetSkill( SkillName.EvalInt, 80.1, 90.0 );
  83. SetSkill( SkillName.Magery, 60.2, 80.0 );
  84. SetSkill( SkillName.Meditation, 50.1, 60.0 );
  85. SetSkill( SkillName.MagicResist, 75.3, 90.0 );
  86. SetSkill( SkillName.Tactics, 20.1, 22.5 );
  87. SetSkill( SkillName.Wrestling, 80.5, 92.5 );
  88.  
  89. Fame = 9000;
  90. Karma = 9000;
  91.  
  92. Tamable = true;
  93. ControlSlots = 2;
  94. MinTameSkill = 95.1;
  95. }
  96.  
  97. public override void GenerateLoot()
  98. {
  99. AddLoot( LootPack.Rich );
  100. AddLoot( LootPack.LowScrolls );
  101. AddLoot( LootPack.Potions );
  102. }
  103.  
  104. public override OppositionGroup OppositionGroup
  105. {
  106. get{ return OppositionGroup.FeyAndUndead; }
  107. }
  108.  
  109. public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
  110. public override int Meat{ get{ return 3; } }
  111. public override int Hides{ get{ return 10; } }
  112. public override HideType HideType{ get{ return HideType.Horned; } }
  113. public override FoodType FavoriteFood{ get{ return FoodType.FruitsAndVegies | FoodType.GrainsAndHay; } }
  114.  
  115. public UnicornNHR(Serial serial)
  116. : base(serial)
  117. {
  118. }
  119.  
  120. public override void Serialize( GenericWriter writer )
  121. {
  122. base.Serialize( writer );
  123.  
  124. writer.Write( (int) 0 ); // version
  125. }
  126.  
  127. public override void Deserialize( GenericReader reader )
  128. {
  129. base.Deserialize( reader );
  130.  
  131. int version = reader.ReadInt();
  132. }
  133. }
  134. }
Add Comment
Please, Sign In to add comment