Devwarlt (03-11-2017),HGAEHaeheadhetdhtertherh (07-05-2016),Invader_Zim (05-05-2016),lkdjnfoskjednfblksjdfn (05-06-2016),MikeRaarupBirk (05-06-2016),Razor Sharp v2 (05-05-2016)
This is a very simple change in Player.UseItem.cs, search for StatBoostAura, and replace the whole block with this;This should technically work, I only tested it once or twice, if it doesn't please let me know! This should fix both negative health glitch as well as the good old stacking!Code:case ActivateEffects.StatBoostAura: { var amountSBA = eff.Amount; var durationSBA = eff.DurationMS; var rangeSBA = eff.Range; int idx = -1; if (eff.Stats == StatsType.MaximumHP) idx = 0; if (eff.Stats == StatsType.MaximumMP) idx = 1; if (eff.Stats == StatsType.Attack) idx = 2; if (eff.Stats == StatsType.Defense) idx = 3; if (eff.Stats == StatsType.Speed) idx = 4; if (eff.Stats == StatsType.Vitality) idx = 5; if (eff.Stats == StatsType.Wisdom) idx = 6; if (eff.Stats == StatsType.Dexterity) idx = 7; int bit = idx + 39; if (eff.UseWisMod) { amountSBA = (int)UseWisMod(eff.Amount, 0); durationSBA = (int)(UseWisMod(eff.DurationSec) * 1000); rangeSBA = UseWisMod(eff.Range); } if (HasConditionEffect(ConditionEffectIndex.HPBoost)) { if (amountSBA == 0) ; else if (amountSBA >= 1) ; amountSBA = 0; durationSBA = 0; return false; } this.Aoe(rangeSBA, true, player => { ApplyConditionEffect(new ConditionEffect { DurationMS = durationSBA, Effect = (ConditionEffectIndex)bit }); (player as Player).Boost[idx] += amountSBA; player.UpdateCount++; Owner.Timers.Add(new WorldTimer(durationSBA, (world, t) => { (player as Player).Boost[idx] -= amountSBA; player.UpdateCount++; })); }); BroadcastSync(new ShowEffectPacket() { EffectType = EffectType.AreaBlast, TargetId = Id, Color = new ARGB(0xffffffff), PosA = new Position() { X = rangeSBA } }, p => this.Dist(p) < 25); } break;
Last edited by Masternx; 05-05-2016 at 03:44 PM.
Devwarlt (03-11-2017),HGAEHaeheadhetdhtertherh (07-05-2016),Invader_Zim (05-05-2016),lkdjnfoskjednfblksjdfn (05-06-2016),MikeRaarupBirk (05-06-2016),Razor Sharp v2 (05-05-2016)
If this is suppose to fix the HP stacking from seals, it did not work for me.
My weapon is a backpack.
Desire (05-05-2016),HGAEHaeheadhetdhtertherh (05-05-2016),LegumI (12-04-2016),Lxys (05-06-2016)
Please expand? Tell me how to do it and I will try to fix that as well, this fixes the negative HP bug. (To replicate this bug, you simply use a seal that gives you a HP bonus, and switch your weapon, or anything you would like in your equips, and then when the HP buff runs out, it will give you negative HP)
Last edited by Masternx; 05-05-2016 at 09:27 AM.
Thread updated, stacking fixed.
Worked for me, thanks
Great tutorial, very usefull! +1
Bear, I actually fully fixed the Pally Glitch sorry I can't be online alot I am extremely busy making my game :3
@Masternx you forgot something very valuable :/ eff.NoStack you need to add that in descriptors or this will effect all StatBoostAura like Effusions of Dexterity :/ and Effusions Stack so your patch is not a full patch for it I will send you my patch as soon as I have free time
return false; <--- unnecessary since its not a bool, its a case and switch
You were close to getting it I give you props for trying but your were lacking some important information as if you didn't read the whole source, In Descriptors you need to add NoStack and if you check dat1.xml and view the Pally Seal you will see NoStack=true but this is not in descriptors you will need to add that and then if(eff.NoStack) which is checking if the items has NoStack=true then it will continue or not accordingly, as for the duration your setting the duration to 0 which will cancel out the time boost gained from using the seal again...which is not ideal...
Owner.Timers.Add(new WorldTimer(durationSBA, (world, t) => // <----this is the line that removes the effect after the amount of time if the duration is set to 0 it will not extend the time boosted.
if (amountSBA == 0) ;
else if (amountSBA >= 1) ;<-----remove the if(amountSBA >= 1); and just leave it as a else {}
Last edited by DimitriSavage; 05-07-2016 at 12:10 AM.
Masternx (05-07-2016)