Raised This Month: $32 Target: $400
 8% 

FF2 Help with FF2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Athena AI
Junior Member
Join Date: Jul 2018
Old 02-16-2019 , 00:04   Help with FF2
Reply With Quote #1

Hello, I would like to know if there is anyways to detect when the hale rages. And it doing something on a different plugin. Example. Let's say I have a plugin that lets players cast spells, but I want spells to be disabled on a hale's rage. Any help would be appreciated!
Athena AI is offline
Batfoxkid
Senior Member
Join Date: Nov 2018
Location: ''On the map''
Old 02-16-2019 , 01:03   Re: Help with FF2
Reply With Quote #2

Well common method is to check when the player stunned, other methods might have to be setting a timer for the boss's rage duration, checking conditions, etc.
__________________
Batfoxkid is offline
Athena AI
Junior Member
Join Date: Jul 2018
Old 02-16-2019 , 07:45   Re: Help with FF2
Reply With Quote #3

Yeah, that would work the problem is the rages on the server I work with don't use stun all the time. I was thinking about using FF2_OnAbility, but for some reason, it isn't triggering at all.
Athena AI is offline
AnubisTF2
Senior Member
Join Date: Oct 2015
Old 02-16-2019 , 16:10   Re: Help with FF2
Reply With Quote #4

Quote:
Originally Posted by Athena AI View Post
Yeah, that would work the problem is the rages on the server I work with don't use stun all the time. I was thinking about using FF2_OnAbility, but for some reason, it isn't triggering at all.
snippet?
__________________
naw
AnubisTF2 is offline
Athena AI
Junior Member
Join Date: Jul 2018
Old 02-16-2019 , 16:59   Re: Help with FF2
Reply With Quote #5

Quote:
Originally Posted by AnubisTF2 View Post
snippet?
Code:
//-----------------------------------------------------------------------------------------------
//Purpose: Spell Disabler
//-----------------------------------------------------------------------------------------------
public Action FF2_OnAbility2(bossIdx, const char[] plugin_name, const String:ability_name[], int status)
{
	for(int client = 1; client <= MaxClients; client++)
	{
		cooldown[client] = 100; //Sets the cool down to 10 seconds
		spellType[client] = -1; //Sets Spell to none
		mana[client] = mana[client] / 2; //And reduces player's mana by half
	}
	return Plugin_Continue;
}
Here.

Last edited by Athena AI; 02-16-2019 at 17:02.
Athena AI is offline
AnubisTF2
Senior Member
Join Date: Oct 2015
Old 02-16-2019 , 17:27   Re: Help with FF2
Reply With Quote #6

right now, you're changing those values for every single player.
ideally, you'll want to add something like this:

if(TF2_GetClientTeam(client) == TFTeam_Blue)

so it checks to make sure that the player is on blue (boss)
there are multiple ways to do this but this is just one.

where in the code do you check if the player has spellType, or cooldown?
__________________
naw
AnubisTF2 is offline
Athena AI
Junior Member
Join Date: Jul 2018
Old 02-16-2019 , 17:35   Re: Help with FF2
Reply With Quote #7

Uh, this is a plugin for the red team should've probably specified that. And its set to OnCallForMedic so they are able to cast the spell when calling medic.
Athena AI is offline
AnubisTF2
Senior Member
Join Date: Oct 2015
Old 02-16-2019 , 20:17   Re: Help with FF2
Reply With Quote #8

right, but
where in the code do you check if the player has spellType, or cooldown?
show me the block
__________________
naw
AnubisTF2 is offline
Athena AI
Junior Member
Join Date: Jul 2018
Old 02-16-2019 , 20:41   Re: Help with FF2
Reply With Quote #9

Quote:
Originally Posted by AnubisTF2 View Post
right, but
where in the code do you check if the player has spellType, or cooldown?
show me the block
Code:
public Action:OnCallForMedic(client, const String:command[], args)
{
	new Float:mercpos[3];
	new String:modelname[128];
	if(MercState2[client] == true && IsPlayerAlive(client) && IsValidClient(client))
	{
		if (cooldown[client] < 1)
		{
			GetEntPropString(client, Prop_Data, "m_ModelName", modelname, 128);
			if (spellType[client] == 1 && mana[client] >= 250) // bats
			{
				GetClientAbsOrigin(client, mercpos);
				decl String:medSound[35];
				Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast%i.mp3", GetRandomInt(1, 7));
				EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
				FakeClientCommand(client, "use tf_weapon_spellbook")
				//cast_sound[client] = -1;
				cooldown[client] = 25;
				mana[client] = mana[client] - 250;
			}
			else if (spellType[client] == 0 && mana[client] >= 200) //fire spell
			{
				GetClientAbsOrigin(client, mercpos);
				decl String:medSound[35];
				Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast_fire%i.mp3", GetRandomInt(1, 4));
				EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
				FakeClientCommand(client, "use tf_weapon_spellbook")
				//cast_sound[client] = -1;
				cooldown[client] = 25;
				mana[client] = mana[client] - 200;
			}
			else if (spellType[client] == 9 && mana[client] >= 900) //Meteor spell
			{
				GetClientAbsOrigin(client, mercpos);
				decl String:medSound[35];
				Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast_rare%i.mp3", GetRandomInt(1, 2));
				EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
				FakeClientCommand(client, "use tf_weapon_spellbook")
				//cast_sound[client] = -1;
				cooldown[client] = 75;
				mana[client] = mana[client] - 900;
			}
			else if (spellType[client] == 10 && mana[client] >= 750) //Monoculous
			{
				GetClientAbsOrigin(client, mercpos);
				decl String:medSound[35];
				Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast_rare%i.mp3", GetRandomInt(1, 4));
				EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
				FakeClientCommand(client, "use tf_weapon_spellbook")
				cooldown[client] = 45;
				mana[client] = mana[client] - 750;
			}
			else if (spellType[client] == 2 && mana[client] >= 600) //Uber spell
			{
				GetClientAbsOrigin(client, mercpos);
				decl String:medSound[35];
				Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast%i.mp3", GetRandomInt(1, 4));
				EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
				FakeClientCommand(client, "use tf_weapon_spellbook")
				cooldown[client] = 65;
				mana[client] = mana[client] - 600;
			}
			else if (spellType[client] == 4 && mana[client] >= 350) // Jump
			{
				GetClientAbsOrigin(client, mercpos);
				decl String:medSound[35];
				Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast%i.mp3", GetRandomInt(1, 4));
				EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
				FakeClientCommand(client, "use tf_weapon_spellbook")
				cooldown[client] = 15;
				mana[client] = mana[client] - 350;
			}
			else if (spellType[client] == 5 && mana[client] >= 200) //Invis spell
			{
				GetClientAbsOrigin(client, mercpos);
				decl String:medSound[35];
				Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast%i.mp3", GetRandomInt(1, 4));
				EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
				FakeClientCommand(client, "use tf_weapon_spellbook")
				cooldown[client] = 15;
				mana[client] = mana[client] - 200;
			}
			else
			{

				cooldown[client] = 15;
			}
		}
		else
		{
			//FakeClientCommand(client, "use tf_weapon_spellbook");
			return Plugin_Continue;
		}
	}
	return Plugin_Continue;
}
Athena AI is offline
AnubisTF2
Senior Member
Join Date: Oct 2015
Old 02-18-2019 , 12:12   Re: Help with FF2
Reply With Quote #10

