public FamousPiratesMace() : base(AIType.AI_Melee, FightMode.Closest, 15, 1, 0.9, 0.9) { int Hue = 2075; // Skills and Stats this.InitStats(350, 350, 310); this.Skills[SkillName.Macing].Base = 150; this.Skills[SkillName.Anatomy].Base = 150; this.Skills[SkillName.Healing].Base = 150; this.Skills[SkillName.Tactics].Base = 150; // Name this.Name = "Captain Hector Barbossa"; // Equip WarHammer war = new WarHammer(); war.Movable = true; war.Crafter = this; war.Quality = WeaponQuality.Exceptional; AddItem(war); Boots bts = new Boots(); bts.Movable = false; bts.Hue = Hue; AddItem(bts); ChainChest cht = new ChainChest(); cht.Movable = false; cht.LootType = LootType.Regular; cht.Crafter = this; cht.Quality = ArmorQuality.Exceptional; AddItem(cht); ChainLegs chl = new ChainLegs(); chl.Movable = false; chl.LootType = LootType.Regular; chl.Crafter = this; chl.Quality = ArmorQuality.Exceptional; AddItem(chl); PlateArms pla = new PlateArms(); pla.Movable = false; pla.LootType = LootType.Regular; pla.Crafter = this; pla.Quality = ArmorQuality.Exceptional; AddItem(pla); TricorneHat tch = new TricorneHat(); tch.Movable = false; tch.Hue = Hue; AddItem(tch); Bandage band = new Bandage(20); AddToBackpack(band); }
public bool Scissor( Mobile from, Scissors scissors ) { if ( Deleted || !from.CanSee( this ) ) return false; //base.ScissorHelper( from, new Bandage(), 1 ); this.Consume( 1 ); Bandage give = new Bandage(); give.Hue = this.Hue; from.AddToBackpack( give ); return true; }
public ArmyBaseMace(int Team) : base(Team, AIType.AI_Melee, FightMode.Closest, 15, 1, 0.2, 0.6) { // An ArmyBase Hammerman int iHue = 20 + Team * 40; int jHue = 25 + Team * 40; // Skills and Stats this.InitStats((90 + Utility.Random(35)), (90 + Utility.Random(35)), (75 + Utility.Random(15))); this.Skills[SkillName.Macing].Base = (90 + Utility.Random(30)); this.Skills[SkillName.Anatomy].Base = (90 + Utility.Random(30)); this.Skills[SkillName.Healing].Base = (90 + Utility.Random(30)); this.Skills[SkillName.Tactics].Base = (90 + Utility.Random(30)); // Name this.Name = "Hammerman"; // Equip WarHammer war = new WarHammer(); war.Movable = true; war.Crafter = this; war.Quality = WeaponQuality.Regular; AddItem( war ); Boots bts = new Boots(); bts.Hue = iHue; AddItem( bts ); ChainChest cht = new ChainChest(); cht.Movable = false; cht.LootType = LootType.Newbied; cht.Crafter = this; cht.Quality = ArmorQuality.Regular; AddItem( cht ); ChainLegs chl = new ChainLegs(); chl.Movable = false; chl.LootType = LootType.Newbied; chl.Crafter = this; chl.Quality = ArmorQuality.Regular; AddItem( chl ); PlateArms pla = new PlateArms(); pla.Movable = false; pla.LootType = LootType.Newbied; pla.Crafter = this; pla.Quality = ArmorQuality.Regular; AddItem( pla ); Bandage band = new Bandage( 50 ); AddToBackpack( band ); }
public DummyMace() : base( AIType.AI_SphereMelee, FightMode.Closest, 15, 1, 0.2, 0.6) { // A Dummy Macer int iHue = 20 + Team * 40; int jHue = 25 + Team * 40; // Skills and Stats InitStats( 125, 125, 90 ); Skills[SkillName.Macing].Base = 120; Skills[SkillName.Anatomy].Base = 120; Skills[SkillName.Healing].Base = 120; Skills[SkillName.Tactics].Base = 120; // Name Name = "Macer"; // Equip WarHammer war = new WarHammer(); war.Movable = true; war.Crafter = this; war.Quality = WeaponQuality.Regular; AddItem( war ); Boots bts = new Boots(); bts.Hue = iHue; AddItem( bts ); ChainChest cht = new ChainChest(); cht.Movable = false; cht.LootType = LootType.Newbied; cht.Crafter = this; cht.Quality = ArmorQuality.Regular; AddItem( cht ); ChainLegs chl = new ChainLegs(); chl.Movable = false; chl.LootType = LootType.Newbied; chl.Crafter = this; chl.Quality = ArmorQuality.Regular; AddItem( chl ); PlateArms pla = new PlateArms(); pla.Movable = false; pla.LootType = LootType.Newbied; pla.Crafter = this; pla.Quality = ArmorQuality.Regular; AddItem( pla ); Bandage band = new Bandage( 50 ); AddToBackpack( band ); }
public override void GiveRewards() { //Random gold amount to add BankCheck gold = new BankCheck( Utility.RandomMinMax( 200, 300 ) ); if( !Owner.AddToBackpack( gold ) ) { gold.MoveToWorld(Owner.Location,Owner.Map); } //Adding Quest Reward Token(s) for(int x = 0; x < 1; x++) { RandomTalisman talisman = new RandomTalisman(); if(!Owner.AddToBackpack( talisman ) ) { talisman.MoveToWorld(Owner.Location,Owner.Map); } } Item bonusitem; bonusitem = new Bandage( 10 ); //Adding Bonus Item #1 if(!Owner.AddToBackpack( bonusitem ) ) { bonusitem.MoveToWorld(Owner.Location,Owner.Map); } Item item; //Add Reward Item #1 item = new AdventurersMachete(); if( item is BaseWeapon ) BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, Utility.RandomMinMax( 1,4 ), 10, 50 ); if( item is BaseArmor ) BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax( 1,4 ), 10, 50 ); if( item is BaseJewel ) BaseRunicTool.ApplyAttributesTo((BaseJewel)item, Utility.RandomMinMax( 1,4 ), 10, 50 ); if( item is BaseHat ) BaseRunicTool.ApplyAttributesTo((BaseHat)item, Utility.RandomMinMax( 1,4 ), 10, 50 ); if(!Owner.AddToBackpack( item ) ) { item.MoveToWorld(Owner.Location,Owner.Map); } base.GiveRewards(); }
public void EndHeal(Bandage origin) { StopHeal(); if (m_Healer is PlayerMobile) { ((PlayerMobile)m_Healer).WeaponTimerCheck(); } int healerNumber = -1; int patientNumber = -1; bool checkSkills = false; SkillName primarySkill = GetPrimarySkill(m_Patient); SkillName secondarySkill = GetSecondarySkill(m_Patient); BaseCreature petPatient = m_Patient as BaseCreature; if (!m_Healer.Alive) { healerNumber = 500962; // You were unable to finish your work before you died. } else if (m_Healer.Paralyzed) { m_Healer.SendAsciiMessage("You were unable to finish your work before you got paralyzed"); return; } else if (!m_Healer.InRange(m_Patient, Bandage.Range)) { healerNumber = 500963; // You did not stay close enough to heal your target. } else if (!m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet)) { double healing = m_Healer.Skills[primarySkill].Value; double anatomy = m_Healer.Skills[secondarySkill].Value; double chance = ((healing - 68.0) / 50.0) - (m_Slips * 0.02); if (((checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble()) || (Core.SE && petPatient is FactionWarHorse && petPatient.ControlMaster == m_Healer)) //TODO: Dbl check doesn't check for faction of the horse here? { if (m_Patient.Map == null || !m_Patient.Map.CanFit(m_Patient.Location, 16, false, false)) { healerNumber = 501042; // Target can not be resurrected at that location. } else if (m_Patient.Region != null && m_Patient.Region.IsPartOf("Khaldun")) { healerNumber = 1010395; // The veil of death in this area is too strong and resists thy efforts to restore life. } else { healerNumber = 500965; // You are able to resurrect your patient. m_Patient.FixedEffect(0x376A, 10, 16); if (petPatient != null && petPatient.IsDeadPet) { Mobile master = petPatient.ControlMaster; if (master != null && m_Healer == master) { petPatient.ResurrectPet(); for (int i = 0; i < petPatient.Skills.Length; ++i) { petPatient.Skills[i].Base -= 0.1; } } else if (master != null && master.InRange(petPatient, 3)) { healerNumber = 503255; // You are able to resurrect the creature. master.CloseGump(typeof(PetResurrectGump)); master.SendGump(new PetResurrectGump(m_Healer, petPatient)); } else { bool found = false; List <Mobile> friends = petPatient.Friends; for (int i = 0; friends != null && i < friends.Count; ++i) { Mobile friend = friends[i]; if (friend.InRange(petPatient, 3)) { healerNumber = 503255; // You are able to resurrect the creature. friend.CloseGump(typeof(PetResurrectGump)); friend.SendGump(new PetResurrectGump(m_Healer, petPatient)); found = true; break; } } if (!found) { healerNumber = 1049670; // The pet's owner must be nearby to attempt resurrection. } } } else { m_Patient.CloseGump(typeof(ResurrectGump)); m_Patient.SendGump(new ResurrectGump(m_Patient, m_Healer)); } } } else { if (petPatient != null && petPatient.IsDeadPet) { healerNumber = 503256; // You fail to resurrect the creature. } else { healerNumber = 500966; // You are unable to resurrect your patient. } } } else if (m_Patient.Poisoned) { m_Healer.SendLocalizedMessage(500969); // You finish applying the bandages. double healing = m_Healer.Skills[primarySkill].Value; double anatomy = m_Healer.Skills[secondarySkill].Value; double chance = ((healing - 40.0) / 50.0) - (m_Patient.Poison.Level * 0.11) - (m_Slips * 0.02); if ((checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble()) { if (m_Patient.CurePoison(m_Healer)) { healerNumber = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons. patientNumber = 1010059; // You have been cured of all poisons. } else { healerNumber = -1; patientNumber = -1; } } else { healerNumber = 1010060; // You have failed to cure your target! patientNumber = -1; } } else if (BleedAttack.IsBleeding(m_Patient)) { BleedAttack.EndBleed(m_Patient, false); } else if (MortalStrike.IsWounded(m_Patient)) { healerNumber = (m_Healer == m_Patient ? 1005000 : 1010398); } else if (m_Patient.Hits == m_Patient.HitsMax) { healerNumber = 500967; // You heal what little damage your patient had. } else { checkSkills = true; patientNumber = -1; Bandage bandage = null; if (origin.Parent == null && !origin.Deleted) { origin.Consume(1); } else if ((bandage = m_Healer.Backpack.FindItemByType(typeof(Bandage), true) as Bandage) == null) { m_Healer.SendAsciiMessage("You don't have any bandages."); return; } else { bandage.Consume(1); } double healing = m_Healer.Skills[primarySkill].Base; double anatomy = m_Healer.Skills[secondarySkill].Base; //Loki edit: Dexterity improves healing chance double chance = (healing / 100.0) * (0.91 + (((double)m_Healer.RawDex - 80.0) / 1000.0)); if (chance > Utility.RandomDouble()) { double min, max; min = 0.04 * ((anatomy / 4.0) + (healing / 4.0)); max = ((anatomy / 4.0) + (healing / 4.0)) - 4; //Loki edit: Bonus from dexterity double dexbonus = ((double)m_Healer.RawDex - 80.0) / 10.0; min += dexbonus; max += dexbonus / 2; if (max < 2) { max = 2; } double toHeal = Utility.RandomMinMax((int)min, (int)max); if (toHeal < 1) { toHeal = 1; healerNumber = 500968; // You apply the bandages, but they barely help. } else if ((!origin.Deleted && (!origin.EventItem || (origin.EventItem && origin.EventItemConsume))) || (bandage != null && (!bandage.EventItem || (bandage.EventItem && bandage.EventItemConsume)))) { Item item = new BloodyBandage(); if (origin.EventItem || (bandage != null && bandage.EventItem)) { item.EventItem = true; item.Hue = origin.Hue; item.Name = "event Bloody bandage"; } Mobile from = m_Healer; if (from.AddToBackpack(item)) { from.SendAsciiMessage("You put the {0} in your pack.", item.Name ?? CliLoc.LocToString(item.LabelNumber)); } else //Taran: Bloody bandages stack on ground if the player is overweight { from.SendAsciiMessage("You are overweight and put the {0} on the ground.", item.Name ?? CliLoc.LocToString(item.LabelNumber)); IPooledEnumerable eable = from.Map.GetItemsInRange(from.Location, 0); foreach (Item i in eable) { if (i is BloodyBandage) { if (i.Serial != item.Serial) { i.Amount++; item.Delete(); } break; } } eable.Free(); } } else if (!origin.Deleted && (origin.EventItem && !origin.EventItemConsume)) { Mobile from = m_Healer; from.PlaySound(0x57); from.SendAsciiMessage("You are able to re-use your bandage and put it in your pack."); } //m_Patient.Heal( (int)toHeal ); //Rev ~ 140 update m_Patient.Heal((int)toHeal, m_Healer, false); } else { healerNumber = 500968; // You apply the bandages, but they barely help. } m_Healer.CheckSkill(secondarySkill, 0.0, 120.0); m_Healer.CheckSkill(primarySkill, 0.0, 120.0); } if (healerNumber != -1) { m_Healer.SendAsciiMessage(CliLoc.LocToString(healerNumber)); } if (patientNumber != -1) { m_Patient.SendLocalizedMessage(patientNumber); } if (checkSkills) { m_Healer.CheckSkill(secondarySkill, 0.0, 100.0); m_Healer.CheckSkill(primarySkill, 0.0, 100.0); } }
public DummyFence() : base(AIType.AI_Melee, FightMode.Closest, 15, 1, 0.2, 0.6) { // A Dummy Fencer int iHue = 20 + Team * 40; int jHue = 25 + Team * 40; // Skills and Stats this.InitStats( 125, 125, 90 ); this.Skills[SkillName.Fencing].Base = 120; this.Skills[SkillName.Anatomy].Base = 120; this.Skills[SkillName.Healing].Base = 120; this.Skills[SkillName.Tactics].Base = 120; // Name this.Name = "Fencer"; // Equip Spear ssp = new Spear(); ssp.Movable = true; ssp.Crafter = this; ssp.Quality = WeaponQuality.Regular; AddItem( ssp ); Boots snd = new Boots(); snd.Hue = iHue; snd.LootType = LootType.Newbied; AddItem( snd ); ChainChest cht = new ChainChest(); cht.Movable = false; cht.LootType = LootType.Newbied; cht.Crafter = this; cht.Quality = ArmorQuality.Regular; AddItem( cht ); ChainLegs chl = new ChainLegs(); chl.Movable = false; chl.LootType = LootType.Newbied; chl.Crafter = this; chl.Quality = ArmorQuality.Regular; AddItem( chl ); PlateArms pla = new PlateArms(); pla.Movable = false; pla.LootType = LootType.Newbied; pla.Crafter = this; pla.Quality = ArmorQuality.Regular; AddItem( pla ); Bandage band = new Bandage( 50 ); AddToBackpack( band ); }
public static BandageContext BeginHeal(Mobile healer, Mobile patient, Bandage bandage) { bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet); if (patient is BaseCreature && ((BaseCreature)patient).IsGolem) { // Bandages cannot be used on that. healer.SendLocalizedMessage(500970); } else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead) { // You cannot heal that. healer.SendLocalizedMessage(500951); } else if (!patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet) { // That being is not damaged! healer.SendLocalizedMessage(500955); } else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false))) { // Target cannot be resurrected at that location. healer.SendLocalizedMessage(501042); } else if (healer.CanBeBeneficial(patient, true, true)) { healer.DoBeneficial(patient); bool onSelf = (healer == patient); int dex = healer.Dex; double seconds; double resDelay = (patient.Alive ? 0.0 : 5.0); if (onSelf) { seconds = 5 + (0.5 * ((double)(120 - dex) / 10)); // TODO: Verify algorithm } else { if (GetPrimarySkill(patient, healer) == SkillName.Veterinary) { seconds = 2; } else { seconds = 4 - ((double)(dex / 60)) + resDelay; } } if (seconds < 1) { seconds = 1; } if (seconds > 8) { seconds = 8; } BandageContext context = GetContext(healer); if (context != null) { context.RefreshTimer(TimeSpan.FromSeconds(seconds)); } else { m_Table[healer] = context = new BandageContext(healer, patient, TimeSpan.FromSeconds(seconds), bandage); } if (!onSelf) { patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you. } if (healer.NetState != null) { healer.NetState.Send(new CooldownInfo(bandage, (int)seconds)); } BuffInfo.AddBuff(healer, new BuffInfo(BuffIcon.Healing, 1151311, 1151400, TimeSpan.FromSeconds(seconds), healer, patient.Name)); healer.SendLocalizedMessage(500956); // You begin applying the bandages. return(context); } return(null); }
public override void OnDoubleClick( Mobile m ) { if ( m_TalismanType == TalismanType.None ) return; if ( this.Parent != m ) { m.SendLocalizedMessage( 502641 ); // You must equip this item to use it. } else if ( m_ChargeTimeLeft > 0 ) { int tmptime = ( m_ChargeTimeLeft2 - ( DateTime.Now.Second - m_ChargeTimeLeft3.Second ) + 1 ); if ( tmptime > ( m_ChargeTimeLeft2 + 1 ) ) tmptime -= 60; if ( tmptime > m_ChargeTimeLeft2 ) tmptime = m_ChargeTimeLeft2; m.SendLocalizedMessage( 1074882, tmptime.ToString() ); // You must wait ~1_val~ seconds for this to recharge. } else if ( m_Charges == 0 ) { m.SendLocalizedMessage( 501250 ); // This magic item is out of charges. } else { if ( (int) m_TalismanType <= 4 ) { //Removal m.Target = new InternalTarget( this ); } //Mana Phase else if ( m_TalismanType == TalismanType.ManaPhase ) { ManaPhase.OnUse( m, this ); } else if ( (int) m_TalismanType >= 9 ) { //Summon creature BaseCreature bc = (BaseCreature) Activator.CreateInstance( SummonEntry.GetNPC( m_TalismanType ) ); if ( BaseCreature.Summon( bc, m, m.Location, -1, TimeSpan.FromMinutes( 10.0 ) ) ) { bc.FixedParticles( 0x3728, 1, 10, 9910, EffectLayer.Head ); bc.PlaySound( bc.GetIdleSound() ); m_SummonedCreature = bc; m_Charges--; InvalidateProperties(); ChargeTimeLeft = 1800; m_ChargeTimer = new ChargeTimeLeftTimer( this ); m_ChargeTimer.Start(); m_ChargeTimeLeft3 = DateTime.Now; } } else if ( m_TalismanType == TalismanType.SummonRandom ) { //Summon Random TalismanType tmpbc = SummonEntry.GetRandom(); BaseCreature bc = (BaseCreature) Activator.CreateInstance( SummonEntry.GetNPC( tmpbc ) ); if ( BaseCreature.Summon( bc, m, m.Location, -1, TimeSpan.FromMinutes( 10.0 ) ) ) { bc.FixedParticles( 0x3728, 1, 10, 9910, EffectLayer.Head ); bc.PlaySound( bc.GetIdleSound() ); m_SummonedCreature = bc; m_Charges--; InvalidateProperties(); ChargeTimeLeft = 1800; m_ChargeTimer = new ChargeTimeLeftTimer( this ); m_ChargeTimer.Start(); m_ChargeTimeLeft3 = DateTime.Now; } } else { Item summonitem; int message; // Summon item if ( m_TalismanType == TalismanType.SummonBandage ) { summonitem = new Bandage( 10 ); summonitem.ItemID = 0x0EE9; summonitem.Hue = 0xA3; message = 1075002; // You have been given some clean bandages. } else if ( m_TalismanType == TalismanType.SummonBoard ) { summonitem = new Board( 10 ); summonitem.Hue = 0xA3; message = 1075000; // You have been given some wooden boards. } else// if ( m_TalismanType == TalismanType.SummonIngot ) { summonitem = new IronIngot( 10 ); summonitem.Hue = 0xA3; message = 1075001; // You have been given some ingots. } m.AddToBackpack( summonitem ); m.SendLocalizedMessage( message ); m_Charges--; InvalidateProperties(); ChargeTimeLeft = 60; m_ChargeTimer = new ChargeTimeLeftTimer( this ); m_ChargeTimer.Start(); m_ChargeTimeLeft3 = DateTime.Now; } } }
public InternalTarget(Bandage bandage) : base(GetRange(bandage.Expansion), false, TargetFlags.Beneficial) { m_Bandage = bandage; }
public BandageTarget( Bandage bandage ) : base( Bandage.range, false, TargetFlags.Beneficial ){ m_Bandage = bandage; }
public virtual bool Scissor(Mobile from, Scissors scissors) { if ( !IsChildOf( from.Backpack ) ) { from.SendLocalizedMessage( 502437 ); // Items you wish to cut must be in your backpack. return false; } if ( Ethic.IsImbued( this ) ) { from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything. return false; } CraftSystem system = DefTailoring.CraftSystem; CraftItem item = system.CraftItems.SearchFor( GetType() ); if ( item != null && item.Resources.Count == 1 && item.Resources.GetAt( 0 ).Amount >= 2 ) { try { Type resourceType = null; CraftResourceInfo info = CraftResources.GetInfo( m_Resource ); if ( info != null && info.ResourceTypes.Length > 0 ) resourceType = info.ResourceTypes[0]; if ( resourceType == null ) resourceType = item.Resources.GetAt( 0 ).ItemType; // Debug code //from.SendMessage("item: {0}", Layer); Item res = null; if (Layer == Layer.Shoes) res = new Leather(); else res = new Bandage(); ScissorHelper( from, res, (item.Resources.GetAt( 0 ).Amount / 2) ); res.LootType = LootType.Regular; return true; } catch { } } from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything. return false; }
public void EndHeal( Bandage origin ) { StopHeal(); if( m_Healer is PlayerMobile ) ((PlayerMobile)m_Healer).WeaponTimerCheck(); int healerNumber = -1; int patientNumber = -1; bool checkSkills = false; SkillName primarySkill = GetPrimarySkill( m_Patient ); SkillName secondarySkill = GetSecondarySkill( m_Patient ); BaseCreature petPatient = m_Patient as BaseCreature; if( !m_Healer.Alive ) healerNumber = 500962; // You were unable to finish your work before you died. else if (m_Healer.Paralyzed) { m_Healer.SendAsciiMessage("You were unable to finish your work before you got paralyzed"); return; } else if( !m_Healer.InRange( m_Patient, Bandage.Range ) ) healerNumber = 500963; // You did not stay close enough to heal your target. else if( !m_Patient.Alive || ( petPatient != null && petPatient.IsDeadPet ) ) { double healing = m_Healer.Skills[primarySkill].Value; double anatomy = m_Healer.Skills[secondarySkill].Value; double chance = ( ( healing - 68.0 ) / 50.0 ) - ( m_Slips * 0.02 ); if( ( ( checkSkills = ( healing >= 80.0 && anatomy >= 80.0 ) ) && chance > Utility.RandomDouble() ) || ( Core.SE && petPatient is FactionWarHorse && petPatient.ControlMaster == m_Healer ) ) //TODO: Dbl check doesn't check for faction of the horse here? { if( m_Patient.Map == null || !m_Patient.Map.CanFit( m_Patient.Location, 16, false, false ) ) healerNumber = 501042; // Target can not be resurrected at that location. else if( m_Patient.Region != null && m_Patient.Region.IsPartOf( "Khaldun" ) ) { healerNumber = 1010395; // The veil of death in this area is too strong and resists thy efforts to restore life. } else { healerNumber = 500965; // You are able to resurrect your patient. m_Patient.FixedEffect( 0x376A, 10, 16 ); if( petPatient != null && petPatient.IsDeadPet ) { Mobile master = petPatient.ControlMaster; if (master != null && m_Healer == master) { petPatient.ResurrectPet(); for (int i = 0; i < petPatient.Skills.Length; ++i) { petPatient.Skills[i].Base -= 0.1; } } else if (master != null && master.InRange(petPatient, 3)) { healerNumber = 503255; // You are able to resurrect the creature. master.CloseGump( typeof( PetResurrectGump ) ); master.SendGump( new PetResurrectGump( m_Healer, petPatient ) ); } else { bool found = false; List<Mobile> friends = petPatient.Friends; for( int i = 0; friends != null && i < friends.Count; ++i ) { Mobile friend = friends[i]; if( friend.InRange( petPatient, 3 ) ) { healerNumber = 503255; // You are able to resurrect the creature. friend.CloseGump( typeof( PetResurrectGump ) ); friend.SendGump( new PetResurrectGump( m_Healer, petPatient ) ); found = true; break; } } if( !found ) healerNumber = 1049670; // The pet's owner must be nearby to attempt resurrection. } } else { m_Patient.CloseGump( typeof( ResurrectGump ) ); m_Patient.SendGump( new ResurrectGump( m_Patient, m_Healer ) ); } } } else { if( petPatient != null && petPatient.IsDeadPet ) healerNumber = 503256; // You fail to resurrect the creature. else healerNumber = 500966; // You are unable to resurrect your patient. } } else if (m_Patient.Poisoned) { m_Healer.SendLocalizedMessage(500969); // You finish applying the bandages. double healing = m_Healer.Skills[primarySkill].Value; double anatomy = m_Healer.Skills[secondarySkill].Value; double chance = ((healing - 40.0) / 50.0) - (m_Patient.Poison.Level * 0.11) - (m_Slips * 0.02); if ((checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble()) { if (m_Patient.CurePoison(m_Healer)) { healerNumber = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons. patientNumber = 1010059; // You have been cured of all poisons. } else { healerNumber = -1; patientNumber = -1; } } else { healerNumber = 1010060; // You have failed to cure your target! patientNumber = -1; } } else if( BleedAttack.IsBleeding( m_Patient ) ) BleedAttack.EndBleed( m_Patient, false ); else if( MortalStrike.IsWounded( m_Patient ) ) healerNumber = ( m_Healer == m_Patient ? 1005000 : 1010398 ); else if( m_Patient.Hits == m_Patient.HitsMax ) healerNumber = 500967; // You heal what little damage your patient had. else { checkSkills = true; patientNumber = -1; Bandage bandage = null; if( origin.Parent == null && !origin.Deleted ) origin.Consume( 1 ); else if( ( bandage = m_Healer.Backpack.FindItemByType( typeof( Bandage ), true ) as Bandage ) == null ) { m_Healer.SendAsciiMessage( "You don't have any bandages." ); return; } else bandage.Consume( 1 ); double healing = m_Healer.Skills[primarySkill].Base; double anatomy = m_Healer.Skills[secondarySkill].Base; //Loki edit: Dexterity improves healing chance double chance = (healing/100.0) * (0.91 + (((double)m_Healer.RawDex - 80.0) / 1000.0)); if( chance > Utility.RandomDouble() ) { double min, max; min = 0.04 * ( ( anatomy / 4.0 ) + ( healing / 4.0 ) ); max = ( ( anatomy / 4.0 ) + ( healing / 4.0 ) ) - 4; //Loki edit: Bonus from dexterity double dexbonus = ((double)m_Healer.RawDex - 80.0) / 10.0; min += dexbonus; max += dexbonus / 2; if( max < 2 ) max = 2; double toHeal = Utility.RandomMinMax( (int)min, (int)max ); if( toHeal < 1 ) { toHeal = 1; healerNumber = 500968; // You apply the bandages, but they barely help. } else if( ( !origin.Deleted && (!origin.EventItem || (origin.EventItem && origin.EventItemConsume)) ) || ( bandage != null && (!bandage.EventItem || (bandage.EventItem && bandage.EventItemConsume)) ) ) { Item item = new BloodyBandage(); if (origin.EventItem || (bandage != null && bandage.EventItem)) { item.EventItem = true; item.Hue = origin.Hue; item.Name = "event Bloody bandage"; } Mobile from = m_Healer; if (from.AddToBackpack(item)) { from.SendAsciiMessage("You put the {0} in your pack.", item.Name ?? CliLoc.LocToString(item.LabelNumber)); } else //Taran: Bloody bandages stack on ground if the player is overweight { from.SendAsciiMessage("You are overweight and put the {0} on the ground.", item.Name ?? CliLoc.LocToString(item.LabelNumber)); IPooledEnumerable eable = from.Map.GetItemsInRange(from.Location, 0); foreach (Item i in eable) { if (i is BloodyBandage) { if (i.Serial != item.Serial) { i.Amount++; item.Delete(); } break; } } eable.Free(); } } else if ( !origin.Deleted && (origin.EventItem && !origin.EventItemConsume)) { Mobile from = m_Healer; from.PlaySound(0x57); from.SendAsciiMessage("You are able to re-use your bandage and put it in your pack."); } //m_Patient.Heal( (int)toHeal ); //Rev ~ 140 update m_Patient.Heal((int)toHeal, m_Healer, false); } else healerNumber = 500968; // You apply the bandages, but they barely help. m_Healer.CheckSkill( secondarySkill, 0.0, 120.0 ); m_Healer.CheckSkill( primarySkill, 0.0, 120.0 ); } if( healerNumber != -1 ) m_Healer.SendAsciiMessage( CliLoc.LocToString( healerNumber ) ); if (patientNumber != -1) m_Patient.SendLocalizedMessage(patientNumber); if (checkSkills) { m_Healer.CheckSkill(secondarySkill, 0.0, 100.0); m_Healer.CheckSkill(primarySkill, 0.0, 100.0); } }
public BandageContext( Mobile healer, Mobile patient, TimeSpan delay, Bandage origin ) { m_Healer = healer; m_Patient = patient; if( m_Patient != null && !m_Patient.Alive ) { if( m_Healer.Skills[SkillName.Anatomy].Base < 100.0 || m_Healer.Skills[SkillName.Healing].Base < 100.0 ) { if( m_Healer.Skills[SkillName.Anatomy].Base < 100.0 && m_Healer.Skills[SkillName.Healing].Base < 100.0 ) { m_Healer.SendAsciiMessage( "You need GM healing and anatomy to resurrect your target." ); return; } else if( m_Healer.Skills[SkillName.Anatomy].Base < 100.0 ) { m_Healer.SendAsciiMessage( "You need GM anatomy to resurrect your target." ); return; } else if( m_Healer.Skills[SkillName.Healing].Base < 100.0 ) { m_Healer.SendAsciiMessage( "You need GM healing to resurrect your target." ); return; } } if( m_Healer.Hits <= 50 ) { m_Healer.SendAsciiMessage( "You need to have more than 50 hp to resurrect your target" ); return; } if( m_Patient.Region is HouseRegion ) { m_Healer.SendAsciiMessage( "You can't resurrect people in house regions." ); //Server.Multis.BaseHouse patientHouse = (m_Patient.Region as HouseRegion).House; ////The owner can resurrect who ever he wants. //if (patientHouse.IsOwner(m_Healer) || patientHouse.IsCoOwner(m_Healer)) //{ // m_Patient.Resurrect(); // m_Patient.Hits = 10; // m_Healer.PublicOverheadMessage(MessageType.Regular, 0x22, true, "*You see " + m_Healer.Name + " resurrecting " + m_Patient.Name + "*"); // m_Healer.Hits -= 50; //} ////The patient can be ressed by anoyone as long as he is an owner, co owner or friend //else if (patientHouse.IsOwner(m_Patient) || patientHouse.IsCoOwner(m_Patient) || patientHouse.IsFriend(m_Patient)) //{ // m_Patient.Resurrect(); // m_Patient.Hits = 10; // m_Healer.PublicOverheadMessage(MessageType.Regular, 0x22, true, "*You see " + m_Healer.Name + " resurrecting " + m_Patient.Name + "*"); // m_Healer.Hits -= 50; //} //else //{ // m_Patient.SendAsciiMessage("You cannot be resurrected in this region!"); // m_Healer.SendAsciiMessage("You cannot resurrect in this region!"); //} } else { m_Patient.PlaySound( 0x214 ); m_Patient.Resurrect(); m_Patient.Hits = 10; m_Healer.PublicOverheadMessage( MessageType.Regular, 0x22, true, "*You see " + m_Healer.Name + " resurrecting " + m_Patient.Name + "*" ); m_Healer.Hits -= 50; origin.Consume(1); } } else { m_Timer = new InternalTimer( this, delay, origin ); m_Timer.Start(); } }
public InternalTarget(Bandage bandage) : base(Bandage.Range, false, TargetFlags.Beneficial) { m_Bandage = bandage; }
public virtual void Fill() { Reset(); List <Item> contains = new List <Item>(Items); foreach (var i in contains) { i.Delete(); } ColUtility.Free(contains); for (int i = 0; i < Utility.RandomMinMax(6, 12); i++) { DropItem(Loot.RandomGem()); } DropItem(new Gold(Utility.RandomMinMax(800, 1100))); Item item = null; if (0.30 > Utility.RandomDouble()) { switch (Utility.Random(4)) { case 0: item = new Bandage(Utility.Random(10, 30)); break; case 1: item = new SmokeBomb(Utility.Random(3, 6)); break; case 2: item = new InvisibilityPotion(Utility.Random(1, 3)); break; case 3: item = new Lockpick(Utility.Random(1, 10)); break; case 4: item = new DreadHornMane(Utility.Random(1, 2)); break; case 5: item = new Corruption(Utility.Random(1, 2)); break; case 6: item = new Taint(Utility.Random(1, 2)); break; } DropItem(item); } if (0.25 > Utility.RandomDouble()) { DropItem(new CounterfeitPlatinum()); } if (0.2 > Utility.RandomDouble()) { switch (Utility.Random(3)) { case 0: item = new ZombiePainting(); break; case 1: item = new SkeletonPortrait(); break; case 2: item = new LichPainting(); break; } DropItem(item); } if (0.1 > Utility.RandomDouble()) { item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(LootPackEntry.IsInTokuno(this), LootPackEntry.IsMondain(this), LootPackEntry.IsStygian(this)); if (item != null) { int min, max; TreasureMapChest.GetRandomItemStat(out min, out max, 1.0); RunicReforging.GenerateRandomItem(item, null, Utility.RandomMinMax(min, max), 0, ReforgedPrefix.None, ReforgedSuffix.Khaldun, Map); DropItem(item); } } }
public NewPlayerPackage() { Name = "New Player Welcome Package"; Hue = 1281; LootType = LootType.Newbied; /* Spellbook book1 = new Spellbook(); book1.Content = ulong.MaxValue; DropItem(book1); book1.Location = new Point3D(16, 83, 0); BookOfChivalry book2 = new BookOfChivalry(); book2.Content = 1023;//all spells DropItem(book2); book2.Location = new Point3D(33, 83, 0); NecromancerSpellbook book3 = new NecromancerSpellbook(); book3.Content = 0x1FFFF; DropItem(book3); book3.Location = new Point3D(49, 83, 0); */ BaseArmor armor = new LeatherChest(); armor.Hue = 537; armor.LootType = LootType.Newbied; armor.ArmorAttributes.DurabilityBonus = 20; armor.Attributes.LowerManaCost = 2; armor.Attributes.LowerRegCost = 5; armor.Attributes.Luck = 10; armor.Attributes.BonusMana = 3; armor.Attributes.RegenMana = 1; armor.ColdBonus = 1; armor.EnergyBonus = 1; armor.FireBonus = 1; //armor.ArmorRatingBonus = 2; armor.PoisonBonus = 1; DropItem(armor); armor.Location = new Point3D(61, 74, 0); armor = new LeatherLegs(); armor.Hue = 537; armor.LootType = LootType.Newbied; armor.ArmorAttributes.DurabilityBonus = 20; armor.Attributes.RegenHits = 1; armor.Attributes.BonusHits = 3; armor.Attributes.LowerManaCost = 2; armor.Attributes.LowerRegCost = 5; armor.Attributes.Luck = 10; armor.ColdBonus = 1; armor.EnergyBonus = 1; armor.FireBonus = 1; //armor.ArmorRatingBonus = 2; armor.PoisonBonus = 1; DropItem(armor); armor.Location = new Point3D(71, 78, 0); armor = new LeatherArms(); armor.Hue = 537; armor.LootType = LootType.Newbied; armor.ArmorAttributes.DurabilityBonus = 20; armor.Attributes.LowerManaCost = 2; armor.Attributes.LowerRegCost = 5; armor.Attributes.Luck = 10; armor.Attributes.BonusStam = 3; armor.Attributes.RegenStam = 1; armor.ColdBonus = 1; armor.EnergyBonus = 1; armor.FireBonus = 1; //armor.ArmorRatingBonus = 2; armor.PoisonBonus = 1; DropItem(armor); armor.Location = new Point3D(94, 84, 0); armor = new LeatherGloves(); armor.Hue = 537; armor.LootType = LootType.Newbied; armor.ArmorAttributes.DurabilityBonus = 20; armor.Attributes.LowerManaCost = 2; armor.Attributes.LowerRegCost = 5; armor.Attributes.Luck = 10; armor.Attributes.BonusStr = 2; armor.ColdBonus = 1; armor.EnergyBonus = 1; armor.FireBonus = 1; //armor.ArmorRatingBonus = 2; armor.PoisonBonus = 1; DropItem(armor); armor.Location = new Point3D(108, 85, 0); armor = new LeatherGorget(); armor.Hue = 537; armor.LootType = LootType.Newbied; armor.ArmorAttributes.DurabilityBonus = 20; armor.Attributes.LowerManaCost = 2; armor.Attributes.LowerRegCost = 5; armor.Attributes.BonusInt = 2; armor.Attributes.Luck = 10; armor.ColdBonus = 1; armor.EnergyBonus = 1; armor.FireBonus = 1; //armor.ArmorRatingBonus = 2; armor.PoisonBonus = 1; DropItem(armor); armor.Location = new Point3D(122, 79, 0); armor = new LeatherCap(); armor.Hue = 537; armor.LootType = LootType.Newbied; armor.ArmorAttributes.DurabilityBonus = 20; armor.Attributes.BonusDex = 2; armor.Attributes.LowerManaCost = 2; armor.Attributes.LowerRegCost = 5; armor.Attributes.Luck = 10; armor.ColdBonus = 1; armor.EnergyBonus = 1; armor.FireBonus = 1; //armor.ArmorRatingBonus = 2; armor.PoisonBonus = 1; DropItem(armor); armor.Location = new Point3D(115, 88, 0); armor = new MetalShield(); armor.Hue = 537; armor.LootType = LootType.Newbied; armor.ArmorAttributes.DurabilityBonus = 20; armor.Attributes.AttackChance = 5; armor.Attributes.DefendChance = 5; armor.Attributes.SpellChanneling = 1; armor.Attributes.Luck = 10; armor.ColdBonus = 1; armor.EnergyBonus = 1; armor.FireBonus = 1; //armor.ArmorRatingBonus = 2; armor.PoisonBonus = 1; DropItem(armor); armor.Location = new Point3D(132, 85, 0); BaseJewel ring = new GoldRing(); ring.LootType = LootType.Newbied; ring.Attributes.NightSight = 1; ring.Attributes.SpellDamage = 5; ring.Attributes.WeaponDamage = 5; DropItem(ring); ring.Location = new Point3D(140, 60, 0); Item item = new Bandage(100); DropItem(item); item.Location = new Point3D(135, 66, 0); }
public static int UseBandage(BaseCreature from, bool healmaster, Bandage bandage) { if (from.IsDeadPet) return 12; var delay = (500 + (50*((120 - from.Dex)/10)))/100; if (delay < 3) delay = 3; if (from.Controlled && from.ControlMaster != null && from.Hits >= (from.Hits/2) && healmaster) { if (from.InRange(from.ControlMaster, 2) && from.ControlMaster.Alive && from.ControlMaster.Hits < from.ControlMaster.HitsMax) BandageContext.BeginHeal(from, from.ControlMaster, bandage); } else if (from.Hits < from.HitsMax) { BandageContext.BeginHeal(from, from, bandage); } return delay + 3; }
public static BandageContext BeginHeal( Mobile healer, Mobile patient, Bandage bandage ) { bool isDeadPet = ( patient is BaseCreature && ( (BaseCreature) patient ).IsDeadPet ); if ( patient is BaseCreature && ( (BaseCreature) patient ).IsGolem ) { // Bandages cannot be used on that. healer.SendLocalizedMessage( 500970 ); } else if ( patient is BaseCreature && ( (BaseCreature) patient ).IsAnimatedDead ) { // You cannot heal that. healer.SendLocalizedMessage( 500951 ); } else if ( !patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding( patient ) && !isDeadPet ) { // That being is not damaged! healer.SendLocalizedMessage( 500955 ); } else if ( !patient.Alive && ( patient.Map == null || !patient.Map.CanFit( patient.Location, 16, false, false ) ) ) { // Target cannot be resurrected at that location. healer.SendLocalizedMessage( 501042 ); } else if ( healer.CanBeBeneficial( patient, true, true ) ) { healer.DoBeneficial( patient ); bool onSelf = ( healer == patient ); int dex = healer.Dex; double seconds; double resDelay = ( patient.Alive ? 0.0 : 5.0 ); if ( onSelf ) { seconds = 5 + ( 0.5 * ( (double) ( 120 - dex ) / 10 ) ); // TODO: Verify algorithm } else { if ( GetPrimarySkill( patient, healer ) == SkillName.Veterinary ) seconds = 2; else seconds = 4 - ( (double) ( dex / 60 ) ) + resDelay; } if ( seconds < 1 ) seconds = 1; if ( seconds > 8 ) seconds = 8; BandageContext context = GetContext( healer ); if ( context != null ) context.RefreshTimer( TimeSpan.FromSeconds( seconds ) ); else m_Table[healer] = context = new BandageContext( healer, patient, TimeSpan.FromSeconds( seconds ), bandage ); if ( !onSelf ) patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you. if ( healer.Client != null ) healer.Client.Send( new CooldownInfo( bandage, (int) seconds ) ); BuffInfo.AddBuff( healer, new BuffInfo( BuffIcon.Healing, 1151311, 1151400, TimeSpan.FromSeconds( seconds ), healer, patient.Name ) ); healer.SendLocalizedMessage( 500956 ); // You begin applying the bandages. return context; } return null; }
protected override void OnTarget( Mobile from, object targeted ) { if ( m_Item.Deleted ) return; if (m_Item is Dagger && targeted is Dagger && m_Item != targeted) { Dagger m_Hilt = m_Item as Dagger; Dagger m_Blade = targeted as Dagger; DualDaggers weapon = new DualDaggers(); weapon.NewCrafting = true; weapon.QualityDamage = (int)(m_Hilt.QualityDamage * 0.5 + m_Blade.QualityDamage * 0.5); weapon.QualitySpeed = (int)(m_Hilt.QualitySpeed * 0.5 + m_Blade.QualitySpeed * 0.5); weapon.QualityAccuracy = (int)(m_Hilt.QualityAccuracy * 0.5 + m_Blade.QualityAccuracy * 0.5); weapon.QualityDefense = (int)(m_Hilt.QualityDefense * 0.5 + m_Blade.QualityDefense * 0.5); weapon.Resource = m_Hilt.Resource; int quality = (int)(m_Blade.MaxHitPoints * 0.5 + m_Hilt.MaxHitPoints * 0.5); weapon.MaxHitPoints = quality; quality = (int)(m_Blade.HitPoints * 0.5 + m_Hilt.HitPoints * 0.5); weapon.HitPoints = quality; weapon.Crafter = from; weapon.CraftersOriginalName = from.Name; quality = (int)(((int)m_Blade.Quality * 50) * 0.5 + ((int)m_Hilt.Quality * 50) * 0.5); if (quality == 500) weapon.Quality = WeaponQuality.Legendary; if (quality < 500) weapon.Quality = WeaponQuality.Masterwork; if (quality < 450) weapon.Quality = WeaponQuality.Illustrious; if (quality < 400) weapon.Quality = WeaponQuality.Extraordinary; if (quality < 350) weapon.Quality = WeaponQuality.Remarkable; if (quality < 300) weapon.Quality = WeaponQuality.Exceptional; if (quality < 250) weapon.Quality = WeaponQuality.Superior; if (quality < 200) weapon.Quality = WeaponQuality.Regular; if (quality < 150) weapon.Quality = WeaponQuality.Inferior; if (quality < 100) weapon.Quality = WeaponQuality.Low; if (quality < 50) weapon.Quality = WeaponQuality.Poor; weapon.BetaNerf = true; weapon.InvalidateProperties(); from.AddToBackpack(weapon); weapon.AddItem(m_Blade); weapon.AddItem(m_Hilt); } if (m_Item is HandScythe && targeted is HandScythe && m_Item != targeted) { HandScythe m_Hilt = m_Item as HandScythe; HandScythe m_Blade = targeted as HandScythe; DualPicks weapon = new DualPicks(); weapon.NewCrafting = true; weapon.QualityDamage = (int)(m_Hilt.QualityDamage * 0.5 + m_Blade.QualityDamage * 0.5); weapon.QualitySpeed = (int)(m_Hilt.QualitySpeed * 0.5 + m_Blade.QualitySpeed * 0.5); weapon.QualityAccuracy = (int)(m_Hilt.QualityAccuracy * 0.5 + m_Blade.QualityAccuracy * 0.5); weapon.QualityDefense = (int)(m_Hilt.QualityDefense * 0.5 + m_Blade.QualityDefense * 0.5); weapon.Resource = m_Hilt.Resource; int quality = (int)(m_Blade.MaxHitPoints * 0.5 + m_Hilt.MaxHitPoints * 0.5); weapon.MaxHitPoints = quality; quality = (int)(m_Blade.HitPoints * 0.5 + m_Hilt.HitPoints * 0.5); weapon.HitPoints = quality; weapon.Crafter = from; weapon.CraftersOriginalName = from.Name; quality = (int)(((int)m_Blade.Quality * 50) * 0.5 + ((int)m_Hilt.Quality * 50) * 0.5); if (quality == 500) weapon.Quality = WeaponQuality.Legendary; if (quality < 500) weapon.Quality = WeaponQuality.Masterwork; if (quality < 450) weapon.Quality = WeaponQuality.Illustrious; if (quality < 400) weapon.Quality = WeaponQuality.Extraordinary; if (quality < 350) weapon.Quality = WeaponQuality.Remarkable; if (quality < 300) weapon.Quality = WeaponQuality.Exceptional; if (quality < 250) weapon.Quality = WeaponQuality.Superior; if (quality < 200) weapon.Quality = WeaponQuality.Regular; if (quality < 150) weapon.Quality = WeaponQuality.Inferior; if (quality < 100) weapon.Quality = WeaponQuality.Low; if (quality < 50) weapon.Quality = WeaponQuality.Poor; weapon.BetaNerf = true; weapon.InvalidateProperties(); from.AddToBackpack(weapon); weapon.AddItem(m_Blade); weapon.AddItem(m_Hilt); } if (m_Item is Longsword && targeted is Longsword && m_Item != targeted) { Longsword m_Hilt = m_Item as Longsword; Longsword m_Blade = targeted as Longsword; DualSwords weapon = new DualSwords(); weapon.NewCrafting = true; weapon.QualityDamage = (int)(m_Hilt.QualityDamage * 0.5 + m_Blade.QualityDamage * 0.5); weapon.QualitySpeed = (int)(m_Hilt.QualitySpeed * 0.5 + m_Blade.QualitySpeed * 0.5); weapon.QualityAccuracy = (int)(m_Hilt.QualityAccuracy * 0.5 + m_Blade.QualityAccuracy * 0.5); weapon.QualityDefense = (int)(m_Hilt.QualityDefense * 0.5 + m_Blade.QualityDefense * 0.5); weapon.Resource = m_Hilt.Resource; int quality = (int)(m_Blade.MaxHitPoints * 0.5 + m_Hilt.MaxHitPoints * 0.5); weapon.MaxHitPoints = quality; quality = (int)(m_Blade.HitPoints * 0.5 + m_Hilt.HitPoints * 0.5); weapon.HitPoints = quality; weapon.Crafter = from; weapon.CraftersOriginalName = from.Name; quality = (int)(((int)m_Blade.Quality * 50) * 0.5 + ((int)m_Hilt.Quality * 50) * 0.5); if (quality == 500) weapon.Quality = WeaponQuality.Legendary; if (quality < 500) weapon.Quality = WeaponQuality.Masterwork; if (quality < 450) weapon.Quality = WeaponQuality.Illustrious; if (quality < 400) weapon.Quality = WeaponQuality.Extraordinary; if (quality < 350) weapon.Quality = WeaponQuality.Remarkable; if (quality < 300) weapon.Quality = WeaponQuality.Exceptional; if (quality < 250) weapon.Quality = WeaponQuality.Superior; if (quality < 200) weapon.Quality = WeaponQuality.Regular; if (quality < 150) weapon.Quality = WeaponQuality.Inferior; if (quality < 100) weapon.Quality = WeaponQuality.Low; if (quality < 50) weapon.Quality = WeaponQuality.Poor; weapon.BetaNerf = true; weapon.InvalidateProperties(); from.AddToBackpack(weapon); weapon.AddItem(m_Blade); weapon.AddItem(m_Hilt); } if ( targeted is ICarvable ) { ((ICarvable)targeted).Carve( from, m_Item ); } else if ( targeted is BaseClothing && ( (Item)targeted ).IsChildOf( from.Backpack ) ) { BaseClothing clothes = targeted as BaseClothing; Bandage bandage = new Bandage( 2 ); bandage.Amount += Math.Max( 0, (int)clothes.Weight ); bandage.Hue = clothes.Hue; Container pack = from.Backpack; pack.DropItem( bandage ); from.SendMessage( "You rip the garment apart and create some bandages out of it" ); clothes.Delete(); } else { HarvestSystem system = Lumberjacking.System; HarvestDefinition def = Lumberjacking.System.Definition; int tileID; Map map; Point3D loc; if ( !system.GetHarvestDetails( from, m_Item, targeted, out tileID, out map, out loc ) ) { from.SendLocalizedMessage( 500494 ); // You can't use a bladed item on that! } else if ( !def.Validate( tileID ) ) { from.SendLocalizedMessage( 500494 ); // You can't use a bladed item on that! } else { HarvestBank bank = def.GetBank( map, loc.X, loc.Y ); if ( bank == null ) return; if ( bank.Current < 5 ) { from.SendLocalizedMessage( 500493 ); // There's not enough wood here to harvest. } else { bank.Consume( def, 5 ); Item item = new Kindling(); if ( from.PlaceInBackpack( item ) ) { from.SendLocalizedMessage( 500491 ); // You put some kindling into your backpack. from.SendLocalizedMessage( 500492 ); // An axe would probably get you more wood. } else { from.SendLocalizedMessage( 500490 ); // You can't place any kindling into your backpack! item.Delete(); } } } } }
public InternalTimer( BandageContext context, TimeSpan delay, Bandage origin ) : base( delay ) { m_Context = context; Priority = TimerPriority.FiftyMS; m_Origin = origin; //if (context.Healer != context.Patient) // context.Patient.SendAsciiMessage(string.Format("{0} begins to heal you.", context.Healer.Name)); }
public static bool tryToHeal(Mobile healer, Mobile patient, Bandage bandage){ if(patient.Alive && (patient.Hits < patient.HitsMax || patient.Poisoned) ){ if ( healer == patient) patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you. healer.SendLocalizedMessage( 500956 ); // You begin applying the bandages. double finalDelay = new Random().NextDouble()*(Bandage.delayMax-Bandage.delayMin)+Bandage.delayMin; contextTable[healer] = new HealingContext(healer, patient, finalDelay); bandage.Consume(); return true; } return false; }
public static BandageContext BeginHeal( Mobile healer, Mobile patient, Bandage origin ) { bool isDeadPet = ( patient is BaseCreature && ( (BaseCreature)patient ).IsDeadPet ); if( patient is Golem ) { healer.SendLocalizedMessage( 500970 ); // Bandages cannot be used on that. } else if( patient is BaseCreature && ( (BaseCreature)patient ).IsAnimatedDead ) { healer.SendLocalizedMessage( 500951 ); // You cannot heal that. } else if( !patient.Poisoned && patient.Hits >= patient.HitsMax && !BleedAttack.IsBleeding( patient ) && !isDeadPet ) { healer.SendAsciiMessage("That being is not damaged!"); } else if( !patient.Alive && ( patient.Map == null || !patient.Map.CanFit( patient.Location, 16, false, false ) ) ) { healer.SendLocalizedMessage( 501042 ); // Target cannot be resurrected at that location. } else if( healer.CanBeBeneficial( patient, true, true ) ) { //Maka if( healer is PlayerMobile ) ((PlayerMobile)healer).WeaponTimerCheck(); healer.RevealingAction(); if ( patient.Player) healer.DoBeneficial( patient ); bool onSelf = ( healer == patient ); int dex = healer.Dex; //double seconds; double bandageDelay = ( patient.Alive ? 2.5 : 0.0 ); /* if ( onSelf ) { if ( Core.AOS ) seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10)); // TODO: Verify algorithm else seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10)); } else { if ( Core.AOS && GetPrimarySkill( patient ) == SkillName.Veterinary ) { seconds = 2.0; } else if ( Core.AOS ) { if (dex < 204) { seconds = 3.2-(Math.Sin((double)dex/130)*2.5) + resDelay; } else { seconds = 0.7 + resDelay; } } else { if ( dex >= 100 ) seconds = 3.0 + resDelay; else if ( dex >= 40 ) seconds = 4.0 + resDelay; else seconds = 5.0 + resDelay; } } */ BandageContext context = GetContext( healer ); if( context != null ) context.StopHeal(); //seconds *= 1000; //context = new BandageContext(healer, patient, TimeSpan.FromMilliseconds(seconds)); context = new BandageContext( healer, patient, TimeSpan.FromSeconds( bandageDelay ), origin ); m_Table[healer] = context; healer.SendAsciiMessage( string.Format( "You put the clean bandages on the wounded {0}.", patient.Name ) ); return context; } return null; }
public InternalTarget( Bandage bandage ) : base(1, false, TargetFlags.None) { m_Bandage = bandage; }
public static BandageContext BeginHeal(Mobile healer, Mobile patient, Bandage origin) { bool isDeadPet = (patient is BaseCreature && ((BaseCreature)patient).IsDeadPet); if (patient is Golem) { healer.SendLocalizedMessage(500970); // Bandages cannot be used on that. } else if (patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead) { healer.SendLocalizedMessage(500951); // You cannot heal that. } else if (!patient.Poisoned && patient.Hits >= patient.HitsMax && !BleedAttack.IsBleeding(patient) && !isDeadPet) { healer.SendAsciiMessage("That being is not damaged!"); } else if (!patient.Alive && (patient.Map == null || !patient.Map.CanFit(patient.Location, 16, false, false))) { healer.SendLocalizedMessage(501042); // Target cannot be resurrected at that location. } else if (healer.CanBeBeneficial(patient, true, true)) { //Maka if (healer is PlayerMobile) { ((PlayerMobile)healer).WeaponTimerCheck(); } healer.RevealingAction(); if (patient.Player) { healer.DoBeneficial(patient); } bool onSelf = (healer == patient); int dex = healer.Dex; //double seconds; double bandageDelay = (patient.Alive ? 2.5 : 0.0); /* * if ( onSelf ) * { * if ( Core.AOS ) * seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10)); // TODO: Verify algorithm * else * seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10)); * } * else * { * if ( Core.AOS && GetPrimarySkill( patient ) == SkillName.Veterinary ) * { * seconds = 2.0; * } * else if ( Core.AOS ) * { * if (dex < 204) * { * seconds = 3.2-(Math.Sin((double)dex/130)*2.5) + resDelay; * } * else * { * seconds = 0.7 + resDelay; * } * } * else * { * if ( dex >= 100 ) * seconds = 3.0 + resDelay; * else if ( dex >= 40 ) * seconds = 4.0 + resDelay; * else * seconds = 5.0 + resDelay; * } * } */ BandageContext context = GetContext(healer); if (context != null) { context.StopHeal(); } //seconds *= 1000; //context = new BandageContext(healer, patient, TimeSpan.FromMilliseconds(seconds)); context = new BandageContext(healer, patient, TimeSpan.FromSeconds(bandageDelay), origin); m_Table[healer] = context; healer.SendAsciiMessage(string.Format("You put the clean bandages on the wounded {0}.", patient.Name)); return(context); } return(null); }
public DummyAssassin() : base(AIType.AI_Melee, FightMode.Closest, 15, 1, 0.2, 0.6) { // A Dummy Hybrid Assassin int iHue = 20 + Team * 40; int jHue = 25 + Team * 40; // Skills and Stats this.InitStats( 105, 105, 105 ); this.Skills[SkillName.Magery].Base = 120; this.Skills[SkillName.EvalInt].Base = 120; this.Skills[SkillName.Swords].Base = 120; this.Skills[SkillName.Tactics].Base = 120; this.Skills[SkillName.Meditation].Base = 120; this.Skills[SkillName.Poisoning].Base = 100; // Name this.Name = "Hybrid Assassin"; // Equip Spellbook book = new Spellbook(); book.Movable = false; book.LootType = LootType.Newbied; book.Content =0xFFFFFFFFFFFFFFFF; AddToBackpack( book ); Katana kat = new Katana(); kat.Movable = false; kat.LootType = LootType.Newbied; kat.Crafter = this; kat.Poison = Poison.Deadly; kat.PoisonCharges = 12; kat.Quality = WeaponQuality.Regular; AddToBackpack( kat ); LeatherArms lea = new LeatherArms(); lea.Movable = false; lea.LootType = LootType.Newbied; lea.Crafter = this; lea.Quality = ArmorQuality.Regular; AddItem( lea ); LeatherChest lec = new LeatherChest(); lec.Movable = false; lec.LootType = LootType.Newbied; lec.Crafter = this; lec.Quality = ArmorQuality.Regular; AddItem( lec ); LeatherGorget leg = new LeatherGorget(); leg.Movable = false; leg.LootType = LootType.Newbied; leg.Crafter = this; leg.Quality = ArmorQuality.Regular; AddItem( leg ); LeatherLegs lel = new LeatherLegs(); lel.Movable = false; lel.LootType = LootType.Newbied; lel.Crafter = this; lel.Quality = ArmorQuality.Regular; AddItem( lel ); Sandals snd = new Sandals(); snd.Hue = iHue; snd.LootType = LootType.Newbied; AddItem( snd ); Cap cap = new Cap(); cap.Hue = iHue; AddItem( cap ); Robe robe = new Robe(); robe.Hue = iHue; AddItem( robe ); DeadlyPoisonPotion pota = new DeadlyPoisonPotion(); pota.LootType = LootType.Newbied; AddToBackpack( pota ); DeadlyPoisonPotion potb = new DeadlyPoisonPotion(); potb.LootType = LootType.Newbied; AddToBackpack( potb ); DeadlyPoisonPotion potc = new DeadlyPoisonPotion(); potc.LootType = LootType.Newbied; AddToBackpack( potc ); DeadlyPoisonPotion potd = new DeadlyPoisonPotion(); potd.LootType = LootType.Newbied; AddToBackpack( potd ); Bandage band = new Bandage( 50 ); AddToBackpack( band ); }
public static void Fill( LockableContainer cont, int level ) { cont.Movable = false; cont.TrapEnabled = false; cont.Locked = false; int bandies = CoreAI.SpiritDepotBandies; int ghpots = CoreAI.SpiritDepotGHPots; int regs = CoreAI.SpiritDepotReagents; int trpots = CoreAI.SpiritDepotTRPots; Item item = null; // add a couple lesser explosion potions // these are for batteling hiders in the cave and not for damage for( int ix=0; ix < 2; ix++ ) { item = new LesserExplosionPotion(); cont.DropItem(item); } // add bandages item = new Bandage(bandies); cont.DropItem(item); // add greater heal potions for( int ix=0; ix < ghpots; ix++ ) { item = new GreaterHealPotion(); cont.DropItem(item); } // add total refresh potions for( int ix=0; ix < trpots; ix++ ) { item = new TotalRefreshPotion(); cont.DropItem(item); } // drop reagents cont.DropItem( new BagOfReagents( regs ) ); // drop res scroll cont.DropItem( new ResurrectionScroll() ); return; }
public void EndHeal() { StopHeal(); int healerNumber = -1, patientNumber = -1; bool playSound = true; bool checkSkills = false; SkillName primarySkill = GetPrimarySkill(m_Patient); SkillName secondarySkill = GetSecondarySkill(m_Patient); BaseCreature petPatient = m_Patient as BaseCreature; if (!m_Healer.Alive) { healerNumber = 500962; // You were unable to finish your work before you died. patientNumber = -1; playSound = false; } else if (Bandage.ProximityCheck(m_Healer, m_Patient, Core.AOS ? 2 : 1) == false) { healerNumber = 500963; // You did not stay close enough to heal your target. patientNumber = -1; playSound = false; } else if (!m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet)) { double healing = m_Healer.Skills[primarySkill].Value; double anatomy = m_Healer.Skills[secondarySkill].Value; double chance = ((healing - 68.0) / 50.0) - (m_Slips * 0.02); if ((checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble()) { if (m_Patient.Map == null || !m_Patient.Map.CanFit(m_Patient.Location, 16, CanFitFlags.requireSurface)) { healerNumber = 501042; // Target can not be resurrected at that location. patientNumber = 502391; // Thou can not be resurrected there! } else { healerNumber = 500965; // You are able to resurrect your patient. patientNumber = -1; m_Patient.PlaySound(0x214); m_Patient.FixedEffect(0x376A, 10, 16); if (petPatient != null && petPatient.IsDeadPet) { Mobile master = petPatient.ControlMaster; if (master != null && master.InRange(petPatient, 3)) { healerNumber = 503255; // You are able to resurrect the creature. master.SendGump(new PetResurrectGump(m_Healer, petPatient)); } else { healerNumber = 1049670; // The pet's owner must be nearby to attempt resurrection. } } else { m_Patient.SendGump(new ResurrectGump(m_Patient, m_Healer)); } } } else { if (petPatient != null && petPatient.IsDeadPet) { healerNumber = 503256; // You fail to resurrect the creature. } else { healerNumber = 500966; // You are unable to resurrect your patient. } patientNumber = -1; } } else if (m_Patient.Poisoned) { m_Healer.SendLocalizedMessage(500969); // You finish applying the bandages. double healing = m_Healer.Skills[primarySkill].Value; double anatomy = m_Healer.Skills[secondarySkill].Value; double chance = ((healing - 30.0) / 50.0) - (m_Patient.Poison.Level * 0.1) - (m_Slips * 0.02); if ((checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble()) { if (m_Patient.CurePoison(m_Healer)) { healerNumber = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons. patientNumber = 1010059; // You have been cured of all poisons. } else { healerNumber = -1; patientNumber = -1; } } else { healerNumber = 1010060; // You have failed to cure your target! patientNumber = -1; } } else if (BleedAttack.IsBleeding(m_Patient)) { healerNumber = -1; patientNumber = 1060167; // The bleeding wounds have healed, you are no longer bleeding! BleedAttack.EndBleed(m_Patient, true); } else if (MortalStrike.IsWounded(m_Patient)) { healerNumber = (m_Healer == m_Patient ? 1005000 : 1010398); patientNumber = -1; playSound = false; } else if (m_Patient.Hits == m_Patient.HitsMax) { healerNumber = 500967; // You heal what little damage your patient had. patientNumber = -1; } else { checkSkills = true; patientNumber = -1; double healing = m_Healer.Skills[primarySkill].Value; double anatomy = m_Healer.Skills[secondarySkill].Value; double chance = ((healing + 10.0) / 100.0) - (m_Slips * 0.02); if (chance > Utility.RandomDouble()) { healerNumber = 500969; // You finish applying the bandages. double min, max; if (Core.AOS) { min = (anatomy / 8.0) + (healing / 5.0) + 4.0; max = (anatomy / 6.0) + (healing / 2.5) + 4.0; } else { min = (anatomy / 5.0) + (healing / 5.0) + 3.0; max = (anatomy / 5.0) + (healing / 2.0) + 10.0; } double toHeal = min + (Utility.RandomDouble() * (max - min)); if (m_Patient.Body.IsMonster || m_Patient.Body.IsAnimal) { toHeal += m_Patient.HitsMax / 100; } if (Core.AOS) { toHeal -= toHeal * m_Slips * 0.35; // TODO: Verify algorithm } else { toHeal -= m_Slips * 4; } if (toHeal < 1) { toHeal = 1; healerNumber = 500968; // You apply the bandages, but they barely help. } m_Patient.Heal((int)toHeal); } else { healerNumber = 500968; // You apply the bandages, but they barely help. playSound = false; } } if (healerNumber != -1) { m_Healer.SendLocalizedMessage(healerNumber); } if (patientNumber != -1) { m_Patient.SendLocalizedMessage(patientNumber); } if (playSound) { m_Patient.PlaySound(0x57); } if (checkSkills) { m_Healer.CheckSkill(secondarySkill, 0.0, 100.0); m_Healer.CheckSkill(primarySkill, 0.0, 100.0); } }
/*public override void OnSingleClick( Mobile from ) { int number = (Amount == 1) ? 1049124 : 1049123; from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, number, "", Amount.ToString() ) ); }*/ public bool Scissor( Mobile from, Scissors scissors ) { if ( Deleted || !from.CanSee( this ) ) return false; Consume(); Item bandage = new Bandage(); bandage.Hue = Hue; if (!from.PlaceInBackpack(bandage)) bandage.MoveToWorld(from.Location, from.Map); //base.ScissorHelper( from, new Bandage(), 1 ); return true; }
public static void CreateItem(ItemInfo info, Mobile m) { if (m == null) return; Item item = null; BaseCreature bc = null; switch (info.IncrID) { case 0: item = new BlackPearl(999); break; case 1: item = new Bloodmoss(999); break; case 2: item = new MandrakeRoot(999); break; case 3: item = new Garlic(999); break; case 4: item = new Ginseng(999); break; case 5: item = new Nightshade(999); break; case 6: item = new SpidersSilk(999); break; case 7: item = new SulfurousAsh(999); break; case 8: item = new Bag(); ((Bag)item).DropItem( new BlackPearl(100) ); ((Bag)item).DropItem( new Bloodmoss(100) ); ((Bag)item).DropItem( new MandrakeRoot(100) ); ((Bag)item).DropItem( new Garlic(100) ); ((Bag)item).DropItem( new Ginseng(100) ); ((Bag)item).DropItem( new Nightshade(100) ); ((Bag)item).DropItem( new SpidersSilk(100) ); ((Bag)item).DropItem( new SulfurousAsh(100) ); break; case 9: item = new BatWing(999); break; case 10: item = new GraveDust(999); break; case 11: item = new DaemonBlood(999); break; case 12: item = new NoxCrystal(999); break; case 13: item = new PigIron(999); break; case 14: item = new Bag(); ((Bag)item).DropItem( new BatWing(100) ); ((Bag)item).DropItem( new GraveDust(100) ); ((Bag)item).DropItem( new DaemonBlood(100) ); ((Bag)item).DropItem( new NoxCrystal(100) ); ((Bag)item).DropItem( new PigIron(100) ); break; case 15: for (int i=0; i < 2; i++) //The last potion is dropped later { item = new RefreshPotion(); m.AddToBackpack(item); } item = new RefreshPotion(); break; case 16: for (int i=0; i < 2; i++) //The last potion is dropped later { item = new RefreshPotion(); m.AddToBackpack(item); } item = new LesserCurePotion(); break; case 17: for (int i=0; i < 2; i++) //The last potion is dropped later { item = new RefreshPotion(); m.AddToBackpack(item); } item = new LesserHealPotion(); break; case 18: for (int i=0; i < 2; i++) //The last potion is dropped later { item = new RefreshPotion(); m.AddToBackpack(item); } item = new NightSightPotion(); break; case 19: item = new Bandage(50); break; case 20: item = new Bandage(200); break; case 21: item = new Bandage(1000); break; case 22: item = new Arrow(100); break; case 23: item = new Arrow(1000); break; case 24: item = new Bolt(100); break; case 25: item = new Bolt(1000); break; case 26: bc = new Horse(); break; case 27: bc = new PackLlama(); break; case 28: item = new Club(); BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, Utility.RandomMinMax(1, 4), 40, 80); break; case 29: item = new WarFork(); BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, Utility.RandomMinMax(1, 4), 40, 80); break; case 30: item = new Katana(); BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, Utility.RandomMinMax(1, 4), 40, 80); break; case 31: item = new Bow(); BaseRunicTool.ApplyAttributesTo((BaseWeapon)item, Utility.RandomMinMax(1, 4), 40, 80); break; case 32: item = new MetalKiteShield(); BaseRunicTool.ApplyAttributesTo((BaseShield)item, Utility.RandomMinMax(1, 4), 40, 80); break; case 33: item = new WoodenShield(); BaseRunicTool.ApplyAttributesTo((BaseShield)item, Utility.RandomMinMax(1, 4), 40, 80); break; case 34: item = new LeatherChest(); BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80); break; case 35: item = new LeatherGloves(); BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80); break; case 36: item = new LeatherGorget(); BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80); break; case 37: item = new LeatherLegs(); BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80); break; case 38: item = new LeatherCap(); BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80); break; case 39: item = new LeatherArms(); BaseRunicTool.ApplyAttributesTo((BaseArmor)item, Utility.RandomMinMax(1, 4), 40, 80); break; case 40: item = new Gold(300); break; case 41: item = new Gold(3000); break; case 42: item = new Server.Engines.BulkOrders.BulkOrderBook(); break; case 43: item = new Drums(); ((BaseInstrument)item).Quality = InstrumentQuality.Exceptional; break; case 44: item = new TambourineTassel(); ((BaseInstrument)item).Quality = InstrumentQuality.Exceptional; break; case 45: item = new Server.Multis.SmallDragonBoatDeed(); break; case 46: item = new Server.Multis.LargeDragonBoatDeed(); break; } if (item != null) { m.AddToBackpack(item); m.SendMessage("Here are the goods you requested."); } else if (bc != null) { bc.Controlled = true; bc.ControlMaster = m; bc.MoveToWorld( m.Location, m.Map ); m.SendMessage("Here is the pet you requested."); } else { m.SendMessage("That item is not available. Please report the bug at the site that will open in your browser."); m.LaunchBrowser( "http://bug.casiopia.net/" ); m.AddToBackpack( new VeriteGem(info.Price) ); } }
public DummySword() : base(AIType.AI_Melee, FightMode.Closest, 15, 1, 0.2, 0.6) { // A Dummy Swordsman int iHue = 20 + Team * 40; int jHue = 25 + Team * 40; // Skills and Stats this.InitStats( 125, 125, 90 ); this.Skills[SkillName.Swords].Base = 120; this.Skills[SkillName.Anatomy].Base = 120; this.Skills[SkillName.Healing].Base = 120; this.Skills[SkillName.Tactics].Base = 120; this.Skills[SkillName.Parry].Base = 120; // Name this.Name = "Swordsman"; // Equip Katana kat = new Katana(); kat.Crafter = this; kat.Movable = true; kat.Quality = WeaponQuality.Regular; AddItem( kat ); Boots bts = new Boots(); bts.Hue = iHue; AddItem( bts ); ChainChest cht = new ChainChest(); cht.Movable = false; cht.LootType = LootType.Newbied; cht.Crafter = this; cht.Quality = ArmorQuality.Regular; AddItem( cht ); ChainLegs chl = new ChainLegs(); chl.Movable = false; chl.LootType = LootType.Newbied; chl.Crafter = this; chl.Quality = ArmorQuality.Regular; AddItem( chl ); PlateArms pla = new PlateArms(); pla.Movable = false; pla.LootType = LootType.Newbied; pla.Crafter = this; pla.Quality = ArmorQuality.Regular; AddItem( pla ); Bandage band = new Bandage( 50 ); AddToBackpack( band ); }
public override void InitOutfit() { WipeLayers(); AddItem( new Shirt( Utility.RandomNeutralHue() ) ); AddItem( new ShortPants( Utility.RandomNeutralHue() ) ); AddItem( new Boots( Utility.RandomNeutralHue() ) ); switch ( Utility.Random( 4 ) ) { case 0: AddItem( new ShortHair( Utility.RandomHairHue() ) ); break; case 1: AddItem( new TwoPigTails( Utility.RandomHairHue() ) ); break; case 2: AddItem( new ReceedingHair( Utility.RandomHairHue() ) ); break; case 3: AddItem( new KrisnaHair( Utility.RandomHairHue() ) ); break; } AddItem( new Kryss() ); PackGold( 50, 60 ); Bandage aids = new Bandage(); aids.Amount = Utility.Random( 1, 3 ); AddItem( aids ); Lockpick picks = new Lockpick(); picks.Amount = Utility.Random( 1, 3 ); AddItem( picks ); }
public DummyThief() : base(AIType.AI_Thief, FightMode.Closest, 15, 1, 0.2, 0.6) { // A Dummy Hybrid Thief int iHue = 20 + Team * 40; int jHue = 25 + Team * 40; // Skills and Stats this.InitStats( 105, 105, 105 ); this.Skills[SkillName.Healing].Base = 120; this.Skills[SkillName.Anatomy].Base = 120; this.Skills[SkillName.Stealing].Base = 120; this.Skills[SkillName.ArmsLore].Base = 100; this.Skills[SkillName.Meditation].Base = 120; this.Skills[SkillName.Wrestling].Base = 120; // Name this.Name = "Hybrid Thief"; // Equip Spellbook book = new Spellbook(); book.Movable = false; book.LootType = LootType.Newbied; book.Content =0xFFFFFFFFFFFFFFFF; AddItem( book ); LeatherArms lea = new LeatherArms(); lea.Movable = false; lea.LootType = LootType.Newbied; lea.Crafter = this; lea.Quality = ArmorQuality.Regular; AddItem( lea ); LeatherChest lec = new LeatherChest(); lec.Movable = false; lec.LootType = LootType.Newbied; lec.Crafter = this; lec.Quality = ArmorQuality.Regular; AddItem( lec ); LeatherGorget leg = new LeatherGorget(); leg.Movable = false; leg.LootType = LootType.Newbied; leg.Crafter = this; leg.Quality = ArmorQuality.Regular; AddItem( leg ); LeatherLegs lel = new LeatherLegs(); lel.Movable = false; lel.LootType = LootType.Newbied; lel.Crafter = this; lel.Quality = ArmorQuality.Regular; AddItem( lel ); Sandals snd = new Sandals(); snd.Hue = iHue; snd.LootType = LootType.Newbied; AddItem( snd ); Cap cap = new Cap(); cap.Hue = iHue; AddItem( cap ); Robe robe = new Robe(); robe.Hue = iHue; AddItem( robe ); Bandage band = new Bandage( 50 ); AddToBackpack( band ); }
public BandageContext( Mobile healer, Mobile patient, TimeSpan delay, Bandage bandage ) { m_Healer = healer; m_Patient = patient; m_Bandage = bandage; m_Delay = delay; m_Timer = new InternalTimer( this, delay ); m_Timer.Start(); }
public void Spawn() { int bandies = CoreAI.SpiritDepotBandies; int ghpots = CoreAI.SpiritDepotGHPots; int regs = CoreAI.SpiritDepotReagents; if( this.m_BandageContainer != null ) { //clear of all existing bandaids Item[] contents = m_BandageContainer.FindItemsByType(typeof(Bandage), true); foreach(Item b in contents) { b.Delete(); } Item item = new Bandage(bandies); this.m_BandageContainer.DropItem(item); } if( this.m_GHPotionContainer != null ) { //clear of all existing ghpots Item[] contents = m_GHPotionContainer.FindItemsByType(typeof(GreaterHealPotion), true); foreach(Item b in contents) { b.Delete(); } for( int i=0; i<ghpots; i++ ) { Item item = new GreaterHealPotion(); this.m_GHPotionContainer.DropItem(item); } } if( this.m_ReagentContainer != null ) { //delete all reagents in container foreach( Type t in Loot.RegTypes ) { Item[] contents = m_ReagentContainer.FindItemsByType(t); foreach( Item b in contents ) { b.Delete(); } } int iTotal = regs; while( iTotal > 0 ) { Item item = Loot.RandomReagent(); int count = Utility.RandomMinMax( 1, 10 ); if( count > iTotal ) count = iTotal; iTotal -= count; item.Amount = count; this.m_ReagentContainer.DropItem(item); } } }
public BandageContext(Mobile healer, Mobile patient, TimeSpan delay, Bandage origin) { m_Healer = healer; m_Patient = patient; if (m_Patient != null && !m_Patient.Alive) { if (m_Healer.Skills[SkillName.Anatomy].Base < 100.0 || m_Healer.Skills[SkillName.Healing].Base < 100.0) { if (m_Healer.Skills[SkillName.Anatomy].Base < 100.0 && m_Healer.Skills[SkillName.Healing].Base < 100.0) { m_Healer.SendAsciiMessage("You need GM healing and anatomy to resurrect your target."); return; } else if (m_Healer.Skills[SkillName.Anatomy].Base < 100.0) { m_Healer.SendAsciiMessage("You need GM anatomy to resurrect your target."); return; } else if (m_Healer.Skills[SkillName.Healing].Base < 100.0) { m_Healer.SendAsciiMessage("You need GM healing to resurrect your target."); return; } } if (m_Healer.Hits <= 50) { m_Healer.SendAsciiMessage("You need to have more than 50 hp to resurrect your target"); return; } if (m_Patient.Region is HouseRegion) { m_Healer.SendAsciiMessage("You can't resurrect people in house regions."); //Server.Multis.BaseHouse patientHouse = (m_Patient.Region as HouseRegion).House; ////The owner can resurrect who ever he wants. //if (patientHouse.IsOwner(m_Healer) || patientHouse.IsCoOwner(m_Healer)) //{ // m_Patient.Resurrect(); // m_Patient.Hits = 10; // m_Healer.PublicOverheadMessage(MessageType.Regular, 0x22, true, "*You see " + m_Healer.Name + " resurrecting " + m_Patient.Name + "*"); // m_Healer.Hits -= 50; //} ////The patient can be ressed by anoyone as long as he is an owner, co owner or friend //else if (patientHouse.IsOwner(m_Patient) || patientHouse.IsCoOwner(m_Patient) || patientHouse.IsFriend(m_Patient)) //{ // m_Patient.Resurrect(); // m_Patient.Hits = 10; // m_Healer.PublicOverheadMessage(MessageType.Regular, 0x22, true, "*You see " + m_Healer.Name + " resurrecting " + m_Patient.Name + "*"); // m_Healer.Hits -= 50; //} //else //{ // m_Patient.SendAsciiMessage("You cannot be resurrected in this region!"); // m_Healer.SendAsciiMessage("You cannot resurrect in this region!"); //} } else { m_Patient.PlaySound(0x214); m_Patient.Resurrect(); m_Patient.Hits = 10; m_Healer.PublicOverheadMessage(MessageType.Regular, 0x22, true, "*You see " + m_Healer.Name + " resurrecting " + m_Patient.Name + "*"); m_Healer.Hits -= 50; origin.Consume(1); } } else { m_Timer = new InternalTimer(this, delay, origin); m_Timer.Start(); } }