public static void Aggro_OnTarget(Mobile from, object targ) { if (from is PlayerMobile) { PlayerMobile pm = (PlayerMobile)from; /*if (pm.GetAptitudeValue(Aptitude.Protection) < 5) * from.SendMessage("Vous devez pouvoir utiliser le sort Copie.");*/ if (targ is Copie) { Copie target = (Copie)targ; if (target != null && target.SummonMaster == pm) { if (target.Aggro) { target.Aggro = false; } else { target.Aggro = true; } } } else { from.SendMessage("Vous devez cibler une copie."); } } }
public IHttpActionResult PostCopie(Copie copie) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Copies.Add(copie); try { db.SaveChanges(); } catch (DbUpdateException) { if (CopieExists(copie.CopieID)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = copie.CopieID }, copie)); }
public IHttpActionResult PutCopie(int id, Copie copie) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != copie.CopieID) { return(BadRequest()); } db.Entry(copie).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!CopieExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetCopie(int id) { Copie copie = db.Copies.Find(id); if (copie == null) { return(NotFound()); } return(Ok(copie)); }
public IHttpActionResult DeleteCopie(int id) { Copie copie = db.Copies.Find(id); if (copie == null) { return(NotFound()); } db.Copies.Remove(copie); db.SaveChanges(); return(Ok(copie)); }