#### brennoncraig

##### Citizen

So I've tried rewriting some coding I found here on the forums for pet damage cap and I feel that I'm close to getting it to successfully compile for runuo. I'm only getting 1 error and stumped on how to resolve it. If someone would be so kind to help me out, it would be much appreciated

Thanks

C#:

```
public static int Damage( OnDamage, Mobile m, int damage, bool ignoreArmor, int phys, int fire, int cold, int pois, int nrgy )
{
error ------> if (OnDamage is PlayerMobile && from is BaseCreature && ((BaseCreature)from).Controlled)
{
damage = Math.Min(damage, 40); // Pet Dmg Cap to players
phys = Math.Min(phys, 40); // Pet phys Cap to players
fire = Math.Min(fire, 40); // Pet fire Cap to players
cold = Math.Min(cold, 40); // Pet cold Cap to players
pois = Math.Min(pois, 40); // Pet pois Cap to players
}
}
```

Thanks