Quote:
Originally Posted by Athena AI View Post
Code:
public Action:OnCallForMedic(client, const String:command[], args)
{
	new Float:mercpos[3];
	new String:modelname[128];
	if(MercState2[client] == true && IsPlayerAlive(client) && IsValidClient(client))
	{
		if (cooldown[client] < 1)
		{
			GetEntPropString(client, Prop_Data, "m_ModelName", modelname, 128);
			if (spellType[client] == 1 && mana[client] >= 250) // bats
			{
				GetClientAbsOrigin(client, mercpos);
				decl String:medSound[35];
				Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast%i.mp3", GetRandomInt(1, 7));
				EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
				FakeClientCommand(client, "use tf_weapon_spellbook")
				//cast_sound[client] = -1;
				cooldown[client] = 25;
				mana[client] = mana[client] - 250;
			}
			else if (spellType[client] == 0 && mana[client] >= 200) //fire spell
			{
				GetClientAbsOrigin(client, mercpos);
				decl String:medSound[35];
				Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast_fire%i.mp3", GetRandomInt(1, 4));
				EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
				FakeClientCommand(client, "use tf_weapon_spellbook")
				//cast_sound[client] = -1;
				cooldown[client] = 25;
				mana[client] = mana[client] - 200;
			}
			else if (spellType[client] == 9 && mana[client] >= 900) //Meteor spell
			{
				GetClientAbsOrigin(client, mercpos);
				decl String:medSound[35];
				Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast_rare%i.mp3", GetRandomInt(1, 2));
				EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
				FakeClientCommand(client, "use tf_weapon_spellbook")
				//cast_sound[client] = -1;
				cooldown[client] = 75;
				mana[client] = mana[client] - 900;
			}
			else if (spellType[client] == 10 && mana[client] >= 750) //Monoculous
			{
				GetClientAbsOrigin(client, mercpos);
				decl String:medSound[35];
				Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast_rare%i.mp3", GetRandomInt(1, 4));
				EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
				FakeClientCommand(client, "use tf_weapon_spellbook")
				cooldown[client] = 45;
				mana[client] = mana[client] - 750;
			}
			else if (spellType[client] == 2 && mana[client] >= 600) //Uber spell
			{
				GetClientAbsOrigin(client, mercpos);
				decl String:medSound[35];
				Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast%i.mp3", GetRandomInt(1, 4));
				EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
				FakeClientCommand(client, "use tf_weapon_spellbook")
				cooldown[client] = 65;
				mana[client] = mana[client] - 600;
			}
			else if (spellType[client] == 4 && mana[client] >= 350) // Jump
			{
				GetClientAbsOrigin(client, mercpos);
				decl String:medSound[35];
				Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast%i.mp3", GetRandomInt(1, 4));
				EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
				FakeClientCommand(client, "use tf_weapon_spellbook")
				cooldown[client] = 15;
				mana[client] = mana[client] - 350;
			}
			else if (spellType[client] == 5 && mana[client] >= 200) //Invis spell
			{
				GetClientAbsOrigin(client, mercpos);
				decl String:medSound[35];
				Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast%i.mp3", GetRandomInt(1, 4));
				EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
				FakeClientCommand(client, "use tf_weapon_spellbook")
				cooldown[client] = 15;
				mana[client] = mana[client] - 200;
			}
			else
			{

				cooldown[client] = 15;
			}
		}
		else
		{
			//FakeClientCommand(client, "use tf_weapon_spellbook");
			return Plugin_Continue;
		}
	}
	return Plugin_Continue;
}
where's the if to check if the hale has raged?
also, put isvalidclient before anything. if you dont you'll likely get spam in error logs about "Client X doesn't exist"
double and, no need to check if they're alive since validclient checks that
__________________
naw
AnubisTF2 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 19:23.


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