View Single Post
Author Message
LeAlex14
Member
Join Date: Jun 2020
Location: La France
Old 02-03-2021 , 04:03   [Subplugin] Summon a boss
Reply With Quote #1

I really like minions or clones... But sometimes, we need another boss, so I create this plugin (I just pick a function of BatFox's ff2 code, really, I do nothing). I also really like the idea of red backup, but sometimes, the backup wasn't really strong vs the boss.
So this plugin add 2 new ability, summon a boss (works like clones) or summon a red boss backup.
Code:
"ability5"
	{
		"name"		"Summon_Another_Boss0"

		"arg1"		"0" // Boss Index in character.cfg -1 (yes, don't works if you don't set that) I don't mention it but you can put a lot of index and the plugin choose a random ("1 ; 2 ; 3")
		"arg2"		"2"	// Number of boss
		
		"arg3"		"2" // HP Mode (works with arg4) : 1 = Defined Hp; 2 = % Summoner Max Hp; 3 = % Summoned boss Hp in normal mode
		"arg4"		"65" // HP receive (% if arg3 = 2 or 3)
		
		"arg5"		"4" // Lives Mode (works with arg6) : 1 = If summoned have multiple life, add new life number and maxnumber; 2 = If summoned have multiple life, add % of summoned life number and maxnumber; 3 = % Summoner life; 4 = Add life and max life
		"arg6"		"1" // Lives receive (% if arg3 = 2 or 3)
		
		"arg7"		"2" // Damage rage Mode (works with arg8) : 1 = Defined Rage damage; 2 = % Summoner Rage Damage; 3 = % Summoned rage damage in normal mode
		"arg8"		"75" // Damage rage needed (% if arg3 = 2 or 3)
		
		"arg9"		"1" // 0 = at the spawn, 1 = on the player
                 "arg10"            "0" // Trigger by ams 0 = no, 1 = yes

		"plugin_name"	"ff2_summonaboss"
	}
	
	"ability6"
	{
		"name"		"Boss_Merc_Backup"

		"arg1"		"3"	// Merc need to left
		"arg2"		"1"	// Boss Index in character.cfg -1 (yes, don't works if you don't set that) you can also put some index and the plugin choose randomly 1
		"arg3"		"1" // Number of boss
		
		"arg4"		"1" // HP Mode (works with arg5) : 1 = Defined Hp; 2 = % Boss with this ability Max Hp; 3 = % Summoned boss Hp in normal mode
		"arg5"		"5000" // HP receive (% if arg3 = 2 or 3)
		
		"arg6"		"4" // Lives Mode (works with arg7) : 1 = If summoned have multiple life, add new life number and maxnumber; 2 = If summoned have multiple life, add % of summoned life number and maxnumber; 3 = % Boss with this ability life; 4 = Add life and max life
		"arg7"		"3" // Lives receive (% if arg3 = 2 or 3)
		
		"arg8"		"1" // Damage rage Mode (works with arg9) : 1 = Defined Rage damage; 2 = % Boss with this ability Rage Damage; 3 = % Summoned rage damage in normal mode
		"arg9"		"2500" // Damage rage needed (% if arg3 = 2 or 3)
		
		"arg10"		"1"	// Backup mode 0 = infinite backup if another summoned boss have backup, 1 = 1 backup

		"plugin_name"	"ff2_summonaboss"
	}


I also join 2 plugin compatible with this boss spawn, Dynamics Defaults and Improved Saxton.
You can download the seeldier.cfg, and saxtinv2.cfg (download saxton hale v2 for ressource at this link) and place him into character.cfg like that:
Code:
"Freak Fortress 2"
{
	"1"		"seeldier"
	"2"		"saxtonv2"
}


WARNING You need compatible plugin because a lot of plugin works with on round start, so, you need to hook when a player spawn.

WARNING Ams are not compatible with summoned boss and i'll upload a version of summonaboss compatible with ams and with menu manager later (in 1/2 hours)


Example:
Code:
public OnPluginStart2()
{
	HookEvent("arena_round_start", event_round_start);
	HookEvent("teamplay_round_win", OnRoundEnd, EventHookMode_PostNoCopy);
}

public void OnRoundEnd(Event event, const char[] name, bool dontBroadcast)
{
	UnhookEvent("player_spawn",SpawnEvent);
}

public Action SpawnEvent(Handle event,const char[] name,bool dontBroadcast)
{
    int client_id = GetEventInt(event, "userid");
    int client = GetClientOfUserId(client_id);

    CreateTimer(0.5, IsASummondedBoss, client, TIMER_FLAG_NO_MAPCHANGE);
}

public Action TimerHookSpawn(Handle timer)
{
    HookEvent("player_spawn",SpawnEvent,EventHookMode_PostNoCopy);
} 

public Action IsASummondedBoss(Handle timer, int client)
{
     // Stuff in on round start for one player, example:
int boss = FF2_GetBossIndex(client);
	if(boss>=0 && (FF2_HasAbility(boss, this_plugin_name, "example")))
	{
		VarExample[client]=true;
	}
}


public Action:event_round_start(Handle event, const char[] name, bool dontBroadcast)
{
	for(new client=1;client<=MaxClients;client++)
	{
		new boss=FF2_GetBossIndex(client);
		if(boss>=0 && (FF2_HasAbility(boss, this_plugin_name, "example")))
		{
			VarExample[client]=true;
		}
	}
}
Credit:
Batfox for his amazing work with his plugin
Sarysa for all plugin

Change:
Add menu ability and ams

Project:
If you like this plugin, i'll try to make include files for easier compatibility
Attached Files
File Type: sp Get Plugin or Get Source (ff2_dynamic_defaults.sp - 219 views - 138.3 KB)
File Type: smx ff2_dynamic_defaults.smx (46.6 KB, 163 views)
File Type: sp Get Plugin or Get Source (improved_saxton.sp - 124 views - 109.3 KB)
File Type: smx improved_saxton.smx (38.9 KB, 125 views)
File Type: cfg seeldier.cfg (4.5 KB, 127 views)
File Type: cfg saxtonv2.cfg (17.6 KB, 158 views)
File Type: sp Get Plugin or Get Source (ff2_summonaboss.sp - 198 views - 21.8 KB)
File Type: smx ff2_summonaboss.smx (13.3 KB, 226 views)

Last edited by LeAlex14; 02-05-2021 at 03:30.
LeAlex14 is offline