public override void ApplyEffect( Mobile to, Mobile source, int intensity, Item itemSource ) { if ( source != to ) source.DoHarmful( to ); int chance = Utility.RandomMinMax( 1, 8 ); string sundname = ""; BaseArmor sundered = null; Layer layer = Layer.FirstValid; switch( chance ) { case 1: layer = Layer.InnerTorso; sundname = "armour"; break; case 2: layer = Layer.InnerLegs; sundname = "leggings"; break; case 3: layer = Layer.TwoHanded; sundname = "shield"; break; case 4: layer = Layer.Neck; sundname = "gorget"; break; case 5: layer = Layer.Gloves; sundname = "gauntlets"; break; case 6: layer = Layer.Helm; sundname = "helm"; break; case 7: layer = Layer.Arms; sundname = "arm pads"; break; case 8: layer = Layer.OneHanded; sundname = "weapon"; break; } if( to.FindItemOnLayer( layer ) != null && to.FindItemOnLayer( layer ) is BaseArmor ) sundered = to.FindItemOnLayer( layer ) as BaseArmor; if( sundered != null ) { int amt = (int)(intensity * Divisor); if ( amt <= 0 ) amt = 0; sundered.HitPoints -= Utility.Random( amt ) + 1; if( sundered.HitPoints < 0 ) { sundered.MaxHitPoints += sundered.HitPoints; sundered.HitPoints = 0; if( sundered.MaxHitPoints < 0 ) { sundered.Delete(); to.Emote( "*got {0} {1} destroyed by {2}*", to.Female == true ? "her" : "his", sundname, source.Name ); } } to.Emote( "*got {0} {1} damaged by {2}*", to.Female == true ? "her" : "his", sundname, source.Name ); } }
public override void OnDoubleClick( Mobile from ) { if( from == null || !( from is PlayerMobile ) || from.Deleted || !from.Alive || from.Frozen || from.Paralyzed ) return; PlayerMobile pm = from as PlayerMobile; if( pm.BloodOfXorgoth != null ) { from.SendMessage( "You are already under the effect of Blood of Xorgoth." ); return; } if( from.Backpack != null && this.ParentEntity == from.Backpack ) { BasePotion.PlayDrinkEffectNoBottle( from ); from.Emote( "*lets out a roar after drinking the Blood of Xorgoth*" ); pm.BloodOfXorgoth = new BloodOfXorgothTimer( pm, this.Power ); pm.BloodOfXorgoth.Start(); this.Delete(); Pitcher pitcher = new Pitcher(); from.Backpack.DropItem( pitcher ); } else from.SendMessage( "That needs to be in your backpack for you to use it." ); }
public PitchTentTimer( Mobile m, Item tent ) : base(TimeSpan.FromSeconds( 10 )) { m_m = m; m_tent = tent; m.Emote( "*starts pitching a tent*" ); m_loc = m.Location; m_tent.Movable = false; }
public static void Effect( Mobile attacker, Mobile defender ) { if( attacker == null || defender == null || defender.Weapon is Fists || !((BaseWeapon)defender.Weapon).Movable ) return; if( Utility.RandomBool() && defender.Backpack != null ) { defender.Backpack.DropItem( (BaseWeapon)defender.Weapon ); defender.Emote( "*was disarmed by {0}*", attacker.Name ); } else if ( Utility.RandomBool() && attacker.Backpack != null ) { attacker.Backpack.DropItem( (BaseWeapon)defender.Weapon ); defender.Emote( "*was disarmed by {0}*", attacker.Name ); } else { defender.Emote( "*{0} weapon fell to the ground*", ((IKhaerosMobile)defender).GetPossessivePronoun() ); ((BaseWeapon)defender.Weapon).MoveToWorld( defender.Location, defender.Map ); } }
public override void OnComponentUsed(AddonComponent ac, Mobile from) { if (!from.InRange(GetWorldLocation(), 2)) from.SendMessage("You are too far away."); else { from.Emote("*stirs the brew*"); from.Say("hihihihiiii!"); from.PlaySound(32); if (!from.Mounted) from.Animate(33, 5, 1, true, false, 0); } }
public static void Effect( Mobile defender, int featlevel, int damage, string source ) { if( source == null ) source = ""; BaseWeapon sundered = defender.Weapon as BaseWeapon; sundered.HitPoints -= (int)( damage * (featlevel * 0.20) ); if( sundered.HitPoints < 0 ) { sundered.MaxHitPoints += sundered.HitPoints; sundered.HitPoints = 0; if( sundered.MaxHitPoints < 1 ) { sundered.Delete(); defender.Emote( "*got {0} weapon destroyed{1}*", ((IKhaerosMobile)defender).GetPossessivePronoun(), source ); } } defender.Emote( "*got {0} weapon damaged{1}*", ((IKhaerosMobile)defender).GetPossessivePronoun(), source ); }
public override bool OnEquip( Mobile from ) { Guild g = from.Guild as Guild; if(DefSerUss == 0 && g != null) { DefSerUss = from.Serial; from.Emote( "" + from.Name + ", the robe is now your personal item!" ); this.Name = from.Name +"'s " + this.Name +" [" + g.Abbreviation + "]"; base.OnEquip( from ); return true; } else if (g == null ) { this.Name = "Robe"; this.ItemID = 7939; this.Hue = 0; this.LootType = LootType.Regular; base.OnEquip( from ); return true; } else if(DefSerUss == from.Serial) { from.SendMessage( "Guild Form " + from.Name + " was dressed" ); base.OnEquip( from ); return true; } else { from.Emote( "*It is not your Guild item...!*" ); return false; } }
public static void FinalEffect(Mobile caster, Mobile target, int hold) { target.PlaySound(0x204); target.FixedParticles(0x37C4, 1, 8, 9916, 39, 3, EffectLayer.Head); target.FixedParticles(0x37C4, 1, 8, 9502, 39, 4, EffectLayer.Head); target.Emote("*is rooted to the ground, unmoving*"); target.SendMessage("You are overwhelmed by guilt over your sins."); if (((IKhaerosMobile)target).StunnedTimer != null) ((IKhaerosMobile)target).StunnedTimer.Stop(); ((IKhaerosMobile)target).StunnedTimer = new JusticePrisonTimer(target, hold); ((IKhaerosMobile)target).StunnedTimer.Start(); }
protected override void OnTarget( Mobile from, object targeted ) { if ( targeted is Mobile ) { Mobile targ = (Mobile)targeted; if ( !from.CanSee( targ ) ) { from.SendMessage( "You Cannot See This Target" ); } else { targ.Emote( "* Ohh-Rah! Get Vanqusihed by the Hands of The Ice-God *" ); targ.BoltEffect( 0 ); targ.Damage( Utility.Random( 5, 65 ) ); from.Emote( "* In Rememberance of Old Man Ice-God!*" ); } } }
public override void OnSwing( Mobile attacker, Mobile defender, bool Cleave ) { IKhaerosMobile featuser = attacker as IKhaerosMobile; if( featuser.CanUseMartialPower ) if( BaseWeapon.CheckStam( attacker, FeatLevel, Cleave, false ) ) attacker.Emote( "*focuses and attacks {0} with all {1} strength, in an attempt to stun {2}*", defender.Name, ((IKhaerosMobile)attacker).GetPossessivePronoun(), ((IKhaerosMobile)defender).GetReflexivePronoun() ); }
static void SetAFK(Mobile m, string message) { PlayersAfk.Add((int)m.Serial.Value, new AfkInfo(message, m.Location)); m.Emote("*Is now AFK*"); }
public virtual void DegradeArmour( Mobile defender ) { int chance = Utility.RandomMinMax( 1, 7 ); string sundname = ""; BaseArmor sundered = null; Layer layer = Layer.FirstValid; switch( chance ) { case 1: layer = Layer.InnerTorso; sundname = "armour"; break; case 2: layer = Layer.InnerLegs; sundname = "leggings"; break; case 3: layer = Layer.TwoHanded; sundname = "shield"; break; case 4: layer = Layer.Neck; sundname = "gorget"; break; case 5: layer = Layer.Gloves; sundname = "gauntlets"; break; case 6: layer = Layer.Helm; sundname = "helm"; break; case 7: layer = Layer.Arms; sundname = "arm pads"; break; } if( defender.FindItemOnLayer( layer ) != null && defender.FindItemOnLayer( layer ) is BaseArmor ) { sundered = defender.FindItemOnLayer( layer ) as BaseArmor; } if( sundered != null ) { sundered.HitPoints -= Utility.Random( 3 ); if( sundered.HitPoints < 0 ) { sundered.MaxHitPoints += sundered.HitPoints; sundered.HitPoints = 0; if( sundered.MaxHitPoints < 0 ) { sundered.Delete(); defender.Emote( "*got {0} {1} destroyed by {2}*", defender.Female == true ? "her" : "his", sundname, this.Name ); } } defender.Emote( "*got {0} {1} damaged by {2}*", defender.Female == true ? "her" : "his", sundname, this.Name ); } }
public override void OnSwing( Mobile attacker, Mobile defender, bool Cleave ) { if( BaseWeapon.CheckStam( attacker, FeatLevel, Cleave, false ) ) attacker.Emote( "*steps into {0} and hits {1} in a vital point*", defender.Name, ((IKhaerosMobile)defender).GetReflexivePronoun() ); }
public override void OnDoubleClick(Mobile from) { if (this.RootParentEntity == from && from.HasFreeHand()) { from.PlaySound(0x384); from.Target = new LeechTarget(this); from.Emote("*readies a leech in " + (from.Female ? "her" : "his") + " hand*"); from.SendMessage("Choose a target whose blood you wish to leech."); } else if (this.RootParentEntity != from) from.SendMessage("That must be in your backpack to use it."); else if (!from.HasFreeHand()) from.SendMessage("You must have a free hand to do that."); base.OnDoubleClick(from); }
static void SetBack(Mobile m) { PlayersAfk.Remove((int)m.Serial.Value); m.Emote("*Returns to the game*"); }
public override void OnResponse(Server.Network.NetState sender, RelayInfo info) { int val = info.ButtonID - 1; if (val < 0) { return; } Mobile from = m_From; int type = val % 15; int index = val / 15; switch (type) { case 0: { EmotePage page; switch (index) { case 1: page = EmotePage.P1; break; case 2: page = EmotePage.P2; break; case 3: page = EmotePage.P3; break; case 4: page = EmotePage.P4; break; default: return; } from.SendGump(new EmoteGump(from, page)); break; } case 1: { switch (index) { case 1: { if (from.Female) { from.PlaySound(778); from.Say("Ah!"); } else if (!from.Female) { from.PlaySound(1049); from.Say("Ah!"); } from.SendGump(new EmoteGump(from, EmotePage.P1)); break; } case 2: { if (from.Female) { from.PlaySound(779); from.Say("Ah Ah!"); } else if (!from.Female) { from.PlaySound(1050); from.Say("Ah Ah!"); } from.SendGump(new EmoteGump(from, EmotePage.P1)); break; } case 3: { if (from.Female) { from.PlaySound(780); from.Emote("*clap*"); } else if (!from.Female) { from.PlaySound(1051); from.Emote("*Clap*"); } from.SendGump(new EmoteGump(from, EmotePage.P1)); break; } case 5: { from.Emote("*Bow*"); if (!from.Mounted) { from.Animate(32, 5, 1, true, false, 0); } from.SendGump(new EmoteGump(from, EmotePage.P1)); break; } case 6: { if (from.Female) { from.PlaySound(786); from.Emote("*Cough*"); } else if (!from.Female) { from.PlaySound(1057); from.Emote("*Cough*"); } from.SendGump(new EmoteGump(from, EmotePage.P1)); break; } case 7: { if (from.Female) { from.PlaySound(782); from.Emote("*Burp*"); if (!from.Mounted) { from.Animate(33, 5, 1, true, false, 0); } } else if (!from.Female) { from.PlaySound(1053); from.Emote("*Burp*"); if (!from.Mounted) { from.Animate(33, 5, 1, true, false, 0); } } from.SendGump(new EmoteGump(from, EmotePage.P1)); break; } case 8: { if (from.Female) { from.PlaySound(784); from.Say("Hum hum.."); if (!from.Mounted) { from.Animate(33, 5, 1, true, false, 0); } } else if (!from.Female) { from.PlaySound(1055); from.Say("Hum hum.."); if (!from.Mounted) { from.Animate(33, 5, 1, true, false, 0); } } from.SendGump(new EmoteGump(from, EmotePage.P1)); break; } case 9: { if (from.Female) { from.PlaySound(785); from.Emote("*Cough*"); if (!from.Mounted) { from.Animate(33, 5, 1, true, false, 0); } } else if (!from.Female) { from.PlaySound(1056); from.Emote("*Cough*"); if (!from.Mounted) { from.Animate(33, 5, 1, true, false, 0); } } from.SendGump(new EmoteGump(from, EmotePage.P1)); break; } case 10: { if (from.Female) { from.PlaySound(787); from.Emote("*Cry*"); if (!from.Mounted) { from.Animate(34, 5, 1, true, false, 0); } } else if (!from.Female) { from.PlaySound(1058); from.Emote("*Cry*"); if (!from.Mounted) { from.Animate(34, 5, 1, true, false, 0); } } from.SendGump(new EmoteGump(from, EmotePage.P1)); break; } case 11: { if (from.Female) { from.PlaySound(791); from.Emote("*Fall*"); if (!from.Mounted) { from.Animate(22, 5, 1, true, false, 0); } } else if (!from.Female) { from.PlaySound(1063); from.Emote("*Fall*"); if (!from.Mounted) { from.Animate(22, 5, 1, true, false, 0); } } from.SendGump(new EmoteGump(from, EmotePage.P1)); break; } case 12: { if (from.Female) { from.PlaySound(792); from.Emote("*Fart*"); } else if (!from.Female) { from.PlaySound(1064); from.Emote("*Fall*"); } from.SendGump(new EmoteGump(from, EmotePage.P1)); break; } case 13: { if (from.Female) { from.PlaySound(793); from.Emote("*Gasp*"); } else if (!from.Female) { from.PlaySound(1065); from.Emote("*Gasp*"); } from.SendGump(new EmoteGump(from, EmotePage.P2)); break; } case 14: { if (from.Female) { from.PlaySound(794); from.Emote("*Laught*"); } else if (!from.Female) { from.PlaySound(1066); from.Emote("*Laught*"); } from.SendGump(new EmoteGump(from, EmotePage.P2)); break; } case 15: { if (from.Female) { from.PlaySound(795); from.Emote("*Groan*"); if (!from.Mounted) { from.Animate(6, 5, 1, true, false, 0); } } else if (!from.Female) { from.PlaySound(1067); from.Emote("*Groan*"); if (!from.Mounted) { from.Animate(6, 5, 1, true, false, 0); } } from.SendGump(new EmoteGump(from, EmotePage.P2)); break; } case 16: { if (from.Female) { from.PlaySound(796); from.Emote("*Growl*"); if (!from.Mounted) { from.Animate(6, 5, 1, true, false, 0); } } else if (!from.Female) { from.PlaySound(1068); from.Emote("*Growl*"); if (!from.Mounted) { from.Animate(6, 5, 1, true, false, 0); } } from.SendGump(new EmoteGump(from, EmotePage.P2)); break; } case 17: { if (from.Female) { from.PlaySound(797); from.Say("Hey!"); } else if (!from.Female) { from.PlaySound(1069); from.Say("Hey!"); } from.SendGump(new EmoteGump(from, EmotePage.P2)); break; } case 18: { if (from.Female) { from.PlaySound(798); from.Say("Hic!"); } else if (!from.Female) { from.PlaySound(1070); from.Say("Hic!"); } from.SendGump(new EmoteGump(from, EmotePage.P2)); break; } case 19: { if (from.Female) { from.PlaySound(799); from.Say("Hu?!*"); } else if (!from.Female) { from.PlaySound(1071); from.Say("Hu?!"); } from.SendGump(new EmoteGump(from, EmotePage.P2)); break; } case 20: { if (from.Female) { from.PlaySound(800); from.Emote("*Kiss*"); } else if (!from.Female) { from.PlaySound(1072); from.Emote("*Kiss*"); } from.SendGump(new EmoteGump(from, EmotePage.P2)); break; } case 21: { if (from.Female) { from.PlaySound(801); from.Emote("*Laught*"); } else if (!from.Female) { from.PlaySound(1073); from.Emote("*Laught*"); } from.SendGump(new EmoteGump(from, EmotePage.P2)); break; } case 22: { if (from.Female) { from.PlaySound(802); from.Say("No!"); } else if (!from.Female) { from.PlaySound(1074); from.Say("No!"); } from.SendGump(new EmoteGump(from, EmotePage.P2)); break; } case 23: { if (from.Female) { from.PlaySound(803); from.Say("Oh!"); } else if (!from.Female) { from.PlaySound(1075); from.Say("Oh!"); } from.SendGump(new EmoteGump(from, EmotePage.P2)); break; } case 24: { if (from.Female) { from.PlaySound(811); from.Say("Oooh!"); } else if (!from.Female) { from.PlaySound(1085); from.Say("Oooh!"); } from.SendGump(new EmoteGump(from, EmotePage.P2)); break; } case 25: { if (from.Female) { from.PlaySound(812); from.Say("Oups!"); } else if (!from.Female) { from.PlaySound(1086); from.Say("Oups!"); } from.SendGump(new EmoteGump(from, EmotePage.P3)); break; } case 26: { if (from.Female) { from.PlaySound(813); from.Emote("*Puke*"); if (!from.Mounted) { from.Animate(32, 5, 1, true, false, 0); } } if (!from.Female) { from.PlaySound(1087); from.Emote("*Puke*"); if (!from.Mounted) { from.Animate(32, 5, 1, true, false, 0); } } from.SendGump(new EmoteGump(from, EmotePage.P3)); break; } case 27: { from.PlaySound(315); from.Emote("*Strike*"); if (!from.Mounted) { from.Animate(31, 5, 1, true, false, 0); } from.SendGump(new EmoteGump(from, EmotePage.P3)); break; } case 28: { if (from.Female) { from.PlaySound(814); from.Emote("*Howl*"); } else if (!from.Female) { from.PlaySound(1088); from.Emote("*Howl*"); } from.SendGump(new EmoteGump(from, EmotePage.P3)); break; } case 29: { if (from.Female) { from.PlaySound(815); from.Say("Shuut!"); } else if (!from.Female) { from.PlaySound(1089); from.Say("Shuut!"); } from.SendGump(new EmoteGump(from, EmotePage.P3)); break; } case 30: { if (from.Female) { from.PlaySound(816); from.Emote("*sigh*"); if (!from.Mounted) { from.Animate(6, 5, 1, true, false, 0); } } else if (!from.Female) { from.PlaySound(1090); from.Emote("*Sigh*"); if (!from.Mounted) { from.Animate(6, 5, 1, true, false, 0); } } from.SendGump(new EmoteGump(from, EmotePage.P3)); break; } case 31: { from.PlaySound(948); from.Emote("*Knock*"); if (!from.Mounted) { from.Animate(11, 5, 1, true, false, 0); } from.SendGump(new EmoteGump(from, EmotePage.P3)); break; } case 32: { if (from.Female) { from.PlaySound(817); from.Emote("*Sneeze*"); if (!from.Mounted) { from.Animate(32, 5, 1, true, false, 0); } } else if (!from.Female) { from.PlaySound(1091); from.Emote("*Sneez*"); if (!from.Mounted) { from.Animate(32, 5, 1, true, false, 0); } } from.SendGump(new EmoteGump(from, EmotePage.P3)); break; } case 33: { if (from.Female) { from.PlaySound(818); from.Emote("*Blownose*"); if (!from.Mounted) { from.Animate(34, 5, 1, true, false, 0); } } else if (!from.Female) { from.PlaySound(1092); from.Emote("*blownose*"); if (!from.Mounted) { from.Animate(34, 5, 1, true, false, 0); } } from.SendGump(new EmoteGump(from, EmotePage.P3)); break; } case 34: { if (from.Female) { from.PlaySound(819); from.Emote("*Snore*"); } else if (!from.Female) { from.PlaySound(1093); from.Emote("*Snore*"); } from.SendGump(new EmoteGump(from, EmotePage.P3)); break; } case 35: { if (from.Female) { from.PlaySound(820); from.Emote("*Spit*"); if (!from.Mounted) { from.Animate(6, 5, 1, true, false, 0); } } else if (!from.Female) { from.PlaySound(1094); from.Emote("*Spit*"); if (!from.Mounted) { from.Animate(6, 5, 1, true, false, 0); } } from.SendGump(new EmoteGump(from, EmotePage.P3)); break; } case 36: { from.PlaySound(792); from.Emote("*Fart*"); from.SendGump(new EmoteGump(from, EmotePage.P3)); break; } case 38: { if (from.Female) { from.PlaySound(821); from.Emote("*Wistle*"); if (!from.Mounted) { from.Animate(5, 5, 1, true, false, 0); } } else if (!from.Female) { from.PlaySound(1095); from.Emote("*Wistle*"); if (!from.Mounted) { from.Animate(5, 5, 1, true, false, 0); } } from.SendGump(new EmoteGump(from, EmotePage.P4)); break; } case 39: { if (from.Female) { from.PlaySound(783); from.Say("Wouhou!"); } else if (!from.Female) { from.PlaySound(1054); from.Say("Wouhou!"); } from.SendGump(new EmoteGump(from, EmotePage.P4)); break; } case 40: { if (from.Female) { from.PlaySound(822); from.Emote("*Yawn*"); if (!from.Mounted) { from.Animate(17, 5, 1, true, false, 0); } } else if (!from.Female) { from.PlaySound(1096); from.Emote("*Yawn*"); if (!from.Mounted) { from.Animate(17, 5, 1, true, false, 0); } } from.SendGump(new EmoteGump(from, EmotePage.P4)); break; } case 41: { if (from.Female) { from.PlaySound(823); from.Say("Yeah!"); } else if (!from.Female) { from.PlaySound(1097); from.Say("Yeah!"); } from.SendGump(new EmoteGump(from, EmotePage.P4)); break; } case 42: { if (from.Female) { from.PlaySound(824); from.Emote("*Yell*"); } else if (!from.Female) { from.PlaySound(1098); from.Emote("*Yell*"); } from.SendGump(new EmoteGump(from, EmotePage.P4)); break; } case 43: { if (from.Female) { from.PlaySound(1385); from.Emote("*Fall into a hole*"); } else if (!from.Female) { from.PlaySound(1385); from.Emote("*Fall into a hole*"); } from.SendGump(new EmoteGump(from, EmotePage.P4)); break; } } break; } } }
public override void OnSwing( Mobile attacker, Mobile defender, bool Cleave ) { IKhaerosMobile featuser = attacker as IKhaerosMobile; if ( attacker.Mounted ) { attacker.SendMessage( 60, "You cannot perform this maneuver while mounted." ); featuser.DisableManeuver(); } else if ( ((IKhaerosMobile)defender).TrippedTimer != null || CombatSystemAttachment.GetCSA( defender ).PerformingSequence ) { attacker.SendMessage( 60, "You cannot trip them right now." ); featuser.DisableManeuver(); } else if( ((BaseWeapon)attacker.Weapon).Skill == SkillName.Polearms ) if( BaseWeapon.CheckStam( attacker, FeatLevel, Cleave, false ) ) attacker.Emote( "*swings {0} polearm in an attempt to trip {1}*", ((IKhaerosMobile)attacker).GetPossessivePronoun(), defender.Name ); else { attacker.SendMessage( 60, "You need to be equipping a polearm in order to perform this attack." ); featuser.DisableManeuver(); } }
public InUseTimer(Mobile m, FootTrap trap, int featlevel) : base(TimeSpan.FromSeconds(featlevel * 2)) { m_m = m; m_trap = trap; trap.InUse = true; m.Emote("*tries to break free from the foot trap*"); }
static void SetAFK(Mobile m, string message) { PlayersAfk.Add(m.Serial.Value, new AfkInfo(message, m.Location)); m.Emote("*Is now AFK*"); }
static void SetBack(Mobile m) { PlayersAfk.Remove(m.Serial.Value); m.Emote("*Returns to the game*"); }
public override void OnSwing( Mobile attacker, Mobile defender, bool Cleave ) { if( ValidateBackstab( attacker, defender ) ) { if( BaseWeapon.CheckStam( attacker, FeatLevel, Cleave, false ) ) { attacker.Emote( "*surprises {0}, landing a vicious blow to {1} neck*", defender.Name, ((IKhaerosMobile)defender).GetPossessivePronoun() ); defender.FixedParticles( 0x37B9, 1, 5, 0x251D, 0x651, 0, EffectLayer.Waist ); } } else { attacker.SendMessage( "You must be hidden, at the back or back flank of your opponent, and using a knife, sword or axe in order to perform this attack!" ); ((IKhaerosMobile)attacker).DisableManeuver(); } }
void OnTarget(Mobile from, object obj) { var mob = obj as Mobile; var corpse = obj as Corpse; if (mob == null && corpse == null) { from.SendMessage(33, "You can't resurrect that!"); return; } if (corpse != null && corpse.Owner != null) mob = corpse.Owner; if (mob.IsDeadBondedPet && mob is BaseCreature) { ((BaseCreature)mob).ResurrectPet(); } else if (mob.Alive) { from.SendMessage(33, "This creature is not dead!"); return; } else { mob.Resurrect(); } mob.PlaySound(0x214); mob.FixedEffect(0x376A, 10, 16); Consume(); from.Emote("*recites a scroll of resurrection*"); from.SendMessage(67, "The creature was brought back to life."); }
protected override void OnTarget( Mobile from, object obj ) { if( from == null || water == null || !( obj is BaseCreature || obj is BaseWeapon) || !( from is PlayerMobile ) || from.Deleted || !from.Alive || from.Frozen || from.Paralyzed ) return; Container pack = from.Backpack; if( obj is BaseWeapon ) { BaseWeapon weapon = obj as BaseWeapon; if( weapon.RootParentEntity == null || weapon.RootParentEntity != from ) from.SendMessage( "The weapon needs to be in your possession to be consecrated." ); else if( weapon.Resource == CraftResource.Silver ) { XmlHolyWater hwatt = XmlAttach.FindAttachment( weapon, typeof(XmlHolyWater) ) as XmlHolyWater; if( hwatt != null ) from.SendMessage( "That weapon has already been consecrated." ); else if( pack != null && water.ParentEntity == pack ) { XmlHolyWater newatt = new XmlHolyWater( Math.Max( 1, (int)(water.Power * 0.1) ), 600.0 ); XmlAttach.AttachTo( weapon, newatt ); from.SendMessage( "This weapon will remain consecrated for the next ten minutes." ); water.Delete(); Pitcher pitcher = new Pitcher(); weapon.InvalidateProperties(); pack.DropItem( pitcher ); } } else from.SendMessage( "Only silver weapons can be consecrated with holy water." ); return; } if( !( obj is IAbyssal ) && !( obj is IUndead ) && (!(obj is PlayerMobile) && !((PlayerMobile)obj).IsVampire) ) { from.SendMessage( "Holy Water is only effective against demons and the undead." ); return; } BaseCreature bc = obj as BaseCreature; if( bc.Deleted || from.Map != bc.Map || !bc.Alive || !from.CanSee( bc ) || !from.InLOS( bc ) || !from.CanBeHarmful( bc ) ) return; PlayerMobile m = from as PlayerMobile; if( pack != null && water.ParentEntity == pack ) { if( BaseWeapon.CheckStam( m, 6 ) ) { new BaseCustomSpell.SpellDamageTimer( m, bc, 0.5, water.Power ).Start(); from.Emote( "*throws a vial of holy water on " + bc.Name + "*" ); Effects.SendLocationParticles( EffectItem.Create( bc.Location, bc.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 5023 ); bc.PlaySound( 868 ); water.Delete(); Pitcher pitcher = new Pitcher(); pack.DropItem( pitcher ); } } else from.SendMessage( "That needs to be in your backpack for you to use it." ); }
public override void OnGotMeleeAttack(Mobile attacker) { if (this.Map != null && attacker != this && 0.1 > Utility.RandomDouble()) { if (attacker is BaseCreature) { BaseCreature pet = (BaseCreature)attacker; if (pet.ControlMaster != null && (attacker is Dragon || attacker is GreaterDragon || attacker is SkeletalDragon || attacker is WhiteWyrm || attacker is Drake)) { Combatant = null; pet.Combatant = null; Combatant = null; pet.IsBonded = false; pet.ControlMaster = null; pet.Controlled = false; attacker.Emote(String.Format("* {0} decided to go wild *", attacker.Name)); } if (pet.ControlMaster != null && 0.1 > Utility.RandomDouble()) { Combatant = null; pet.Combatant = pet.ControlMaster; Combatant = null; attacker.Emote(String.Format("* {0} is being angered *", attacker.Name)); } } } base.OnGotMeleeAttack(attacker); }
public override void OnSwing( Mobile attacker, Mobile defender, bool Cleave ) { if( ((IKhaerosMobile)attacker).CanUseMartialPower && BaseWeapon.CheckStam( attacker, FeatLevel, Cleave, false ) ) attacker.Emote( "*reaches out in an attempt to strike {0} in a nerve*", defender.Name ); }
public override void OnSwing( Mobile attacker, Mobile defender, bool Cleave ) { if( defender.Weapon is Fists ) { attacker.SendMessage( 60, "You cannot use that attack against unarmed foes." ); ((IKhaerosMobile)attacker).DisableManeuver(); } if( BaseWeapon.CheckStam( attacker, FeatLevel, Cleave, false ) ) attacker.Emote( "*firmly clashes {0} weapon against {1}{2} weapon*", attacker.Female == true ? "her" : "his", defender.Name, defender.Name.EndsWith( "s" ) == true ? "'" : "'s" ); }
public static void Effect( Mobile defender, int featlevel, int target ) { IKhaerosMobile defplayer = defender as IKhaerosMobile; if( target == 0 ) target = Utility.RandomMinMax( 1, 4 ); switch( target ) { case 1: { if( defplayer.DisabledLegsTimer != null ) defplayer.DisabledLegsTimer.Stop(); defplayer.DisabledLegsTimer = new DisableTimer( defender, featlevel, 1, "legs" ); defplayer.DisabledLegsTimer.Start(); defender.Emote( "*got {0} legs disabled*", ((IKhaerosMobile)defender).GetPossessivePronoun() ); if ( defender is PlayerMobile ) ((PlayerMobile)defender).CantRunIconRefresh(); break; } case 2: { if( defplayer.DisabledLeftArmTimer != null ) defplayer.DisabledLeftArmTimer.Stop(); defplayer.DisabledLeftArmTimer = new DisableTimer( defender, featlevel, 2, "left arm" ); defplayer.DisabledLeftArmTimer.Start(); defender.Emote( "*got {0} left arm disabled*", ((IKhaerosMobile)defender).GetPossessivePronoun() ); break; } case 3: { if( defplayer.DisabledRightArmTimer != null ) defplayer.DisabledRightArmTimer.Stop(); defplayer.DisabledRightArmTimer = new DisableTimer( defender, featlevel, 3, "right arm" ); defplayer.DisabledRightArmTimer.Start(); defender.Emote( "*got {0} right arm disabled*", ((IKhaerosMobile)defender).GetPossessivePronoun() ); break; } case 4: goto case 1; } }
// When this object -- the bottle -- is double-clicked... public override void OnDoubleClick(Mobile m) { if (m.Followers >= m.FollowersMax) // If the player's followers is greater than or equal to his max followers... { m.SendMessage("You need at least one free follower slot to open the bottle."); } else if (((m.InRange(this, 1) && m.CanSee(this)) || this.IsChildOf(m.Backpack)) && (!GetGooInBottle())) // If the bottle is in-range and the goo is not in its bottle... { m.SendMessage("The goo is out of its bottle!"); m.SendLocalizedMessage(1010018); // What do you want to use this item on? m.Target = new BottleOfGooTarget(this, gooPet); // Creates a target from this mobile with the goo mobile thrown to the new class as a reference. } else if (((m.InRange(this, 1) && m.CanSee(this)) || this.IsChildOf(m.Backpack)) && (GetGooInBottle())) // If the bottle is in-range and the goo IS in its bottle, this function creates a new goo mobile. { gooPet = new Goo(this); ((GenericWarrior)gooPet).Controlled = true; ((GenericWarrior)gooPet).ControlMaster = m; gooPet.MoveToWorld(m.Location, m.Map); gooPet.PlaySound(0x1CC); gooPet.Emote("*leaps out of " + m.Name + "'s bottle!*"); SetGooInBottle(false); } else { m.SendLocalizedMessage(500446); //That is too far away. } }
public void Carve( Mobile from, Item item ) { Mobile dead = m_Owner; PlayerMobile fr = from as PlayerMobile; PlayerMobile ow = this.Owner as PlayerMobile; if( this.Owner != null && this.Owner is PlayerMobile && fr.IsHardcore == false) //Killer is not HC { from.SendMessage( "You are not capable of inflicting a wound on that target, as you do not possess the Hardcore merit." ); } if( this.Owner != null && this.Owner is PlayerMobile && ow.IsHardcore == false && fr.IsHardcore == true)//Killer is HC, target is not { if (ow.HCWound + TimeSpan.FromHours(24) < DateTime.Now) //Must Pass 24 Hour Rule { from.SendMessage( 32, "You inflict a finishing wound upon " + dead.Name + "!" ); UseDelaySystem.AddContext(from, DelayContextType.WoundCommand,TimeSpan.FromHours(1)); from.Emote( "*{0} wounds {1}*", from.Name , dead.Name ); dead.SendMessage( 32, "You have been dealt a finishing wound by {0}!", from.Name ); ow.HCWound = DateTime.Now; if (HealthAttachment.HasHealthAttachment(dead)) { HealthAttachment.GetHA(dead).NormalWound(from); } new Blood().MoveToWorld( Location, Map ); new Blood().MoveToWorld( Location, Map ); new Blood().MoveToWorld( Location, Map ); } else from.SendMessage( "You are not capable of inflicting a wound on that target, as they have been dealt a finishing move within the past 24 hours." ); } else if( this.Owner != null && this.Owner is PlayerMobile && ow.IsHardcore == true && fr.IsHardcore == true)//Killer and target are HC { if (ow.HCWound + TimeSpan.FromHours(24) < DateTime.Now) //Must Pass 24 Hour Rule { if (ow.Maimings >= 1) //Do our check for Maimings first, to see if they need a chance at PDing { int r = Utility.Random(1,10); if (ow.Maimings > r) //Escalating chance of PD based on the more injuries. { from.SendMessage( 32, "Rolled {0}",r); from.SendMessage( 32, "You have permanently ended the life of " + dead.Name + " by inflicting a fatal wound upon them!" ); ow.m_DeathTimer.Stop(); ow.CloseGump( typeof( DeathGump ) ); Map deathmap = Map.Felucca; Point3D permdeath = new Point3D( 5689,1768,0 ); dead.MoveToWorld( permdeath, deathmap ); from.Emote( "*{0} fatally wounds {1}*",from.Name ,dead.Name ); PlayerMobile PM = m_Owner as PlayerMobile; string stringdeath = "A person has been slain by the hands of another; the lands of Khaeros whisper of their passing."; UseDelaySystem.AddContext(from, DelayContextType.WoundCommand,TimeSpan.FromHours(1)); World.Broadcast( 0x35, true, "{0}", stringdeath ); dead.SendMessage( 32, "You have been fatally wounded, and your character is now permanently dead!" ); dead.CantWalk = false; dead.Squelched = false; ow.Lives = -1000; ow.Maimings = 666; // Set Maimings to 666, so it doesn't re-maim them if they've PDed dead.Kill(); new Blood().MoveToWorld( Location, Map ); new Blood().MoveToWorld( Location, Map ); new Blood().MoveToWorld( Location, Map ); new Torso().MoveToWorld( Location, Map ); new LeftLeg().MoveToWorld( Location, Map ); new LeftArm().MoveToWorld( Location, Map ); new RightLeg().MoveToWorld( Location, Map ); new RightArm().MoveToWorld( Location, Map ); new Head( dead.Name ).MoveToWorld( Location, Map ); m_Carved = true; ProcessDelta(); SendRemovePacket(); ItemID = Utility.Random( 0xECA, 9 ); // bone graphic Hue = 0; ProcessDelta(); } } if (ow.Maimings < 666) //Do our check to make sure the dude aint dead already! { //If maim count is below 2, or if the lucky dog passed his chance to DIE... from.SendMessage( 32, "You inflict a grievous finishing wound upon " + dead.Name + "!" ); from.Emote( "*{0} inflicts a grievous wound upon {1}*",from.Name ,dead.Name ); UseDelaySystem.AddContext(from, DelayContextType.WoundCommand,TimeSpan.FromHours(1)); dead.SendMessage( 32, "You have been dealt a grievous finishing wound! Your wound count has increased by 1!" ); if (HealthAttachment.HasHealthAttachment(dead)) { HealthAttachment.GetHA(dead).HCWound(from); } ow.Maimings += 1; ow.HCWound = DateTime.Now; new Blood().MoveToWorld( Location, Map ); new Blood().MoveToWorld( Location, Map ); new Blood().MoveToWorld( Location, Map ); //Blow through our checks to see if we should lower stats! if (ow.RawHits > 25 && ow.Maimings + 1 > Utility.Random(10)) { ow.RawHits -= Utility.RandomList(5,10); dead.SendMessage( 32, "You have lost some hit points permenantly due to the wound you've sustained!" ); } if (ow.RawStam > 25 && ow.Maimings + 1 > Utility.Random(10)) { ow.RawStam -= Utility.RandomList(5,10); dead.SendMessage( 32, "You have lost some stamina points permenantly due to the wound you've sustained!" ); } if (ow.RawMana > 25 && ow.Maimings + 1 > Utility.Random(10)) { ow.RawMana -= Utility.RandomList(5,10); dead.SendMessage( 32, "You have lost some mana points permenantly due to the wound you've sustained!" ); } } } else from.SendMessage( "You are not capable of inflicting a wound on that target, as they have been dealt a finishing move within the past 24 hours." ); } else if( this.Owner != null && this.Owner is PlayerMobile && ((PlayerMobile)this.Owner).Lives > -1 ) from.SendMessage( "That person is not dead yet, so you cannot carve their body." ); else if ( dead == null ) { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } else if ( ((Body)Amount).IsHuman && ItemID == 0x2006 ) { new Blood( 0x122D ).MoveToWorld( Location, Map ); new Torso().MoveToWorld( Location, Map ); new LeftLeg().MoveToWorld( Location, Map ); new LeftArm().MoveToWorld( Location, Map ); new RightLeg().MoveToWorld( Location, Map ); new RightArm().MoveToWorld( Location, Map ); new Head( dead.Name ).MoveToWorld( Location, Map ); m_Carved = true; ProcessDelta(); SendRemovePacket(); ItemID = Utility.Random( 0xECA, 9 ); // bone graphic Hue = 0; ProcessDelta(); if ( IsCriminalAction( from ) ) from.CriminalAction( true ); } else if ( dead is BaseCreature ) { ((BaseCreature)dead).OnCarve( from, this ); } else { from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse. } }
public SelfDestructiveBarTrash(Mobile from) : base(0) { Movable = false; Name="some trash dropped by "+from.Name; Timer.DelayCall(TimeSpan.FromMinutes(2.5),new TimerStateCallback(DecayTimer),this); switch(Utility.RandomMinMax(0,4)){ case 0: { ItemID=4334; break; } case 1: { ItemID=4335; break; } case 2: { ItemID=4336; break; } case 3: { ItemID=4337; break; } case 4: { ItemID=Utility.RandomMinMax(4650,4654); Name="some of "+from.Name+"'s vomit"; Hue=0x31; from.Emote("*vomits*"); Server.Effects.PlaySound(from.Location,from.Map,(from.Female ? 0x32D : 0x43F)); Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(2,3)),new TimerStateCallback(BarkeepSpeak),from); break; } default: break; } }
public static void Cleave( Mobile mob, Mobile killed ) { if ( mob == null || killed == null || ((IKhaerosMobile)mob).CleaveAttack ) return; CombatSystemAttachment csa = CombatSystemAttachment.GetCSA( mob ); if ( csa.Charging || (csa.AttackTimer != null && csa.AttackTimer.Type == AttackType.Throw) ) // does not trigger from charge/throw return; BaseWeapon weapon = mob.Weapon as BaseWeapon; IKhaerosMobile attacker = mob as IKhaerosMobile; ArrayList list = new ArrayList(); if ( attacker.Feats.GetFeatLevel(FeatList.Cleave) > 0 && !( mob.Weapon is BaseRanged ) ) { foreach( Mobile m in mob.GetMobilesInRange( 2 ) ) list.Add( m ); ArrayList targets = new ArrayList(); for( int i = 0; i < list.Count; ++i ) { Mobile m = (Mobile)list[i]; if( m != killed && m != mob && Spells.SpellHelper.ValidIndirectTarget( mob, m ) ) { if( m == null || m.Deleted || m.Map != mob.Map || !m.Alive || !mob.CanSee( m ) || !mob.CanBeHarmful( m ) || BaseAI.AreAllies( mob, m ) ) continue; if( !mob.InRange( m, weapon.MaxRange ) ) continue; if (mob.InLOS(m)) { bool govAlly = false; if (m is Soldier && (m as Soldier).Government != null && !(m as Soldier).Government.Deleted) { if (attacker is Soldier && (attacker as Soldier).Government != null && !(attacker as Soldier).Government.Deleted) { if ((attacker as Soldier).Government == (m as Soldier).Government) govAlly = true; else if ((attacker as Soldier).Government.AlliedGuilds.Contains((m as Soldier).Government)) govAlly = true; } else if (attacker is PlayerMobile) { foreach (CustomGuildStone g in CustomGuildStone.Guilds) { if (CustomGuildStone.IsGuildMember(attacker as PlayerMobile, g)) govAlly = (g == (m as Soldier).Government || g.AlliedGuilds.Contains((m as Soldier).Government)); if (govAlly) break; } if (govAlly) continue; } } else if (m is PlayerMobile && attacker is Soldier) { if ((attacker as Soldier).Government.Members.Contains(m)) govAlly = true; else { foreach (CustomGuildStone g in CustomGuildStone.Guilds) { if (CustomGuildStone.IsGuildMember(m as PlayerMobile, g)) govAlly = (attacker as Soldier).Government.AlliedGuilds.Contains(g); if(govAlly) break; } } } if(!govAlly) targets.Add(m); } } } if( targets.Count > 0 ) { mob.RevealingAction(); Mobile m = (Mobile)targets[0]; mob.Emote( "*unleashes a cleave attack on {0}*", m.Name ); attacker.CleaveAttack = true; weapon.OnSwing( mob, m, ((attacker.Feats.GetFeatLevel(FeatList.Cleave) * 0.25) + 0.25), true ); } } }
public static void TryTerror( Mobile from, Mobile mob ) { if( from == null || mob == null || !( from is PlayerMobile ) || !from.InRange( mob, 6 ) ) return; PlayerMobile vamp = from as PlayerMobile; if( vamp.NextFeatUse > DateTime.Now ) vamp.SendMessage( "It is too early to use another ability." ); else if( vamp.BPs < 1 ) vamp.SendMessage( "You lack enough blood points to use this ability." ); else { if( Utility.RandomMinMax( 1, 100 ) > mob.EnergyResistance ) { mob.Emote( "*is paralyzed in fear of " + vamp.Name + vamp.GetPossessive() + " gaze*" ); Engines.XmlSpawner2.XmlAttach.AttachTo( mob, new Engines.XmlSpawner2.XmlParalyze( ( (double)vamp.Feats.GetFeatLevel( FeatList.Terror ) ) ) ); } else mob.Emote( "*resisted " + vamp.Name + vamp.GetPossessive() + " monstrous gaze*" ); vamp.BPs--; vamp.PlaySound( 581 ); vamp.NextFeatUse = DateTime.Now + TimeSpan.FromSeconds( 60 - vamp.Level ); vamp.RevealingAction(); Engines.XmlSpawner2.CombatSystemAttachment csa = Engines.XmlSpawner2.CombatSystemAttachment.GetCSA( vamp ); csa.Interrupted( true ); if( mob is BaseCreature ) ( (BaseCreature)mob ).AggressiveAction( vamp ); } }
public virtual void DegradeWeapon( Mobile defender ) { BaseWeapon sundered = defender.Weapon as BaseWeapon; if( !( sundered is Fists ) ) { sundered.HitPoints -= Utility.Random( 3 ); if( sundered.HitPoints < 0 ) { sundered.MaxHitPoints += sundered.HitPoints; sundered.HitPoints = 0; if( sundered.MaxHitPoints < 0 ) { sundered.Delete(); defender.Emote( "*got {0} weapon destroyed by {1}*", defender.Female == true ? "her" : "his", this.Name ); } } defender.Emote( "*got {0} weapon damaged by {1}*", defender.Female == true ? "her" : "his", this.Name ); } }