Raised This Month: $62 Target: $400
 15% 

FF2 [Subplugin] Gravity (Updated 17.03.2021)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
J0BL3SS
Senior Member
Join Date: Sep 2020
Location: Berke's Sex Dungeon
Old 02-02-2021 , 12:43   [Subplugin] Gravity (Updated 17.03.2021)
Reply With Quote #1

Number 0 to 9 up to 10 abilities can be created. All created abilities can be used with Menu Abilities (ffbat_menu_abilities.ff2) and Ability Management System (ff2_sarysapub3.ff2). And Compatible with (ff2_summonaboss.ff2) ,
At least without ams or menu.

It feels like youre in space isn't it?

Gravity Rage:
Code:
"abilityX"
	{
		"name"	"rage_gravity_X" // replace X with a number from 0 to 9, up to 10 subabilities can be used
		"arg1"	"2"		//EffectMode: 1=Enemy Team, 2=Only Boss, 3=Boss Team, 4=Everyone expect boss, 5= Everyone
		"arg2"	"0.25"		//Gravity value (1.0 Default)
		"arg3"	"1024.0"	//Effect Distance
		"arg4"	"12.0"		//Rage Duration

		// Only Needed If Using With Ability Management System
		"arg1001"	"0.0" 					// delay before first use
		"arg1002"	"10.0" 					// cooldown
		"arg1003"	"Low Gravity"	 			// name
		"arg1004"	"Low gravity for you (12 Second)"	// description
		"arg1005"	"20" 					// rage cost
		"arg1006"	"0" 					// index for ability in the AMS menu
		"plugin_name"	"ff2_gravity"
	}
For Sounds:
Code:
"sound_gravity_X" // replace X with a number from 0 to 9, up to 10 subabilities can be used
{
	"1" "freak_fortress_2/myboss/gravitywarp01.mp3"
	"2" "freak_fortress_2/myboss/gravitywarp02.mp3"
}

Shockwave Rage
Code:
"abilityX"
	{
		"name"	"rage_shockwave"
		"arg1"	"100.0"		//Player damage at point blank
		"arg2"	"375"		//Building damage at poitn blank
		"arg3"	"1200.0"	//Distance
		"arg4"	"1500"		//Knockback Force
		"arg5"	"720" 		//Z Insenity
		
		
		// Ability Management System
		"arg1001"	"0.0" 										// delay before first use
		"arg1002"	"10.0" 										// cooldown
		"arg1003"	"Shockwave" 								// name
		"arg1004"	"Push back your enemies"					// description
		"arg1005"	"20" 										// rage cost
		"arg1006"	"3" 										// index for ability in the AMS menu
		"plugin_name"	"ff2_gravity"
	}
For Sounds:
Code:
"sound_shockwave"
{
	"1" "freak_fortress_2/myboss/gravitywarp01.mp3"
	"2" "freak_fortress_2/myboss/gravitywarp02.mp3"
}
Rage Sigma
Code:
"abilityX"
{
	"name"	"rage_sigma"
	"arg1"	"1"			//Center positon: 0=Where youre standing, 1=Where youre aiming
	"arg2"	"800.0"		//Range
	"arg3"	"1750.0"	//Upward Velocity Force
	"arg4"	"1.0"		//Activates the Gravity Force after X seconds
	"arg5"	"80.0"		//Gravity Force After 'arg4' duration
	"arg6"	"2.0"		//Gravity Force Duration
	"arg7"	"1"			//Explode Buildings at rage distance?
	"arg8"	"0.0"		// Damage to player (Added for BvB option, since bosses can't get falldamage)		
	"arg9"	"utaunt_glowyplayer_purple_parent"	// Particle Effect applied to player
	"arg10"	"head"								// Particle Effect Position
	
	// Ability Management System
	"arg1001"	"0.0" 						// delay before first use
	"arg1002"	"10.0" 						// cooldown
	"arg1003"	"Sigma" 					// name
	"arg1004"	"The Universe Sings to ME!"	// description
	"arg1005"	"20" 						// rage cost
	"arg1006"	"0" 						// index for ability in the AMS menu
	"plugin_name"	"ff2_gravity"
}
For Sounds:
Code:
"sound_sigma"
{
	"1" "freak_fortress_2/myboss/gravitywarp01.mp3"
	"2" "freak_fortress_2/myboss/gravitywarp02.mp3"
}

