Hello all, I will explain it, If I use a greater strenght potion or a greater agility potion them will up my strenght and dexterity status (all this is ok) then if another player cast "curse" spell and target the player who drinked these potions (strenght and agility) it will down strenght and dexterity status (all this is ok), the player who drinked these potions and has the curse buff eat an enchanted apple and resistances return to be the originals (before curse all resistances cap then with curse buff resistances down and eating and enchanted apple and them return to cap) it should work same to stats but when you eat the enchanted apple your stats (strenght and dexterity) dont return before curse spell having strenght and agility potions buff.
I have some questions about where can i find the scrip who work with that.

Thank you.
 
There are several scripts at work here. Each one does the same kind of thing - adds a StatMod to the target Mobile.

For strength/agility potions look in Scripts\Items\Skill Items\Magical\Potions\ and locate the folder of the type of potion.
For curse/weaken spell effects look in Scripts\Spells and locate the folder for the spell's circle.
For eating enchanted apple buffs look in Scripts\Items\Food\EnchantedApple.cs.
 
Sorry for the late reply. It turns out that for strength and agility potions, the actual code that adds a StatMod to the player is found in BaseStrengthPotion.cs and BaseAgilityPotion.cs, located in the folder Scripts\Items\-BaseClasses\

In BaseStrengthPotion, line 36 has this code:

Code:
            if (Spells.SpellHelper.AddStatOffset(from, StatType.Str, Scale(from, this.StrOffset), this.Duration))
            {
                from.FixedEffect(0x375A, 10, 15);
                from.PlaySound(0x1E7);
                return true;
            }

In that if statement, Spells.SpellHelper.AddStatOffset is called to check to see if the target player already has a strength buff, and if it doesn't it adds one and plays the drinking effect/sound. I would imagine what you are trying to do also deals with the AddStatOffset function from SpellHelper.cs located in Scripts\Spells\Base . I haven't checked them but I think all stat buffs and/or curses are using that function from SpellHelper.
 
Last edited:
Back