public static void OnVirtueUsed(Mobile from) { if (VirtueHelper.GetLevel(from, VirtueName.Humility) < VirtueLevel.Seeker) { from.SendLocalizedMessage(1155812); // You must be at least a Seeker of Humility to Invoke this ability. } else if (from.Alive) { from.SendLocalizedMessage(1155817); // Target the pet you wish to embrace with your Humility. from.BeginTarget(10, false, Server.Targeting.TargetFlags.None, (m, targeted) => { if (targeted is BaseCreature) { BaseCreature bc = targeted as BaseCreature; if (!bc.Alive) { from.SendLocalizedMessage(1155815); // You cannot embrace Humility on the dead! } else if (VirtueHelper.GetLevel(m, VirtueName.Humility) < VirtueLevel.Seeker) { from.SendLocalizedMessage(1155812); // You must be at least a Seeker of Humility to Invoke this ability. } else if (!bc.Controlled && !bc.Summoned) { from.SendLocalizedMessage(1155813); // You can only embrace your Humility on a pet. } else if (ActiveTable.ContainsKey(bc)) { from.SendLocalizedMessage(1156047); // That pet has already embraced Humility. } else { VirtueHelper.Atrophy(from, VirtueName.Humility, 3200); from.SendLocalizedMessage(1155818); // You have lost some Humility. ActiveTable[bc] = from; m.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1150, 1155819, from.NetState); // *Your pet surges with the power of your Humility!* bc.FixedEffect(0x373A, 10, 16); BuffInfo.AddBuff(from, new BuffInfo(BuffIcon.Humility, 1156049, 1156050, TimeSpan.FromMinutes(20), from, String.Format("{0}\t{1}", bc.Name, GetRegenBonus(bc)))); // Pet: ~1_NAME~<br>+~2_VAL~ HPR<br> CheckTimer(); bc.ResetStatTimers(); Timer.DelayCall(TimeSpan.FromMinutes(20), (o) => { Mobile mob = o as Mobile; if (mob != null && ActiveTable.ContainsKey(mob)) { Mobile user = ActiveTable[mob]; ActiveTable.Remove(mob); BuffInfo.RemoveBuff(user, BuffIcon.Humility); user.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1150, 1155823, from.NetState); // *Your pet's power returns to normal* CheckTimer(); } }, bc); } } else { from.SendLocalizedMessage(1155813); // You can only embrace your Humility on a pet. } }); } }