The Ability Management System:
Code:
	"abilityX"
	{
		"name"	"ability_management_system"
		"arg1"	"0" // activation key. 0=E, 1=R, 2=MIDDLE MOUSE, 3=USE(not bound by default)
		"arg2"	"1" // selection key. 0=not usable, 1=R, 2=MIDDLE MOUSE, 3=USE(not bound by default)
		"arg3"	"3" // reverse selection key. 0=not usable, 1=R, 2=MIDDLE MOUSE, 3=USE(not bound by default) [note: hidden feature, keeping this standard going]
		"arg4"	"0xc00000" // HUD color (unavailable)
		"arg5"	"%s (%.0f rage) [RELOAD (R) to change]\n%s\nAbility is currently unavailable." // HUD text format (unavailable)
		"arg6"	"0xffffff" // HUD color (available)
		"arg7"	"%s (%.0f rage) [RELOAD (R) to change]\n%s\nAbility is available. (press E)" // HUD text format (available)
		"arg8"	"0.68" // HUD Y
		"arg9"	"RAGE Meter: %.0f%%\nHP: %d / %d" // HUD replacement text
		"arg10"	"0.80" // HUD replacement Y
		"plugin_name"	"ff2_sarysapub3"
	}
The Menu Abilities
Code:
"abilityX"
{
	"name"		"special_menu_manager"

	"slot"		"1"	// 0	Ability Slot

	"tick"		"0.1"		// 1	Menu Tick Interval
	"weapon"	"1"		// 2	Required Holding Weapon Slot (-1 for all weapons)
	"jarate"	"15.0"		// 3	Jarate Cooldown
	"random"	"0"		// 4	Max Random Amount of Spells (0 to use all spells)
	"refresh"	"0x0000"	// 5	When to Refresh Set Spells (if arg4/random is used)
	// 0x0001: On Kill
	// 0x0002: On Spell Usage
	"rage"		"2"		// 6	Wether to Disable Using Rage (2 hides the HUD)

	"mana1"		"Quantum"		// 10	Name of Mana
	"max1"		"-1.0"		// 11	Maximum Amount (-1 for no limit)
	"start1"	"0.0"		// 12	Starting Amount
	"roll1"		"0.0"		// 13	Displayed Rolling Speed (Maximum change every menu tick)
	"kill1"		"0.0"		// 14	Amount on Kill
	"hit1"		"0.0"		// 15	Amount per Damage Dealt
	"hurt1"		"1.0"		// 16	Amount per Damage Taken
	"time1"		"0.0"		// 17	Amount per Menu Tick
	"blast1"	"350.0"		// 18	Amount on Airblasted

	"name1"		"Low Gravity for You"		// 100	Name of Spell
	"ability1a"	"rage_gravity_0"	// 101	Ability Name 1
	"plugin1a"	"ff2_gravity"	// 102	Plugin Name 1
	"slot1a"	"-1"			// 103	Ability Slot 1
	"button1a"	"0"			// 104	Buttonmode 1
	"cost1a"	"3500.0"		// 110	Cost of Mana Type 1
	"initial1"	"5.0"			// 120	Initial Cooldown
	"cooldown1"	"225.0"			// 121	Spell Cooldown
	"global1"	"30.0"			// 122	Global Cooldown
	"spell1"	"0x0006"		// 123	Spell Type
	// 0x0001: Magic
	// 0x0002: Heavy
	// 0x0004: Summon
	// 0x0008: Partner
	// 0x0010: Last Life
	"particle1"	""			// 131	Particle Effect
	"attach1"	""			// 132	Particle Attachment Point

	"plugin_name"	"ffbat_menu_abilities"
}
Include file usage for developers
Spoiler

  • Ver 1.0.0
  • The ability is created
  • Ver 1.1.0
  • Added rage_shockwave
  • Now its compatible with ff2_summonaboss.ff2 (At least without AMS)
  • Ver 1.2.0
  • Added New Rage "rage_sigma"
  • Fixed issue with "rage_shockwave" dealts damage to friendly buildings
  • Ver 1.2.1
  • Now PrintToServer() Functions only writes the name of the player who has the ability ex:
  • Sound section name in "rage_sigma" changed "rage_sigma" to "sound_sigma"
  • Damage to player can be defined now in "rage_sigma" on arg8
  • Now Particle Applied to enemy can be selected in "rage_sigma" on arg9 and arg10
  • Ver 1.2.5
  • Include file created for exetended usage
  • Ver 1.3.0
  • Server Crash issues fixed
