Raised This Month: $51 Target: $400
 12% 

FF2 Restore boss plugin trouble


Post New Thread Reply   
 
Thread Tools Display Modes
Hoto Cocoa
Senior Member
Join Date: Jun 2018
Location: Somewhere
Old 02-08-2020 , 09:07   Re: Restore boss plugin trouble
Reply With Quote #11

Well I guess restore boss's health is still a problem in FF2.
Hoto Cocoa is offline
Hoto Cocoa
Senior Member
Join Date: Jun 2018
Location: Somewhere
Old 02-08-2020 , 09:19   Re: Restore boss plugin trouble
Reply With Quote #12

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.

Last edited by Hoto Cocoa; 02-08-2020 at 11:07. Reason: edit
Hoto Cocoa is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode