Move health potion implementation to a power
This commit is contained in:
parent
1babc5cfd4
commit
e65446a734
@ -927,8 +927,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem
|
||||
if (player.Attributes[GameAttribute.Hitpoints_Cur] == player.Attributes[GameAttribute.Hitpoints_Max])
|
||||
return;
|
||||
|
||||
player.AddPercentageHP(60);
|
||||
player.World.BuffManager.AddBuff(this, player, new PowerSystem.Implementations.CooldownBuff(30211, TickTimer.WaitSeconds(player.World.Game, 30f)));
|
||||
player.World.PowerManager.RunPower(player, 30211);
|
||||
|
||||
if (this.Attributes[GameAttribute.ItemStackQuantityLo] <= 1)
|
||||
player.Inventory.DestroyInventoryItem(this); // No more potions!
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
//Blizzless Project 2022
|
||||
using System.Collections.Generic;
|
||||
using DiIiS_NA.GameServer.GSSystem.PlayerSystem;
|
||||
using DiIiS_NA.GameServer.GSSystem.TickerSystem;
|
||||
|
||||
namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations.General
|
||||
{
|
||||
//30211 class DrinkHealthPotion
|
||||
[ImplementsPowerSNO(30211)]
|
||||
public class DrinkHealthPotion : PowerScript
|
||||
{
|
||||
public override IEnumerable<TickTimer> Run()
|
||||
{
|
||||
if (User is Player)
|
||||
{
|
||||
Player player = (Player)User;
|
||||
player.AddPercentageHP(60);
|
||||
AddBuff(player, player, new CooldownBuff(30211, TickTimer.WaitSeconds(player.World.Game, 30f)));
|
||||
}
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
user.block.title