Attached Files
File Type: inc ff2_gravity.inc (5.7 KB, 16 views)
File Type: smx ff2_gravity.smx (16.5 KB, 18 views)
File Type: sp Get Plugin or Get Source (ff2_gravity.sp - 11 views - 25.4 KB)
__________________
My Steam Profile
My Discord Name: J0BL3SS#5320



Last edited by J0BL3SS; 03-17-2021 at 06:16. Reason: Server Crash issues fixed
J0BL3SS is offline
WhiteFalcon
Member
Join Date: Nov 2019
Old 02-02-2021 , 13:02   Re: [Subplugin] Gravity
Reply With Quote #2

You shouldn't pass raw index to timer since a client may leave/rejoin mid-rage and his index become invalid, use GetClientSerial/GetClientFromSerial or GetClientUserId/GetClientOfUserId
WhiteFalcon is offline
J0BL3SS
Senior Member
Join Date: Sep 2020
Location: Berke's Sex Dungeon
Old 02-02-2021 , 13:45   Re: [Subplugin] Gravity
Reply With Quote #3

Quote:
Originally Posted by WhiteFalcon View Post
You shouldn't pass raw index to timer since a client may leave/rejoin mid-rage and his index become invalid, use GetClientSerial/GetClientFromSerial or GetClientUserId/GetClientOfUserId
I still don't understannd how timers work. Should have i use like that? Or should i check player is valid or not in the timer void?

Code:
CreateTimer(GRV_Duration[Num][bossClientIdx], SetGravity, GetClientUserId(iClient), TIMER_FLAG_NO_MAPCHANGE);

public Action SetGravity(Handle timer, int iClient)
{
	SetEntityGravity(iClient, 1.0);
}
__________________
My Steam Profile
My Discord Name: J0BL3SS#5320



Last edited by J0BL3SS; 02-02-2021 at 13:50.
J0BL3SS is offline
WhiteFalcon
Member
Join Date: Nov 2019
Old 02-02-2021 , 14:03   Re: [Subplugin] Gravity
Reply With Quote #4

Check out the wiki for Timers
And also you might find this useful aswell
Code:
CreateTimer(GRV_Duration[Num][bossClientIdx], SomeCallback, GetClientUserId(iClient), TIMER_FLAG_NO_MAPCHANGE /* Invalidate the timer during level change */);

public Action SomeCallback(Handle timer, int userid)
{
	int client = GetClientOfUserId(userid);
	if (!client)
	{
		// GetClientFromSerial and GetClientOfUserId returns 0 if serial was invalid aka that client left, only checking if it's not 0 should be enough
		return Plugin_Continue;
	}
	
	SetEntityGravity(client, 1.0);
	return Plugin_Continue;
}
WhiteFalcon is offline
J0BL3SS
Senior Member
Join Date: Sep 2020
Location: Berke's Sex Dungeon
Old 02-03-2021 , 05:51   Re: [Subplugin] Gravity (Updated 03.02.2021)
Reply With Quote #5

  • Ver 1.1.0
  • Added rage_shockwave
  • Now its compatible with ff2_summonaboss.ff2 (At least without AMS)
__________________
My Steam Profile
My Discord Name: J0BL3SS#5320


J0BL3SS is offline
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 02-03-2021 , 11:55   Re: [Subplugin] Gravity
Reply With Quote #6

