It would be good if we can restore like
Code:
TargetHealthSet = BossMaxHealth * BossLivesLeft + BossNowHealth +Playerdamage
I have read a heal boss subplugin in M7's subplugin and it looks like this:
Code:
if(selfheal)
{
new Selfhealth = FF2_GetBossHealth(boss);
new Selfmaxhealth = FF2_GetBossMaxHealth(boss);
Selfhealth = RoundToCeil(Selfhealth + (Selfmaxhealth * healing));
if(Selfhealth > Selfmaxhealth)
{
Selfhealth = Selfmaxhealth;
}
FF2_SetBossHealth(boss, Selfhealth);
}
However those codes I borrowed will still make boss lose all the health it left. I don't know how FF2 works with boss's lives. Because FF2_SetBossMaxHealth can only get 1 lives but I have to count those lives * MaxHealth to get the actually number I want. And for the god of coding the Health become negative for some reasons.
Edit:
If I have to set boss's health with more than 2 lives then I have to plus those lives * maxhealth..
Edit2:
Code:
int Healthtoset, MaxHealthWithLives;
MaxHealthWithLives = FF2_GetBossMaxHealth(BossIndex) * FF2_GetBossMaxLives(BossIndex);
Healthtoset = FF2_GetBossMaxHealth(BossIndex) * (CurLives - 1) + CurHealth + CurDamage;
if(Healthtoset > MaxHealthWithLives)
{
Healthtoset = MaxHealthWithLives
FF2_SetBossHealth(BossIndex, Healthtoset);
PrintToChatAll("Boss get fully heal back");
respawn[client] = false;
return Plugin_Handled;
}
FF2_SetBossHealth(BossIndex, Healthtoset);
Try this and boss will always get Healthtoset = MaxHealthWithLives which is a full heal.
Edit3:
Code:
public Action Command_Seeheal (int client, int args)
{
int Bossdehealth, Bossdemaxhealth;
Bossdehealth = FF2_GetBossHealth(BossIndex);
Bossdemaxhealth = FF2_GetBossMaxHealth(BossIndex);
PrintToChat(client, "BossHealth is:%d", Bossdehealth);
PrintToChat(client, "BossMaxHealth is:%d", Bossdemaxhealth);
}
So what you know is that BossMaxHealth(FF2_GetBossMaxHealth) is only for 1 live but BossHealth is for the full health of all lives.
Sometime it's that simple...
I will open another thread for this plugin.