#W# Added Enchanted Bandage quest reward.
This commit is contained in:
parent
c13f8d2493
commit
fc87404332
2 changed files with 217 additions and 2 deletions
|
|
@ -26,12 +26,39 @@ namespace Server.Commands
|
|||
return;
|
||||
}
|
||||
|
||||
// 2. Search for a bandage in the backpack
|
||||
// 2. Search for the custom Enchanted Bandage first
|
||||
EnchantedBandage enchanted = from.Backpack.FindItemByType<EnchantedBandage>();
|
||||
|
||||
if (enchanted != null && enchanted.Charges > 0)
|
||||
{
|
||||
// The 50% chance check
|
||||
if (Utility.RandomDouble() < 0.50)
|
||||
{
|
||||
from.Poison = null;
|
||||
from.Hits = from.HitsMax;
|
||||
|
||||
from.PlaySound(0x1F2);
|
||||
from.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
|
||||
from.SendMessage(63, "The enchanted bandage glows brightly, instantly curing and fully healing you!");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Failed 50% check. Trigger normal heal using the custom charges.
|
||||
if (BandageContext.BeginHeal(from, from) != null)
|
||||
{
|
||||
enchanted.Charges--;
|
||||
}
|
||||
}
|
||||
|
||||
// Return here so we don't accidentally consume a regular bandage below
|
||||
return;
|
||||
}
|
||||
|
||||
// 3. Fallback: Search for a standard bandage in the backpack
|
||||
Bandage bandage = from.Backpack.FindItemByType<Bandage>();
|
||||
|
||||
if (bandage != null)
|
||||
{
|
||||
// 3. Trigger the healing attempt directly using the established Context logic
|
||||
// We call BeginHeal which handles the timer, skill checks, and target logic
|
||||
if (BandageContext.BeginHeal(from, from) != null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue