You will need to obtain the character ID for the character whose HP you want to decrease. You can use the following query to get the character ID from the database.
SELECT CharID FROM _OnlinePlayers WHERE CharName16 = 'character_name'
Stored Procedure: _Char_DecreaseHealthPercentage
Parameters:
@CharID INT- Target character ID@Percentage TINYINT- HP percentage to decrease
Let us first test whether the command works by using the following code, which will decrease the HP of a specific character by 10%.
USE [vPlus] GO DECLARE @CharID INT = (SELECT CharID FROM _OnlinePlayers WHERE CharName16 = 'character_name') EXEC _Char_DecreaseHealthPercentage @CharID, 10;
For real usage, use @CharID directly from your calling procedure.
EXEC _Char_DecreaseHealthPercentage @CharID, 10;