public override void DoAction(PlayerMobile player) { player.Animate(32, 5, 1, true, false, 0); player.RevealingAction(); Effects.PlaySound(player.Location, player.Map, 0x3E3); }
public virtual void DoAction(PlayerMobile player) { player.Animate(32, 5, 1, true, false, 0); player.RevealingAction(); Effects.PlaySound(player.Location, player.Map, 0x241); }
protected override void OnTick() { if (m_Player.Deleted) { Stop(); return; } if (!m_Player.Mounted) { m_Player.Animate(Utility.RandomBool() ? 16 : 17, 7, 1, true, false, 0); } if (m_Step == 4) { var baseX = m_WellOfTearsArea.X; var baseY = m_WellOfTearsArea.Y; var width = m_WellOfTearsArea.Width; var height = m_WellOfTearsArea.Height; var map = m_WellOfTearsMap; Effects.SendLocationParticles( EffectItem.Create(m_Player.Location, m_Player.Map, TimeSpan.FromSeconds(1.0)), 0, 0, 0, 0x13C4 ); Effects.PlaySound(m_Player.Location, m_Player.Map, 0x243); for (var i = 0; i < 15; i++) { var x = baseX + Utility.Random(width); var y = baseY + Utility.Random(height); var z = map.GetAverageZ(x, y); var from = new Point3D(x, y, z + Utility.RandomMinMax(5, 20)); var to = new Point3D(x, y, z); var hue = Utility.RandomList(0x481, 0x482, 0x489, 0x497, 0x66D); Effects.SendMovingEffect(map, 0x36D4, from, to, 0, 0, false, true, hue); } } if (m_Step < 5) { m_Player.Frozen = true; } else // Cast completed { m_Player.Frozen = false; SummonedPaladin.BeginSummon(m_Player); } m_Step++; }
public PostSuccessTimer(PlayerMobile pm, int anim_count, TimeSpan tick_time) : base(tick_time, tick_time, anim_count - 1) { m_Harvester = pm; if (pm.TempStashedHarvest != null && pm.TempStashedHarvestDef != null) { pm.Animate(Utility.RandomList(pm.TempStashedHarvestDef.EffectActions), 5, anim_count, true, false, 0); Effects.PlaySound(pm.Location, pm.Map, Utility.RandomList(pm.TempStashedHarvestDef.EffectSounds)); } }
public override void DoAction(PlayerMobile player) { if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } player.Animate(32, 5, 1, true, false, 0); player.RevealingAction(); Effects.PlaySound(player.Location, player.Map, 0x3E3); }
private void CastStop_Callback(object m) { PlayerMobile from = (PlayerMobile)m; tempHue = from.Hue; tempBody = from.BodyValue; from.Hue = 0; from.BodyValue = 15; from.Animate(12, 8, 1, false, false, 0); from.PlaySound(274); Timer.DelayCall(TimeSpan.FromMilliseconds(1500.0), new TimerStateCallback(AnimStop_Callback), from); }
public override void DoAction(PlayerMobile player) { if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } player.Animate(12, 7, 1, true, false, 0); player.PlaySound(Utility.RandomList(0x125, 0x126)); player.RevealingAction(); }
private static void Honor(PlayerMobile source, Mobile target) { IHonorTarget honorTarget = target as IHonorTarget; if (honorTarget == null || !source.CanBeHarmful(target, true)) { return; } if (honorTarget.ReceivedHonorContext != null) { if (honorTarget.ReceivedHonorContext.Source == source) { return; } if (honorTarget.ReceivedHonorContext.CheckDistance()) { source.SendLocalizedMessage(1063233); // Somebody else is honoring this opponent return; } } if (target.Hits < target.HitsMax) { source.SendLocalizedMessage(1063166); // You cannot honor this monster because it is too damaged. return; } if (Core.ML && target is PlayerMobile) { source.SendLocalizedMessage(1075614); // You cannot honor other players. return; } if (source.SentHonorContext != null) { source.SentHonorContext.Cancel(); } new HonorContext(source, target); source.Direction = source.GetDirectionTo(target); if (!source.Mounted) { source.Animate(32, 5, 1, true, true, 0); } // OSI apparently removed this message... it's nice though source.Say(1063231); // I honor you }
protected override void OnTick() { if (m_Player.Deleted) { Stop(); return; } if (!m_Player.Mounted) { m_Player.Animate(Utility.RandomBool() ? 16 : 17, 7, 1, true, false, 0); } if (m_Step == 4) { int baseX = KronusScroll.m_WellOfTearsArea.X; int baseY = KronusScroll.m_WellOfTearsArea.Y; int width = KronusScroll.m_WellOfTearsArea.Width; int height = KronusScroll.m_WellOfTearsArea.Height; Map map = KronusScroll.m_WellOfTearsMap; Effects.SendLocationParticles(EffectItem.Create(m_Player.Location, m_Player.Map, TimeSpan.FromSeconds(1.0)), 0, 0, 0, 0x13C4); Effects.PlaySound(m_Player.Location, m_Player.Map, 0x243); for (int i = 0; i < 15; i++) { int x = baseX + Utility.Random(width); int y = baseY + Utility.Random(height); int z = map.GetAverageZ(x, y); Point3D from = new Point3D(x, y, z + Utility.RandomMinMax(5, 20)); Point3D to = new Point3D(x, y, z); int hue = Utility.RandomList(0x481, 0x482, 0x489, 0x497, 0x66D); Effects.SendPacket(from, map, new HuedEffect(EffectType.Moving, Serial.Zero, Serial.Zero, 0x36D4, from, to, 0, 0, false, true, hue, 0)); } } if (m_Step < 5) { m_Player.Frozen = true; } else // Cast completed { m_Player.Frozen = false; SummonedPaladin.BeginSummon(m_Player); } m_Step++; }
private void DoRollEffects(PlayerMobile pm) { if (!pm.Mounted) { pm.Animate(32, 5, 1, true, false, 0); } Effects.PlaySound(Board.GetWorldLocation(), Board.Map, 0x4F); /*for (int i = 0; i < 3; i++) * { * Timer.DelayCall(TimeSpan.FromMilliseconds(i * 300), // 0x247, 0x4F * () => Effects.PlaySound(Board.GetWorldLocation(), Board.Map, 0x42)); * }*/ }
public static void Name(SpeechEventArgs e) { Mobile m = e.Mobile; if (m is PlayerMobile) { PlayerMobile from = (PlayerMobile)m; if (e.Speech.ToLower().IndexOf("what is my status") >= 0) { from.Animate(0, 6, 22, false, false, 200); from.PlaySound(from.Female ? 791 : 1063); from.CloseGump(typeof(TermGump)); from.SendGump(new TermGump(from)); } } }
private void AnimStop_Callback(object m) { if (m is PlayerMobile && !(((PlayerMobile)m).Deleted)) { PlayerMobile from = (PlayerMobile)m; from.Hue = tempHue; from.BodyValue = tempBody; if (tohide) { from.Hidden = true; } else { from.Animate(17, 4, 1, false, false, 0); } playing = false; } }
public override void DoAction(PlayerMobile player) { if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } player.Animate(11, 5, 1, true, false, 0); player.RevealingAction(); Point3D location = Location; Map map = Map; Effects.PlaySound(player.Location, player.Map, 0x33C); IEntity startLocation = new Entity(Serial.Zero, new Point3D(player.X, player.Y, player.Z + 10), player.Map); IEntity endLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z), map); Effects.SendMovingEffect(startLocation, endLocation, 574, 5, 0, false, false, 0, 0); double distance = Utility.GetDistanceToSqrt(startLocation.Location, endLocation.Location); double destinationDelay = (double)distance * .12; Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (!UOACZPersistance.Active) { return; } Effects.SendLocationEffect(location, map, 0x352D, 16, 4); Effects.PlaySound(location, map, 0x364); TimedStatic bobber = new TimedStatic(574, ScavengeDuration.TotalSeconds - .5); bobber.Name = "fishing bobber"; bobber.MoveToWorld(location, map); }); }
private static void Honor(PlayerMobile source, Mobile target) { IHonorTarget honorTarget = target as IHonorTarget; GuardedRegion reg = (GuardedRegion)source.Region.GetRegion(typeof(GuardedRegion)); Map map = source.Map; if (honorTarget == null) { return; } if (honorTarget.ReceivedHonorContext != null) { if (honorTarget.ReceivedHonorContext.Source == source) { source.SendLocalizedMessage(1115882); // You don't need to declare again. You are already under Honorable Combat with this target. return; } if (honorTarget.ReceivedHonorContext.CheckDistance()) { source.SendLocalizedMessage(1063233); // Somebody else is honoring this opponent return; } } if (target.Hits < target.HitsMax) { source.SendLocalizedMessage(1063166); // You cannot honor this monster because it is too damaged. return; } BaseCreature cret = target as BaseCreature; if (target.Body.IsHuman && (cret == null || (!cret.AlwaysAttackable && !cret.AlwaysMurderer))) { if (reg == null || reg.IsDisabled()) { //Allow honor on blue if Out of guardzone } else if (map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0) { //Allow honor on blue if in Fel } else { source.SendLocalizedMessage(1001018); // You cannot perform negative acts return; //cannot honor in trammel town on blue } } if (Core.ML && target is PlayerMobile) { source.SendLocalizedMessage(1075614); // You cannot honor other players. return; } if (source.SentHonorContext != null) { source.SentHonorContext.Cancel(); } new HonorContext(source, target); source.Direction = source.GetDirectionTo(target); source.SendLocalizedMessage(1115884); // You Started Honorable Combat! if (!source.Mounted) { source.Animate(32, 5, 1, true, true, 0); } BuffInfo.AddBuff(source, new BuffInfo(BuffIcon.Honored, 1075649, 1153815, String.Format("{0}", target.Name))); BuffInfo.AddBuff(source, new BuffInfo(BuffIcon.Perfection, 1153786, 1151394, String.Format("0\t{0}", target.Name))); }
public void Target(Corpse c) { Mobile m = c.Owner; if (!Caster.CanSee(c)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (m == Caster) { Caster.SendLocalizedMessage(501039); // Thou can not resurrect thyself. } else if (!Caster.InRange(c, 5)) { Caster.SendLocalizedMessage(501042); // Target is not close enough. } else if (!m.Player) { Caster.SendLocalizedMessage(501043); // Target is not a being. } else if (CheckSequence() && m != null) { PlayerMobile pm = m as PlayerMobile; if (pm != null && Caster is PlayerMobile && (pm.MortEngine.MortCurrentState == MortState.Assomage || pm.MortEngine.MortCurrentState == MortState.MortDefinitive)) { SpellHelper.Turn(Caster, pm); /*((PlayerMobile)Caster).AddFatigue(250); * pm.AddFatigue(-250);*/ pm.PlaySound(0x214); Effects.SendTargetEffect(pm, 0x376A, 10, 16); if (pm.MortEngine.TimerEvanouie != null) { pm.MortEngine.TimerEvanouie.Stop(); pm.MortEngine.TimerEvanouie = null; } if (pm.MortEngine.TimerMort != null) { pm.MortEngine.TimerMort.Stop(); pm.MortEngine.TimerMort = null; } pm.Location = c.Location; pm.MortEngine.EndroitMort = c.Location; pm.MortEngine.RisqueDeMort = false; pm.MortEngine.Mort = false; pm.Frozen = false; pm.Direction = c.Direction; pm.Animate(21, 5, 1, false, false, 0); pm.Resurrect(); if (c != null) { ArrayList list = new ArrayList(); foreach (Item item in c.Items) { list.Add(item); } foreach (Item item in list) { if (item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) { item.Delete(); } if (item is RaceSkin || c.EquipItems.Contains(item)) { if (!m.EquipItem(item)) { m.AddToBackpack(item); } } else { m.AddToBackpack(item); } } } pm.CheckRaceSkin(); pm.CheckStatTimers(); pm.MortEngine.MortCurrentState = MortState.Resurrection; } else { Caster.SendMessage("Vous devez cibler le corps d'un joueur MORT !"); } } FinishSequence(); }
public virtual void Consume(PlayerMobile player) { UOACZPersistance.CheckAndCreateUOACZAccountEntry(player); switch (ConsumptionType) { case ConsumptionMode.Food: player.PlaySound(Utility.RandomList(0x5DA, 0x5A9, 0x5AB, 0x03A, 0x03B, 0x03C)); player.Animate(34, 5, 1, true, false, 0); player.m_UOACZAccountEntry.FoodItemsConsumed++; break; case ConsumptionMode.Drink: Effects.PlaySound(player.Location, player.Map, Utility.RandomList(0x030, 0x031, 0x050)); player.Animate(34, 5, 1, true, false, 0); player.m_UOACZAccountEntry.DrinkItemsConsumed++; break; } Charges--; DropContainerToPlayer(player); Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate { if (player == null) { return; } UOACZPersistance.CheckAndCreateUOACZAccountEntry(player); if (player.Deleted || !player.Alive) { return; } if (player.m_UOACZAccountEntry.ActiveProfile != UOACZAccountEntry.ActiveProfileType.Human) { return; } player.Heal(HitsChange); player.Stam += StamChange; player.Mana += ManaChange; int baseDiseaseAmount = 0; double diseaseAmount = 0; if (ConsumptionQualityType == ConsumptionQuality.Raw) { player.SendMessage("You eat the raw meat and wish it had been cooked first."); baseDiseaseAmount = UOACZSystem.RawMeatDiseaseAmount; diseaseAmount = UOACZSystem.RawMeatDiseaseAmount; } if (ConsumptionQualityType == ConsumptionQuality.Corrupted) { player.SendMessage("You eat the corrupted meat and wish it had been purified alchemically first."); baseDiseaseAmount = UOACZSystem.CorruptedMeatDiseaseAmount; diseaseAmount = UOACZSystem.CorruptedMeatDiseaseAmount; } if (diseaseAmount > 0) { bool foundDisease = false; Queue m_EntriesToRemove = new Queue(); foreach (SpecialAbilityEffectEntry entry in player.m_SpecialAbilityEffectEntries) { if (entry.m_SpecialAbilityEffect == SpecialAbilityEffect.Disease && DateTime.UtcNow < entry.m_Expiration) { if (!foundDisease) { diseaseAmount += entry.m_Value; foundDisease = true; } m_EntriesToRemove.Enqueue(entry); } } while (m_EntriesToRemove.Count > 0) { SpecialAbilityEffectEntry entry = (SpecialAbilityEffectEntry)m_EntriesToRemove.Dequeue(); player.m_SpecialAbilityEffectEntries.Remove(entry); } if (!player.Hidden) { Effects.PlaySound(player.Location, player.Map, 0x5CB); Effects.SendLocationParticles(EffectItem.Create(player.Location, player.Map, TimeSpan.FromSeconds(0.25)), 0x376A, 10, 20, 2199, 0, 5029, 0); player.PublicOverheadMessage(MessageType.Regular, 1103, false, "*looks violently ill*"); Blood blood = new Blood(); blood.Hue = 2200; blood.MoveToWorld(player.Location, player.Map); int extraBlood = Utility.RandomMinMax(1, 2); for (int i = 0; i < extraBlood; i++) { Blood moreBlood = new Blood(); moreBlood.Hue = 2200; moreBlood.MoveToWorld(new Point3D(player.Location.X + Utility.RandomMinMax(-1, 1), player.Location.Y + Utility.RandomMinMax(-1, 1), player.Location.Z), player.Map); } } AOS.Damage(player, null, baseDiseaseAmount, 0, 100, 0, 0, 0); SpecialAbilities.DiseaseSpecialAbility(1.0, player, player, diseaseAmount, UOACZSystem.FoodDiseaseSeconds, 0, false, "", ""); } UOACZSystem.ChangeStat(player, UOACZSystem.UOACZStatType.Hunger, HungerChange, true); UOACZSystem.ChangeStat(player, UOACZSystem.UOACZStatType.Thirst, ThirstChange, true); }); }
public virtual void ForceLock(PlayerMobile player) { if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } BaseWeapon weapon = player.Weapon as BaseWeapon; double usageDelay = ScavengeDuration.TotalSeconds; int damage = 5; if (weapon != null) { int minDamage = weapon.MinDamage; int maxDamage = weapon.MaxDamage; double strScalar = (double)player.Str / 100; double tacticsScalar = player.Skills.Tactics.Value / 100; if (weapon is Pickaxe || weapon is Hatchet) { minDamage = 10; maxDamage = 20; } damage = (int)(Math.Round(strScalar * tacticsScalar * (double)(Utility.RandomMinMax(weapon.MinDamage, weapon.MaxDamage)))); if (damage < 1) { damage = 1; } usageDelay = weapon.GetDelay(player, false).TotalSeconds; } Direction direction = player.GetDirectionTo(Location); if (direction != player.Direction) { player.Direction = direction; } TimeSpan startDelay = TimeSpan.FromSeconds(.25); TimeSpan endDelay = TimeSpan.FromSeconds(.5); double totalActionTime = startDelay.TotalSeconds + usageDelay; player.BeginAction(typeof(UOACZBaseScavengeObject)); Timer.DelayCall(TimeSpan.FromSeconds(totalActionTime) + ScavengeCooldown, delegate { if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } player.EndAction(typeof(UOACZBaseScavengeObject)); }); Timer.DelayCall(startDelay, delegate { if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } player.Animate(12, 5, 1, true, false, 0); player.RevealingAction(); Timer.DelayCall(endDelay, delegate { if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } if (Utility.GetDistance(player.Location, Location) > InteractionRange) { player.SendMessage("You are too far away to continue using that."); return; } Effects.PlaySound(player.Location, player.Map, m_HitSound); ReceiveDamage(player, damage); }); }); }
public virtual void RemoveTrap(Mobile from) { PlayerMobile player = from as PlayerMobile; if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } if (m_TrapImmunePlayers.ContainsKey(player)) { player.SendMessage("You are confident you will not suffer any ill effects from whatever lies within."); player.SendSound(0x5AA); return; } Direction direction = player.GetDirectionTo(Location); if (direction != player.Direction) { player.Direction = direction; } TimeSpan startDelay = TimeSpan.FromSeconds(.25); double totalInteractTime = startDelay.TotalSeconds + ScavengeDuration.TotalSeconds; SpecialAbilities.HinderSpecialAbility(1.0, null, player, 1.0, totalInteractTime, true, 0, false, "", "You begin to examine the object.", "-1"); player.BeginAction(typeof(UOACZBaseScavengeObject)); Timer.DelayCall(TimeSpan.FromSeconds(totalInteractTime) + ScavengeCooldown, delegate { if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } player.EndAction(typeof(UOACZBaseScavengeObject)); }); Timer.DelayCall(startDelay, delegate { if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } player.Animate(32, 5, 1, true, false, 0); player.RevealingAction(); double removeTrapSkill = player.Skills.RemoveTrap.Value / 100; if (Utility.RandomDouble() <= removeTrapSkill || TrapType == ScavengeTrapType.None) { m_TrapImmunePlayers.Add(player, 500); player.SendMessage("You are confident you will not suffer any ill effects from whatever lies within."); player.SendSound(0x5AA); } else { player.SendMessage("You are unsure of what lies within the object."); return; } }); }
public virtual void LockpickInteract(PlayerMobile player, UOACZLockpickKit lockpickKit) { if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } Direction direction = player.GetDirectionTo(Location); if (direction != player.Direction) { player.Direction = direction; } TimeSpan startDelay = TimeSpan.FromSeconds(.25); double totalInteractTime = startDelay.TotalSeconds + ScavengeDuration.TotalSeconds; lockpickKit.Charges--; if (lockpickKit.Charges <= 0) { lockpickKit.Delete(); } SpecialAbilities.HinderSpecialAbility(1.0, null, player, 1.0, totalInteractTime, true, 0, false, "", InteractText, "-1"); player.BeginAction(typeof(UOACZBaseScavengeObject)); Timer.DelayCall(TimeSpan.FromSeconds(totalInteractTime) + ScavengeCooldown, delegate { if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } player.EndAction(typeof(UOACZBaseScavengeObject)); }); Timer.DelayCall(startDelay, delegate { if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } player.Animate(32, 5, 1, true, false, 0); player.RevealingAction(); Effects.PlaySound(player.Location, player.Map, 0x241); Timer.DelayCall(ScavengeDuration, delegate { if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } if (Utility.GetDistance(player.Location, Location) > InteractionRange) { player.SendMessage("You are too far away to continue using that."); return; } if (YieldsRemaining == 0) { player.SendMessage(NoYieldRemainingText); return; } ScavengeResult(player, true); }); }); }
public static void Emote_OnCommand(CommandEventArgs e) { PlayerMobile pm = (PlayerMobile)e.Mobile; TimeSpan EmoteDelay = (pm.AccessLevel > AccessLevel.Player) ? EmoteDelayStaff : EmoteDelayPlayers; if ((pm.LastEmote + EmoteDelay) >= DateTime.Now) { pm.SendMessage("You must wait a few moments before emoting again."); return; } switch (e.ArgString.Trim().ToLower()) { case "ah": pm.PlaySound(pm.Female ? 778 : 1049); pm.Say("*ah!*"); break; case "ahha": pm.PlaySound(pm.Female ? 779 : 1050); pm.Say("*ahha!*"); break; case "applaud": pm.PlaySound(pm.Female ? 780 : 1051); pm.Say("*applauds*"); break; case "blownose": pm.PlaySound(pm.Female ? 781 : 1052); pm.Say("*blows nose*"); if (!pm.Mounted && UseAnimations) { pm.Animate(34, 5, 1, true, false, 0); } break; case "bscough": pm.PlaySound(pm.Female ? 786 : 1057); pm.Say("*bs cough*"); break; case "burp": pm.PlaySound(pm.Female ? 782 : 1053); pm.Say("*burp!*"); if (!pm.Mounted && UseAnimations) { pm.Animate(33, 5, 1, true, false, 0); } break; case "cheer": pm.PlaySound(pm.Female ? 783 : 1054); pm.Say("*cheers*"); break; case "clap": pm.PlaySound(pm.Female ? 780 : 1051); pm.Say("*claps*"); break; case "clearthroat": pm.PlaySound(pm.Female ? 784 : 1055); pm.Say("*clears throat*"); if (!pm.Mounted && UseAnimations) { pm.Animate(33, 5, 1, true, false, 0); } break; case "cough": pm.PlaySound(pm.Female ? 785 : 1056); pm.Say("*cough*"); if (!pm.Mounted && UseAnimations) { pm.Animate(33, 5, 1, true, false, 0); } break; case "cry": pm.PlaySound(pm.Female ? 787 : 1058); pm.Say("*cries*"); break; case "fart": pm.PlaySound(pm.Female ? 792 : 1064); pm.Say("*farts*"); break; case "gasp": pm.PlaySound(pm.Female ? 793 : 1065); pm.Say("*gasps*"); break; case "giggle": pm.PlaySound(pm.Female ? 794 : 1066); pm.Say("*giggles*"); break; case "groan": pm.PlaySound(pm.Female ? 795 : 1067); pm.Say("*groans*"); break; case "growl": pm.PlaySound(pm.Female ? 796 : 1068); pm.Say("*growls*"); break; case "hey": pm.PlaySound(pm.Female ? 797 : 1069); pm.Say("*hey!*"); break; case "hiccup": pm.PlaySound(pm.Female ? 798 : 1070); pm.Say("*hiccups*"); break; case "huh": pm.PlaySound(pm.Female ? 799 : 1071); pm.Say("*huh?*"); break; case "kiss": pm.PlaySound(pm.Female ? 800 : 1072); pm.Say("*kisses*"); break; case "laugh": pm.PlaySound(pm.Female ? 794 : 1073); pm.Say("*laughs*"); break; case "lol": pm.PlaySound(pm.Female ? 794 : 1073); pm.Say("*lol*"); break; case "no": pm.PlaySound(pm.Female ? 802 : 1074); pm.Say("*no!*"); break; case "oh": pm.PlaySound(pm.Female ? 803 : 1075); pm.Say("*oh!*"); break; case "oooh": pm.PlaySound(pm.Female ? 811 : 1085); pm.Say("*oooh!*"); break; case "oops": pm.PlaySound(pm.Female ? 812 : 1086); pm.Say("*oops!*"); break; case "puke": pm.PlaySound(pm.Female ? 813 : 1087); pm.Say("*pukes!*"); break; case "scream": pm.PlaySound(pm.Female ? 814 : 1088); pm.Say("*aaahh!*"); break; case "shh": case "shush": pm.PlaySound(pm.Female ? 815 : 1089); pm.Say("*shh!*"); break; case "sigh": pm.PlaySound(pm.Female ? 816 : 1090); pm.Say("*sigh*"); break; case "sneeze": pm.PlaySound(pm.Female ? 817 : 1091); pm.Say("*sneezes*"); if (!pm.Mounted && UseAnimations) { pm.Animate(32, 5, 1, true, false, 0); } break; case "sniff": pm.PlaySound(pm.Female ? 818 : 1092); pm.Say("*sniffs*"); if (!pm.Mounted && UseAnimations) { pm.Animate(34, 5, 1, true, false, 0); } break; case "snore": pm.PlaySound(pm.Female ? 819 : 1093); pm.Say("*snores*"); break; case "spit": pm.PlaySound(pm.Female ? 820 : 1094); pm.Say("*spits*"); if (!pm.Mounted && UseAnimations) { pm.Animate(6, 5, 1, true, false, 0); } break; case "whistle": pm.PlaySound(pm.Female ? 821 : 1095); pm.Say("*whistles*"); if (!pm.Mounted && UseAnimations) { pm.Animate(5, 5, 1, true, false, 0); } break; case "woohoo": pm.PlaySound(pm.Female ? 783 : 1054); pm.Say("*woohoo*"); break; case "yawn": pm.PlaySound(pm.Female ? 822 : 1096); pm.Say("*yawns*"); if (!pm.Mounted && UseAnimations) { pm.Animate(17, 5, 1, true, false, 0); } break; case "yea": case "yeah": pm.PlaySound(pm.Female ? 823 : 1097); pm.Say("*yeah!*"); break; case "yell": pm.PlaySound(pm.Female ? 824 : 1098); pm.Say("*yells*"); break; default: pm.SendMessage("Unrecognized emote."); return; } pm.LastEmote = DateTime.Now; }
public override void OnDoubleClick(Mobile from) { base.OnDoubleClick(from); PlayerMobile player = from as PlayerMobile; if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } if (!(player.IsUOACZHuman)) { return; } if (Utility.GetDistance(player.Location, Location) > 2) { from.SendMessage("You are too far away to use that."); return; } if (!Map.InLOS(player.Location, Location)) { from.SendMessage("That is not within your line of sight."); return; } if (player.Backpack == null) { return; } bool foundContainer = false; Item[] items = player.Backpack.FindItemsByType(typeof(UOACZWaterTub)); if (!foundContainer) { foreach (Item item in items) { UOACZWaterTub waterContainer = item as UOACZWaterTub; if (waterContainer.Charges < waterContainer.MaxCharges) { waterContainer.Charges++; foundContainer = true; player.SendMessage("You gather the water and place it into a water tub."); break; } } } if (!foundContainer) { items = player.Backpack.FindItemsByType(typeof(UOACZTub)); UOACZTub waterContainer = null; foreach (Item item in items) { waterContainer = item as UOACZTub; foundContainer = true; break; } if (waterContainer != null) { int oldX = waterContainer.X; int oldY = waterContainer.Y; if (waterContainer != null) { waterContainer.Delete(); UOACZWaterTub newWaterTub = new UOACZWaterTub(); newWaterTub.Charges = 1; player.Backpack.DropItem(newWaterTub); newWaterTub.X = oldX; newWaterTub.Y = oldY; player.SendMessage("You gather the water and place it into an empty tub."); } } } if (!foundContainer) { items = player.Backpack.FindItemsByType(typeof(UOACZBottleOfWater)); foreach (Item item in items) { UOACZBottleOfWater waterContainer = item as UOACZBottleOfWater; if (waterContainer.Charges < waterContainer.MaxCharges) { waterContainer.Charges++; foundContainer = true; player.SendMessage("You gather the water and add it to an existing bottle of water."); break; } } } if (!foundContainer) { Item item = player.Backpack.FindItemByType(typeof(Bottle)); if (item != null) { Bottle bottle = item as Bottle; if (bottle.Amount == 1) { bottle.Delete(); } else { bottle.Amount--; } UOACZBottleOfWater newBottleOfWater = new UOACZBottleOfWater(); player.Backpack.DropItem(newBottleOfWater); foundContainer = true; player.SendMessage("You gather the water and place it into an empty bottle."); } } if (!foundContainer) { items = player.Backpack.FindItemsByType(typeof(UOACZGlass)); UOACZGlass waterContainer = null; foreach (Item item in items) { waterContainer = item as UOACZGlass; foundContainer = true; break; } if (waterContainer != null) { int oldX = waterContainer.X; int oldY = waterContainer.Y; if (waterContainer != null) { waterContainer.Delete(); UOACZGlassOfWater newWaterGlass = new UOACZGlassOfWater(); newWaterGlass.Charges = 1; player.Backpack.DropItem(newWaterGlass); newWaterGlass.X = oldX; newWaterGlass.Y = oldY; player.SendMessage("You gather the water and place it into an empty glass."); } } } if (foundContainer) { player.Animate(32, 5, 1, true, false, 0); player.PlaySound(0x4d1); Charges--; UOACZPersistance.CheckAndCreateUOACZAccountEntry(player); player.m_UOACZAccountEntry.ScavengeableWaterItems++; } else { player.SendMessage("You must have a empty bottle, empty glass, or water tub available in order to gather water."); } }
protected override void OnTick() { bool location1 = false; bool location2 = false; if (!m_Mobile.Alive || m_Mobile.NetState == null || !(m_Mobile.Mount is Gryphon)) { m_Mobile.Animate(23, 5, 1, true, false, 0); Stop(); } else if (d == 0) { Tile landTile = m_Mobile.Map.Tiles.GetLandTile(m_Mobile.X, m_Mobile.Y); if (landTile.Z >= (m_Mobile.Z - 5)) { location1 = true; } if (location1) { m_Mobile.CloseGump(typeof(Gryphongump)); m_Mobile.SendGump(new Gryphongump(m_Mobile, 0)); Stop(); } else { if (anim <= 0) { animateflying(m_Mobile); anim = 2; } else { anim -= 1; } Start(); } } else if (d == 1) { Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles((m_Mobile.X - 1), (m_Mobile.Y - 1), true); Tile landTile = m_Mobile.Map.Tiles.GetLandTile(m_Mobile.X, m_Mobile.Y); for (int i = 0; i < tiles.Length; ++i) { Tile tile = tiles[i]; if (tile.Z >= (m_Mobile.Z - 5)) { location1 = true; } } if (landTile.Z >= (m_Mobile.Z - 5)) { location1 = true; location2 = true; } if (location1) { m_Mobile.CloseGump(typeof(Gryphongump)); m_Mobile.SendGump(new Gryphongump(m_Mobile, 0)); if (location2) { Stop(); } else { d = 0; Start(); } } else { if (anim <= 0) { animateflying(m_Mobile); anim = 2; } else { anim -= 1; } m_Mobile.Direction |= Direction.Running; m_Mobile.X -= 1; m_Mobile.Y -= 1; Start(); } } else if (d == 2) { Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles((m_Mobile.X), (m_Mobile.Y - 1), true); Tile landTile = m_Mobile.Map.Tiles.GetLandTile(m_Mobile.X, m_Mobile.Y); for (int i = 0; i < tiles.Length; ++i) { Tile tile = tiles[i]; if (tile.Z >= (m_Mobile.Z - 5)) { location1 = true; } } if (landTile.Z >= (m_Mobile.Z - 5)) { location1 = true; location2 = true; } if (location1) { m_Mobile.CloseGump(typeof(Gryphongump)); m_Mobile.SendGump(new Gryphongump(m_Mobile, 0)); if (location2) { Stop(); } else { d = 0; Start(); } } else { if (anim <= 0) { animateflying(m_Mobile); anim = 2; } else { anim -= 1; } m_Mobile.Direction |= Direction.Running; m_Mobile.Y -= 1; Start(); } } else if (d == 3) { Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles((m_Mobile.X + 1), (m_Mobile.Y - 1), true); Tile landTile = m_Mobile.Map.Tiles.GetLandTile(m_Mobile.X, m_Mobile.Y); for (int i = 0; i < tiles.Length; ++i) { Tile tile = tiles[i]; if (tile.Z >= (m_Mobile.Z - 5)) { location1 = true; } } if (landTile.Z >= (m_Mobile.Z - 5)) { location1 = true; location2 = true; } if (location1) { m_Mobile.CloseGump(typeof(Gryphongump)); m_Mobile.SendGump(new Gryphongump(m_Mobile, 0)); if (location2) { Stop(); } else { d = 0; Start(); } } else { if (anim <= 0) { animateflying(m_Mobile); anim = 2; } else { anim -= 1; } m_Mobile.Direction |= Direction.Running; m_Mobile.X += 1; m_Mobile.Y -= 1; Start(); } } else if (d == 4) { Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles((m_Mobile.X + 1), (m_Mobile.Y), true); Tile landTile = m_Mobile.Map.Tiles.GetLandTile(m_Mobile.X, m_Mobile.Y); for (int i = 0; i < tiles.Length; ++i) { Tile tile = tiles[i]; if (tile.Z >= (m_Mobile.Z - 5)) { location1 = true; } } if (landTile.Z >= (m_Mobile.Z - 5)) { location1 = true; location2 = true; } if (location1) { m_Mobile.CloseGump(typeof(Gryphongump)); m_Mobile.SendGump(new Gryphongump(m_Mobile, 0)); if (location2) { Stop(); } else { d = 0; Start(); } } else { if (anim <= 0) { animateflying(m_Mobile); anim = 2; } else { anim -= 1; } m_Mobile.Direction |= Direction.Running; m_Mobile.X += 1; Start(); } } else if (d == 5) { Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles((m_Mobile.X + 1), (m_Mobile.Y + 1), true); Tile landTile = m_Mobile.Map.Tiles.GetLandTile(m_Mobile.X, m_Mobile.Y); for (int i = 0; i < tiles.Length; ++i) { Tile tile = tiles[i]; if (tile.Z >= (m_Mobile.Z - 5)) { location1 = true; } } if (landTile.Z >= (m_Mobile.Z - 5)) { location1 = true; location2 = true; } if (location1) { m_Mobile.CloseGump(typeof(Gryphongump)); m_Mobile.SendGump(new Gryphongump(m_Mobile, 0)); if (location2) { Stop(); } else { d = 0; Start(); } } else { if (anim <= 0) { animateflying(m_Mobile); anim = 2; } else { anim -= 1; } m_Mobile.Direction |= Direction.Running; m_Mobile.X += 1; m_Mobile.Y += 1; Start(); } } else if (d == 6) { Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles((m_Mobile.X), (m_Mobile.Y + 1), true); Tile landTile = m_Mobile.Map.Tiles.GetLandTile(m_Mobile.X, m_Mobile.Y); for (int i = 0; i < tiles.Length; ++i) { Tile tile = tiles[i]; if (tile.Z >= (m_Mobile.Z - 5)) { location1 = true; } } if (landTile.Z >= (m_Mobile.Z - 5)) { location1 = true; location2 = true; } if (location1) { m_Mobile.CloseGump(typeof(Gryphongump)); m_Mobile.SendGump(new Gryphongump(m_Mobile, 0)); if (location2) { Stop(); } else { d = 0; Start(); } } else { if (anim <= 0) { animateflying(m_Mobile); anim = 2; } else { anim -= 1; } m_Mobile.Direction |= Direction.Running; m_Mobile.Y += 1; Start(); } } else if (d == 7) { Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles((m_Mobile.X - 1), (m_Mobile.Y + 1), true); Tile landTile = m_Mobile.Map.Tiles.GetLandTile(m_Mobile.X, m_Mobile.Y); for (int i = 0; i < tiles.Length; ++i) { Tile tile = tiles[i]; if (tile.Z >= (m_Mobile.Z - 5)) { location1 = true; } } if (landTile.Z >= (m_Mobile.Z - 5)) { location1 = true; location2 = true; } if (location1) { m_Mobile.CloseGump(typeof(Gryphongump)); m_Mobile.SendGump(new Gryphongump(m_Mobile, 0)); if (location2) { Stop(); } else { d = 0; Start(); } } else { if (anim <= 0) { animateflying(m_Mobile); anim = 2; } else { anim -= 1; } m_Mobile.Direction |= Direction.Running; m_Mobile.X -= 1; m_Mobile.Y += 1; Start(); } } else if (d == 8) { Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles((m_Mobile.X - 1), (m_Mobile.Y), true); Tile landTile = m_Mobile.Map.Tiles.GetLandTile(m_Mobile.X, m_Mobile.Y); for (int i = 0; i < tiles.Length; ++i) { Tile tile = tiles[i]; if (tile.Z >= (m_Mobile.Z - 5)) { location1 = true; } } if (landTile.Z >= (m_Mobile.Z - 5)) { location1 = true; location2 = true; } if (location1) { m_Mobile.CloseGump(typeof(Gryphongump)); m_Mobile.SendGump(new Gryphongump(m_Mobile, 0)); if (location2) { Stop(); } else { d = 0; Start(); } } else { if (anim <= 0) { animateflying(m_Mobile); anim = 2; } else { anim -= 1; } m_Mobile.Direction |= Direction.Running; m_Mobile.X -= 1; Start(); } } else if (d == 9) { Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles((m_Mobile.X), (m_Mobile.Y), true); Tile landTile = m_Mobile.Map.Tiles.GetLandTile(m_Mobile.X, m_Mobile.Y); for (int i = 0; i < tiles.Length; ++i) { Tile tile = tiles[i]; if (tile.Z >= (m_Mobile.Z + 5)) { location1 = true; } } if (landTile.Z >= (m_Mobile.Z + 5)) { location1 = true; } if (location1 || checkmap(m_Mobile)) { m_Mobile.CloseGump(typeof(Gryphongump)); m_Mobile.SendGump(new Gryphongump(m_Mobile, 0)); Start(); } else { if (anim <= 0) { animateflying(m_Mobile); anim = 2; } else { anim -= 1; } m_Mobile.Direction |= Direction.Running; m_Mobile.Z += 1; Start(); } } else if (d == 10) { Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles((m_Mobile.X), (m_Mobile.Y), true); Tile landTile = m_Mobile.Map.Tiles.GetLandTile(m_Mobile.X, m_Mobile.Y); for (int i = 0; i < tiles.Length; ++i) { Tile tile = tiles[i]; if (tile.Z >= (m_Mobile.Z - 6)) { location1 = true; } } if (landTile.Z >= (m_Mobile.Z - 6)) { location1 = true; } if (location1) { m_Mobile.CloseGump(typeof(Gryphongump)); m_Mobile.SendGump(new Gryphongump(m_Mobile, 0)); m_Mobile.Animate(23, 5, 1, true, false, 0); Stop(); } else { if (anim <= 0) { animateflying(m_Mobile); anim = 2; } else { anim -= 1; } m_Mobile.Direction |= Direction.Running; m_Mobile.Z -= 1; Start(); } } else { Stop(); } }
protected override void OnTick() { if (m_RepairHammer == null || m_Player == null) { if (m_RepairHammer != null) { m_RepairHammer.m_Owner = null; } if (m_RepairHammer != null) { m_Player.EndAction(typeof(UOACZRepairHammer)); } Stop(); return; } if (m_RepairHammer.Deleted || m_Player.Deleted) { m_RepairHammer.m_Owner = null; m_Player.EndAction(typeof(UOACZRepairHammer)); Stop(); return; } List <UOACZBreakableStatic> m_NearbyBreakableStatics = GetNearbyBreakableStatics(m_Player); if (m_NearbyBreakableStatics.Count == 0) { m_RepairHammer.m_Owner = null; m_Player.EndAction(typeof(UOACZRepairHammer)); Stop(); return; } UOACZBreakableStatic randomBreakableStatic = m_NearbyBreakableStatics[Utility.RandomMinMax(0, m_NearbyBreakableStatics.Count - 1)]; int repairableCount = 0; foreach (UOACZBreakableStatic breakableStatic in m_NearbyBreakableStatics) { if (breakableStatic.CanRepair(m_Player, m_RepairHammer, 1.0, false)) { repairableCount++; } } if (repairableCount == 0) { m_RepairHammer.m_Owner = null; m_Player.EndAction(typeof(UOACZRepairHammer)); m_Player.SendMessage("You stop making repairs."); Stop(); return; } if (m_RepairTicks == 0) { m_Player.BeginAction(typeof(BreakableStatic)); TimeSpan repairCooldown = TimeSpan.FromSeconds(RepairActionTickDuration.TotalSeconds * (double)RepairActionTicksNeeded); Timer.DelayCall(repairCooldown, delegate { if (m_Player != null) { m_Player.EndAction(typeof(BreakableStatic)); } }); } m_RepairTicks++; if (randomBreakableStatic.RepairSound != -1) { Effects.PlaySound(m_Player.Location, m_Player.Map, randomBreakableStatic.RepairSound); } m_Player.Animate(12, 5, 1, true, false, 0); m_Player.RevealingAction(); if (m_RepairTicks >= UOACZRepairHammer.RepairActionTicksNeeded) { m_RepairTicks = 0; int minRepairAmount = 40; int maxRepairAmount = 60; double baseRepairScalarBonus = 1.0; double carpentryScalar = 1 + (baseRepairScalarBonus * m_Player.Skills.Carpentry.Value / 100); double blacksmithingScalar = 1 + (baseRepairScalarBonus * m_Player.Skills.Carpentry.Value / 100); double tinkeringScalar = 1 + (baseRepairScalarBonus * m_Player.Skills.Carpentry.Value / 100); double bestScalar = 1; if (carpentryScalar > bestScalar) { bestScalar = carpentryScalar; } if (blacksmithingScalar > bestScalar) { bestScalar = blacksmithingScalar; } if (tinkeringScalar > bestScalar) { bestScalar = tinkeringScalar; } double repairValue = m_Player.GetSpecialAbilityEntryValue(SpecialAbilityEffect.EmergencyRepairs); bestScalar += repairValue; bool outpostWasRepaired = false; foreach (UOACZBreakableStatic breakableStatic in m_NearbyBreakableStatics) { int repairAmount = Utility.RandomMinMax(minRepairAmount, maxRepairAmount); repairAmount = (int)(Math.Round(((double)repairAmount * bestScalar))); if (breakableStatic.RequiresFullRepair) { BreakableStatic.DamageStateType damageState = breakableStatic.DamageState; breakableStatic.HitPoints += repairAmount; breakableStatic.PublicOverheadMessage(MessageType.Regular, UOACZSystem.greenTextHue, false, "+" + repairAmount); if (breakableStatic.HitPoints < breakableStatic.MaxHitPoints) { breakableStatic.DamageState = damageState; } else { breakableStatic.DamageState = BreakableStatic.DamageStateType.Normal; } } else { breakableStatic.HitPoints += repairAmount; breakableStatic.PublicOverheadMessage(MessageType.Regular, UOACZSystem.greenTextHue, false, "+" + repairAmount); } UOACZPersistance.CheckAndCreateUOACZAccountEntry(m_Player); m_Player.m_UOACZAccountEntry.TotalRepairAmount += repairAmount; m_Player.SendMessage("You repair an object for " + repairAmount.ToString() + " hitpoints."); if (UOACZPersistance.m_OutpostComponents.Contains(breakableStatic)) { outpostWasRepaired = true; UOACZEvents.RepairOutpostComponent(); } } UOACZPersistance.CheckAndCreateUOACZAccountEntry(m_Player); m_Player.m_UOACZAccountEntry.TimesRepaired++; bool scored = false; double scoreChance = UOACZSystem.HumanRepairScoreChance; if (outpostWasRepaired) { scoreChance += UOACZSystem.HumanOutpostRepairScoreChance; } if (Utility.RandomDouble() <= UOACZSystem.HumanRepairScoreChance) { UOACZSystem.ChangeStat(m_Player, UOACZSystem.UOACZStatType.HumanScore, 1, true); scored = true; } if (m_Player.Backpack != null) { if (Utility.RandomDouble() <= UOACZSystem.HumanRepairSurvivalStoneChance * UOACZPersistance.HumanBalanceScalar) { m_Player.Backpack.DropItem(new UOACZSurvivalStone(m_Player)); m_Player.SendMessage(UOACZSystem.greenTextHue, "You have earned a survival stone for your repair efforts!"); } if (Utility.RandomDouble() <= UOACZSystem.HumanRepairUpgradeTokenChance * UOACZPersistance.HumanBalanceScalar) { m_Player.Backpack.DropItem(new UOACZHumanUpgradeToken(m_Player)); m_Player.SendMessage(UOACZSystem.greenTextHue, "You have earned an upgrade token for your repair efforts!"); } } m_RepairHammer.Charges--; if (m_RepairHammer.Charges <= 0) { m_RepairHammer.Delete(); } } }
public override void OnDoubleClick(Mobile from) { base.OnDoubleClick(from); PlayerMobile player = from as PlayerMobile; if (player == null) { return; } if (!IsChildOf(player.Backpack)) { from.SendMessage("That item must be in your pack in order to use it."); return; } if (!player.Young) { player.SendMessage("Only Young players may use this."); return; } if (player.Region is NewbieDungeonRegion) { player.SendMessage("You are already inside the newbie dungeon."); return; } if (!from.CanBeginAction(typeof(NewbieDungeonRune))) { from.SendMessage("You may only teleport to the newbie dungeon once every 10 minutes."); return; } if (Server.Misc.WeightOverloading.IsOverloaded(from)) { from.SendMessage("Thou art too encumbered to use this item at the moment."); return; } if (from.Criminal) { from.SendMessage("You are currently a criminal and cannot use this item at the moment."); return; } if (!SpellHelper.CheckTravel(from, TravelCheckType.RecallFrom)) { from.SendMessage("Usage of that item is not allowed in this region."); return; } if (DateTime.UtcNow < player.LastPlayerCombatTime + TimeSpan.FromSeconds(30)) { string timeRemaining = Utility.CreateTimeRemainingString(DateTime.UtcNow, player.LastPlayerCombatTime + TimeSpan.FromSeconds(30), false, true, true, true, true); player.SendMessage("You have been in combat too recently and must wait another " + timeRemaining + " before you may use this again."); return; } if (DateTime.UtcNow < player.LastPlayerCombatTime + TimeSpan.FromSeconds(60)) { string timeRemaining = Utility.CreateTimeRemainingString(DateTime.UtcNow, player.LastPlayerCombatTime + TimeSpan.FromSeconds(60), false, true, true, true, true); player.SendMessage("You have been in player-versus-player combat too recently and must wait another " + timeRemaining + " before you may use this again."); return; } Point3D location = player.Location; Map map = player.Map; player.SendMessage("You begin the teleportation ritual."); player.RevealingAction(); player.BeginAction(typeof(NewbieDungeonRune)); SpecialAbilities.HinderSpecialAbility(1.0, null, player, 1.0, 5, true, 0, false, "", "", "-1"); for (int a = 0; a < 5; a++) { Timer.DelayCall(TimeSpan.FromSeconds(a * 1), delegate { if (player == null) { return; } if (player.Deleted || !player.Alive) { player.EndAction(typeof(NewbieDungeonRune)); return; } player.Animate(17, 7, 1, true, false, 0); }); } Timer.DelayCall(TimeSpan.FromSeconds(5.05), delegate { if (player == null) { return; } if (player.Deleted || !player.Alive) { player.EndAction(typeof(NewbieDungeonRune)); return; } if (DateTime.UtcNow < player.LastPlayerCombatTime + TimeSpan.FromSeconds(30)) { string timeRemaining = Utility.CreateTimeRemainingString(DateTime.UtcNow, player.LastPlayerCombatTime + TimeSpan.FromSeconds(30), false, true, true, true, true); player.SendMessage("You have been in combat too recently and must wait another " + timeRemaining + " before you may use this again."); player.EndAction(typeof(NewbieDungeonRune)); return; } if (DateTime.UtcNow < player.LastPlayerCombatTime + TimeSpan.FromSeconds(60)) { string timeRemaining = Utility.CreateTimeRemainingString(DateTime.UtcNow, player.LastPlayerCombatTime + TimeSpan.FromSeconds(60), false, true, true, true, true); player.SendMessage("You have been in player-versus-player combat too recently and must wait another " + timeRemaining + " before you may use this again."); player.EndAction(typeof(NewbieDungeonRune)); return; } player.Location = newbieDungeonTeleportLocation; player.Map = newbieDungeonMap; player.SendSound(0x652); player.SendMessage("You teleport to the newbie dungeon."); Timer.DelayCall(Cooldown, delegate { if (player != null) { player.EndAction(typeof(NewbieDungeonRune)); } }); }); }
public void Target(Corpse c) { Mobile m = c.Owner; if (m == null) { } else if (!Caster.CanSee(c)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (m == Caster) { Caster.SendLocalizedMessage(501039); // Thou can not resurrect thyself. } else if (!Caster.Alive) { Caster.SendLocalizedMessage(501040); // The resurrecter must be alive. } else if (m.Alive) { Caster.SendLocalizedMessage(501041); // Target is not dead. } else if (!Caster.InRange(c, 1)) { Caster.SendLocalizedMessage(501042); // Target is not close enough. } else if (!m.Player) { Caster.SendLocalizedMessage(501043); // Target is not a being. } else if (CheckBSequence(m, true)) { PlayerMobile pm = m as PlayerMobile; if (pm != null) { SpellHelper.Turn(Caster, pm); pm.PlaySound(0x214); Effects.SendTargetEffect(pm, 0x376A, 10, 16); if (pm.MortEngine.TimerEvanouie != null) { pm.MortEngine.TimerEvanouie.Stop(); pm.MortEngine.TimerEvanouie = null; } if (pm.MortEngine.TimerMort != null) { pm.MortEngine.TimerMort.Stop(); pm.MortEngine.TimerMort = null; } pm.Location = c.Location; pm.MortEngine.EndroitMort = c.Location; pm.MortEngine.RisqueDeMort = false; pm.MortEngine.Mort = false; pm.Frozen = false; ArrayList list = new ArrayList(); foreach (Item item in c.Items) { list.Add(item); } foreach (Item item in list) { if (item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) { item.Delete(); } if (item is RaceSkin || c.EquipItems.Contains(item)) { if (!pm.EquipItem(item)) { pm.AddToBackpack(item); } } else { pm.AddToBackpack(item); } } pm.Direction = c.Direction; pm.Animate(21, 5, 1, false, false, 0); c.Delete(); pm.Resurrect(); pm.CheckRaceSkin(); } } FinishSequence(); }
public override void OnCast() { if (Caster == null || Caster.Deleted || !Caster.Alive) { return; } foreach (Item itema in Caster.GetItemsInRange(1 + (int)(Caster.Skills[SkillName.ArtMagique].Base / 10))) { if (itema != null && itema is Corpse) { Corpse c = (Corpse)itema; if (c != null && c.Owner != null && c.Owner is PlayerMobile) { PlayerMobile pm = (PlayerMobile)(c.Owner); if (pm.MortEngine.MortCurrentState == MortState.Assomage) { //pm.AddFatigue(-100); SpellHelper.Turn(Caster, pm); pm.PlaySound(0x214); Effects.SendTargetEffect(pm, 0x376A, 10, 16); if (pm.MortEngine.TimerEvanouie != null) { pm.MortEngine.TimerEvanouie.Stop(); pm.MortEngine.TimerEvanouie = null; } if (pm.MortEngine.TimerMort != null) { pm.MortEngine.TimerMort.Stop(); pm.MortEngine.TimerMort = null; } pm.Location = c.Location; pm.MortEngine.EndroitMort = c.Location; pm.MortEngine.RisqueDeMort = false; pm.MortEngine.Mort = false; pm.Frozen = false; pm.Direction = c.Direction; pm.MoveToWorld(c.Location, c.Map); pm.Animate(21, 5, 1, false, false, 0); pm.Resurrect(); if (c != null) { ArrayList list = new ArrayList(); foreach (Item item in c.Items) { list.Add(item); } foreach (Item item in list) { if (item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) { item.Delete(); } if (item is RaceSkin || c.EquipItems.Contains(item)) { if (!pm.EquipItem(item)) { pm.AddToBackpack(item); } } else { pm.AddToBackpack(item); } } } pm.CheckRaceSkin(); pm.CheckStatTimers(); pm.MortEngine.MortCurrentState = MortState.Ebranle; } } } } }
public static void ResolvePotion(PlayerMobile player, Mobile mobileTarget, CustomAlchemyPotion potion) { if (!SpecialAbilities.Exists(player)) { return; } if (!SpecialAbilities.Exists(mobileTarget)) { return; } bool positiveEffect = potion.PositiveEffect; CustomAlchemy.EffectType primaryEffect = potion.PrimaryEffect; CustomAlchemy.EffectType secondaryEffect = potion.SecondaryEffect; CustomAlchemy.EffectPotencyType potencyType = potion.EffectPotency; int throwSound = 0x5D3; int itemID = potion.ItemID; int itemHue = potion.Hue; int hitSound = Utility.RandomList(0x38E, 0x38F, 0x390); int effectSound = 0x5D8; ConsumePotion(player, potion); SpecialAbilities.HinderSpecialAbility(1.0, null, player, 1.0, 0.75, true, 0, false, "", "", "-1"); Point3D location = player.Location; Map map = player.Map; Point3D targetLocation = mobileTarget.Location; Map targetMap = mobileTarget.Map; bool drinkPotion = false; if (positiveEffect && player == mobileTarget && potencyType == EffectPotencyType.Target) { drinkPotion = true; } if (drinkPotion) { player.Animate(34, 5, 1, true, false, 0); Effects.PlaySound(player.Location, player.Map, Utility.RandomList(0x4CC, 0x4CD, 0x030, 0x031)); } else { player.Animate(31, 7, 1, true, false, 0); Effects.PlaySound(player.Location, player.Map, throwSound); } Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate { if (!SpecialAbilities.Exists(player)) { return; } //Update Target Location if MobileTarget still Valid if (mobileTarget != null && !drinkPotion) { if (Utility.GetDistance(mobileTarget.Location, targetLocation) < 20 && mobileTarget.Map == targetMap) { targetLocation = mobileTarget.Location; } } double distance = Utility.GetDistance(location, targetLocation); double destinationDelay = (double)distance * .04; IEntity startLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 5), map); IEntity endLocation = new Entity(Serial.Zero, new Point3D(targetLocation.X, targetLocation.Y, targetLocation.Z + 5), targetMap); if (drinkPotion) { destinationDelay = 0; } else { Effects.SendMovingEffect(startLocation, endLocation, itemID, 10, 0, false, false, itemHue, 0); } Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { //Update Target Location if MobileTarget still Valid if (mobileTarget != null && !drinkPotion) { if (Utility.GetDistance(mobileTarget.Location, targetLocation) < 20 && mobileTarget.Map == targetMap) { targetLocation = mobileTarget.Location; } } int primaryEffectItemId = 0x3709; int primaryEffectHue = 0; int primaryEffectSound = 0x208; int secondaryEffectItemId = 0x3709; int secondaryEffectHue = 0; int secondaryEffectSound = 0x208; List <Point3D> m_EffectLocations = new List <Point3D>(); if (drinkPotion && SpecialAbilities.Exists(player)) { m_EffectLocations.Add(player.Location); } else { int radius = 0; switch (potencyType) { case EffectPotencyType.SmallAoE: radius = 2; break; case EffectPotencyType.MediumAoE: radius = 4; break; case EffectPotencyType.LargeAoE: radius = 6; break; } int minRange = -1 * radius; int maxRange = radius + 1; for (int a = minRange; a < maxRange; a++) { for (int b = minRange; b < maxRange; b++) { Point3D newLocation = new Point3D(targetLocation.X + a, targetLocation.Y + b, targetLocation.Z); if (!m_EffectLocations.Contains(newLocation)) { m_EffectLocations.Add(newLocation); } } } } foreach (Point3D point in m_EffectLocations) { Effects.SendLocationParticles(EffectItem.Create(point, map, TimeSpan.FromSeconds(0.25)), primaryEffectItemId, 10, 30, primaryEffectHue, 0, 5029, 0); //Effect } /* * //Positive * StrengthIncrease, * DexterityIncrease, * IntelligenceIncrease, * HitsRegenIncrease, * StamRegenIncrease, * ManaRegenIncrease, * MeleeDamageDealtIncrease, * MeleeDamageResistIncrease, * SpellDamageDealtIncrease, * SpellDamageResistIncrease, * AccuracyIncrease, * EvasionIncrease, * * //Negative * Entangle, * Petrify, * FireDamage, * FrostDamage, * AbyssalDamage, * ShockDamage, * EarthDamage, * BleedDamage, * Disease, * Poison, * AccuracyReduction, * EvasionReduction * * Target, * SmallAoE, * MediumAoE, * LargeAoE */ if (drinkPotion) { } }); }); }
protected override void OnTarget(Mobile from, object target) { PlayerMobile player = from as PlayerMobile; if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } if (!player.IsUOACZHuman) { return; } if (m_OilFlask == null) { return; } if (m_OilFlask.Deleted) { return; } if (!m_OilFlask.IsChildOf(from.Backpack)) { from.SendMessage("The oil flask is no longer in your pack."); return; } IPoint3D location = target as IPoint3D; if (location == null) { return; } Map map = player.Map; if (map == null) { return; } SpellHelper.GetSurfaceTop(ref location); if (location is Mobile) { targetLocation = (Mobile)location; } else { targetLocation = new Entity(Serial.Zero, new Point3D(location), map); } if (Utility.GetDistance(player.Location, targetLocation.Location) > ThrowRange) { player.SendMessage("That location is too far away."); return; } if (!player.Map.InLOS(player.Location, targetLocation.Location)) { player.SendMessage("That is not within in your line of sight."); return; } player.RevealingAction(); SpecialAbilities.HinderSpecialAbility(1.0, null, player, 1.0, 1, true, 0, false, "", "", "-1"); m_OilFlask.Delete(); player.Animate(31, 7, 1, true, false, 0); Timer.DelayCall(usageCooldown, delegate { if (player != null) { player.EndAction(typeof(UOACZOilFlask)); } }); int throwSound = 0x5D3; int hitSound = Utility.RandomList(0x38E, 0x38F, 0x390); int effectSound = 0x5D8; int itemID = 7192; int itemHue = 0; int radius = 2; double additionalOilChance = .5; Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate { if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } if (!player.IsUOACZHuman) { return; } Effects.PlaySound(player.Location, player.Map, throwSound); IEntity startLocation = new Entity(Serial.Zero, new Point3D(player.Location.X, player.Location.Y, player.Location.Z + 5), player.Map); IEntity endLocation = new Entity(Serial.Zero, new Point3D(targetLocation.Location.X, targetLocation.Location.Y, targetLocation.Location.Z + 5), targetLocation.Map); Effects.SendMovingEffect(startLocation, endLocation, itemID, 10, 0, false, false, itemHue, 0); //5 double distance = player.GetDistanceToSqrt(endLocation.Location); double destinationDelay = (double)distance * .06; //.08 Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (!UOACZPersistance.Active) { return; } Effects.PlaySound(endLocation.Location, endLocation.Map, hitSound); for (int a = -1 * radius; a < radius + 1; a++) { for (int b = -1 * radius; b < radius + 1; b++) { Point3D newPoint = new Point3D(endLocation.Location.X + a, endLocation.Location.Y + b, endLocation.Location.Z); SpellHelper.AdjustField(ref newPoint, map, 12, false); if (!map.InLOS(endLocation.Location, newPoint)) { continue; } double distanceFromCenter = Utility.GetDistanceToSqrt(endLocation.Location, newPoint); bool validLocation = true; double extraOilChance = 1; if (distanceFromCenter >= 1) { extraOilChance = (1 / (distanceFromCenter)) * additionalOilChance; } if (Utility.RandomDouble() <= extraOilChance) { Timer.DelayCall(TimeSpan.FromSeconds(distanceFromCenter * .1), delegate { if (!UOACZPersistance.Active) { return; } bool foundAnother = false; IPooledEnumerable nearbyItems = map.GetItemsInRange(newPoint, 0); foreach (Item item in nearbyItems) { if (item is UOACZOilLocation) { foundAnother = true; break; } } nearbyItems.Free(); if (!foundAnother) { Effects.PlaySound(newPoint, map, effectSound); new UOACZOilLocation().MoveToWorld(newPoint, map); } }); } } } }); }); }
private static void Honor(PlayerMobile source, Mobile target) { IHonorTarget honorTarget = target as IHonorTarget; GuardedRegion reg = (GuardedRegion)source.Region.GetRegion(typeof(GuardedRegion)); Map map = source.Map; if (honorTarget == null) { return; } if (honorTarget.ReceivedHonorContext != null) { if (honorTarget.ReceivedHonorContext.Source == source) { return; } if (honorTarget.ReceivedHonorContext.CheckDistance()) { source.SendLocalizedMessage(1063233); // Somebody else is honoring this opponent return; } } if (target.Hits < target.HitsMax) { source.SendLocalizedMessage(1063166); // You cannot honor this monster because it is too damaged. return; } BaseCreature cret = target as BaseCreature; if (target.Body.IsHuman && (cret == null || (!cret.AlwaysAttackable && !cret.AlwaysMurderer))) { if (reg == null || reg.IsDisabled()) { //Allow honor on blue if Out of guardzone } else if (map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0) { //Allow honor on blue if in Fel } else { source.SendLocalizedMessage(1001018); // You cannot perform negative acts return; //cannot honor in trammel town on blue } } if (Core.ML && target is PlayerMobile) { source.SendLocalizedMessage(1075614); // You cannot honor other players. return; } if (source.SentHonorContext != null) { source.SentHonorContext.Cancel(); } new HonorContext(source, target); source.Direction = source.GetDirectionTo(target); if (!source.Mounted) { source.Animate(32, 5, 1, true, true, 0); } }
private static void Honor(PlayerMobile source, Mobile target) { IHonorTarget honorTarget = target as IHonorTarget; GuardedRegion reg = (GuardedRegion)source.Region.GetRegion(typeof(GuardedRegion)); Map map = source.Map; if (honorTarget == null) { return; } if (honorTarget.ReceivedHonorContext != null) { if (honorTarget.ReceivedHonorContext.Source == source) { return; } if (honorTarget.ReceivedHonorContext.CheckDistance()) { source.SendLocalizedMessage(1063233); // Somebody else is honoring this opponent return; } } if (target.Hits < target.HitsMax) { source.SendLocalizedMessage(1063166); // You cannot honor this monster because it is too damaged. return; } BaseCreature cret = target as BaseCreature; if (target.Body.IsHuman && (cret == null || (!cret.AlwaysAttackable && !cret.AlwaysMurderer))) { //Cannot honor if in guard zone, or out of felucca ruleset if ((reg != null && !reg.IsDisabled()) || (map != null && (map.Rules & MapRules.HarmfulRestrictions) != 0)) { source.SendLocalizedMessage(1001018); // You cannot perform negative acts return; } } if (Core.ML && target is PlayerMobile) { source.SendLocalizedMessage(1075614); // You cannot honor other players. return; } if (source.SentHonorContext != null) { source.SentHonorContext.Cancel(); } new HonorContext(source, target); source.Direction = source.GetDirectionTo(target); if (!source.Mounted) { source.Animate(32, 5, 1, true, true, 0); } // OSI apparently removed this message... it's nice though //source.Say( 1063231 ); // I honor you }