public override bool Cast() { if (!base.Cast()) { return(false); } bool asSub = false; ArrayList Targets = new ArrayList(); foreach (Mobile m in Owner.GetMobilesInRange(6)) { if (m is BaseCreature) { Targets.Add(m); } } if (Targets.Count > 0) { BaseCreature sb = null; foreach (BaseCreature c in Targets) { if (c.AI == AIType.AI_Animal /*&& c.ControlMaster != null && !c.Controlled*/) { sb = c; } } if (sb != null) { KonohaClone clone = new KonohaClone(Owner, 0, 0, 15.0); clone.MoveToWorld(Owner.Location, Owner.Map); clone.substitute = sb; clone.Direction = Owner.Direction; if (Owner.Combatant != null) { clone.Combatant = Owner.Combatant; if (Owner.Combatant.Combatant == Owner) { Owner.Combatant.Combatant = clone; } Owner.Combatant = null; } Owner.Hidden = true; asSub = true; } } if (asSub) { return(true); EndSortNubia(); } ArrayList objetTargets = new ArrayList(); foreach (Item item in Owner.GetItemsInRange(6)) { if (item.Movable) { objetTargets.Add(item); } } if (objetTargets.Count > 0) { int ind = Utility.RandomMinMax(0, objetTargets.Count - 1); Item it = objetTargets[ind] as Item; KonohaClone clone = new KonohaClone(Owner, 0, 0, 15.0); clone.subItem = it; clone.MoveToWorld(Owner.Location, Owner.Map); clone.Direction = Owner.Direction; if (Owner.Combatant != null) { clone.Combatant = Owner.Combatant; if (Owner.Combatant.Combatant == Owner) { Owner.Combatant.Combatant = clone; } Owner.Combatant = null; } Owner.Hidden = true; asSub = true; } if (!asSub) { Owner.SendMessage("Impossible de trouver un objet ou un poulet pour la substitution"); } EndSortNubia(); return(true); }
public KonohaCloneAI(KonohaClone m) : base(m) { m.CurrentSpeed = m.ActiveSpeed; m_clone = m; }