Quote:
Originally Posted by WhiteFalcon View Post
Check out the wiki for Timers
And also you might find this useful aswell
Code:
CreateTimer(GRV_Duration[Num][bossClientIdx], SomeCallback, GetClientUserId(iClient), TIMER_FLAG_NO_MAPCHANGE /* Invalidate the timer during level change */);

public Action SomeCallback(Handle timer, int userid)
{
	int client = GetClientOfUserId(userid);
	if (!client)
	{
		// GetClientFromSerial and GetClientOfUserId returns 0 if serial was invalid aka that client left, only checking if it's not 0 should be enough
		return Plugin_Continue;
	}
	
	SetEntityGravity(client, 1.0);
	return Plugin_Continue;
}
That's not enough. GetClientOfUserId can return non-zero index of client that's not in game.
Check this thread, especially this post.
__________________
MAGNAT2645 is offline
J0BL3SS
Senior Member
Join Date: Sep 2020
Location: Berke's Sex Dungeon
Old 02-10-2021 , 11:19   Re: [Subplugin] Gravity (Updated 10.02.2021)
Reply With Quote #7

  • Ver 1.2.0
  • Added New Rage "rage_sigma"
  • Fixed issue with "rage_shockwave" dealts damage to friendly buildings
__________________
My Steam Profile
My Discord Name: J0BL3SS#5320


J0BL3SS is offline
Maple Syrup
Junior Member
Join Date: Jan 2020
Old 03-09-2021 , 15:30   Re: [Subplugin] Gravity (Updated 10.02.2021)
Reply With Quote #8

Sorry for asking but, I have an issue as I keep getting this error in the console when the plugin is on my test server.
Spoiler

It happens whenever the round starts no matter what boss it is.

The ability works great but this error keeps showing and, I don't know if it's a problem with the server or if it's the plugin. (I don't really have much experience when it comes to plugins .-.)

The ability I am using is rage_sigma. I would love to use this ability for my boss but, I can't seem to work around this issue.
Maple Syrup is offline
J0BL3SS
Senior Member
Join Date: Sep 2020
Location: Berke's Sex Dungeon
Old 03-10-2021 , 00:26   Re: [Subplugin] Gravity (Updated 10.02.2021)
Reply With Quote #9

Quote:
Originally Posted by Maple Syrup View Post
Sorry for asking but, I have an issue as I keep getting this error in the console when the plugin is on my test server.
Spoiler

It happens whenever the round starts no matter what boss it is.

The ability works great but this error keeps showing and, I don't know if it's a problem with the server or if it's the plugin. (I don't really have much experience when it comes to plugins .-.)

The ability I am using is rage_sigma. I would love to use this ability for my boss but, I can't seem to work around this issue.
Its not an error, its telling you the respawned player has no boss index, which is a way to make compatible ff2_summonaboss. Im hooking abilities when a player respawns, not when round starts, the normal players will cause this message so that means youre testing plugins with 6-12 bot . You can ignore that message. I gotta remove that message soon i update the plugin
__________________
My Steam Profile
My Discord Name: J0BL3SS#5320



Last edited by J0BL3SS; 03-10-2021 at 00:28.
J0BL3SS is offline
J0BL3SS
Senior Member
Join Date: Sep 2020
Location: Berke's Sex Dungeon
Old 03-10-2021 , 07:14   Re: [Subplugin] Gravity (Updated 10.03.2021)
Reply With Quote #10

  • Ver 1.2.1
  • Now PrintToServer() Functions only writes the name of the player who has the ability ex:
  • Sound section name in "rage_sigma" changed "rage_sigma" to "sound_sigma"
  • Damage to player can be defined now in "rage_sigma" on arg8
  • Now Particle Applied to enemy can be selected in "rage_sigma" on arg9 and arg10
__________________
My Steam Profile
My Discord Name: J0BL3SS#5320



Last edited by J0BL3SS; 03-10-2021 at 07:16.
J0BL3SS is offline
Reply


Thread Tools
Display Modes

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 01:27.


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