Raised This Month: $ Target: $400
 0% 

[TF2][FF2]Give Passive abillity for Boss


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Research
SourceMod Donor
Join Date: Nov 2011
Old 02-26-2015 , 00:46   [TF2][FF2]Give Passive abillity for Boss
Reply With Quote #1

I found TFCond_StealthedUserBuffFade and think this is very good idea for The Hidden mod
so I put this code in FF2 but it's not working perfectly.

PHP Code:
new Boss;
new 
bool:TheHidden false;

public 
Action:event_round_start(Handle:event, const String:name[], bool:dontBroadcast)
{
    
Boss 0;
    new 
client GetClientOfUserId(FF2_GetBossUserId(0));
    
TF2_RemoveCondition(clientTFCond_StealthedUserBuffFade);
    if (
FF2_HasAbility(clientthis_plugin_name"thehiddeninff2"))
    {
        
TheHidden true;
        
CreateTimer(0.2Timer_HiddenclientTIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
        
PrintToChatAll("[The Hidden] The Hidden Mod in FF2!");
    }
}

public 
Action:Timer_Hidden(Handle:timer)
{
    if (!
TheHidden) return Plugin_Stop;
    
    for(new 
1<= MaxClientsi++)
    {
        if(
IsValidEdict(i) && IsClientConnected(i) && !IsFakeClient(i) && FF2_GetBossIndex(i) != -1)
        {
            
TF2_AddCondition(iTFCond_StealthedUserBuffFade);
            
TF2_RemoveCondition(iTFCond_OnFire);
            
TF2_RemoveCondition(iTFCond_Bonked);
            
TF2_RemoveCondition(iTFCond_Milked);
            
TF2_RemoveCondition(iTFCond_Bleeding);
            
TF2_RemoveCondition(iTFCond_MarkedForDeath);
        }
    }
    return 
Plugin_Continue;
}

public 
Action:event_round_end(Handle:event, const String:name[], bool:dontBroadcast)
{
    
TheHidden false;

want to make boss always in TFCond_StealthedUserBuffFade(cuz StealthedUserBuffFade make boss can attack in cloak)
and if boss get condition OnFire, Bonked, Milked, Bleeding, MarkedForDeath: ability remove that conditions right away.
when round end, if next boss is not hidden, all hidden ability is disabled for next boss.

my code working but sometime other boss can get 'thehiddeninff2'(hidden ability) who don't have 'thehiddeninff2' in cfg.

trying to use ongameframe or SDKHook_PreThink and realize I don't know how can use this thing. darn

help me for fix this
Research is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 02-26-2015 , 03:31   Re: [TF2][FF2]Give Passive abillity for Boss
Reply With Quote #2

Try this
PHP Code:
new Boss;
new 
bool:TheHidden[MAXPLAYERS];

public 
Action:event_round_start(Handle:event, const String:name[], bool:dontBroadcast)
{
    
Boss 0;
    new 
client GetClientOfUserId(FF2_GetBossUserId(0));
    
TF2_RemoveCondition(clientTFCond_StealthedUserBuffFade);
    if (
FF2_HasAbility(clientthis_plugin_name"thehiddeninff2"))
    {
        
TheHidden[client] = true;
        
CreateTimer(0.2Timer_HiddenclientTIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
        
PrintToChatAll("[The Hidden] The Hidden Mod in FF2!");
        
TF2_AddCondition(clientTFCond_StealthedUserBuffFadeTFCondDuration_Infinite); //adding stealthed addcond on boss spawn.
    
}
}

public 
Action:Timer_Hidden(Handle:timerany:client//fixed timer header 4 u 2 include the client.
{
    if( 
GameRules_GetRoundState() == RoundState_TeamWin //removes hidden from a client on round win.
        
TheHidden[client] = false;
    if (!
TheHidden[client]) 
    {
        return 
Plugin_Stop;
    }
    if(
IsPlayerAlive(client)) //removing addcond from alive boss.
    
{
            
TF2_RemoveCondition(clientTFCond_OnFire);
            
TF2_RemoveCondition(clientTFCond_Bonked);
            
TF2_RemoveCondition(clientTFCond_Milked);
            
TF2_RemoveCondition(clientTFCond_Bleeding);
            
TF2_RemoveCondition(clientTFCond_MarkedForDeath);
    }
    
/*for(new i = 1; i <= MaxClients; i++) // this performs on all clients instead of boss so disable this
    {
        if(IsValidEdict(i) && IsClientConnected(i) && !IsFakeClient(i) && FF2_GetBossIndex(i) != -1)
        {
            TF2_AddCondition(i, TFCond_StealthedUserBuffFade);
            TF2_RemoveCondition(i, TFCond_OnFire);
            TF2_RemoveCondition(i, TFCond_Bonked);
            TF2_RemoveCondition(i, TFCond_Milked);
            TF2_RemoveCondition(i, TFCond_Bleeding);
            TF2_RemoveCondition(i, TFCond_MarkedForDeath);
        }
    }
    */
    
return Plugin_Continue;

edit changed code a bit
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player

Last edited by Michalplyoutube; 02-26-2015 at 06:55.
Michalplyoutube is offline
Research
SourceMod Donor
Join Date: Nov 2011
Old 02-26-2015 , 06:45   Re: [TF2][FF2]Give Passive abillity for Boss
Reply With Quote #3

Quote:
Originally Posted by Michalplyoutube View Post
Try this
Thanks for first fix.
add TFCond_StealthedUserBuffFade and disable TFCond_StealthedUserBuffFade is working but Timer_Hidden is not. Don't know why it's not working :/
Research is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 02-26-2015 , 06:54   Re: [TF2][FF2]Give Passive abillity for Boss
Reply With Quote #4

Quote:
Originally Posted by Research View Post
Thanks for first fix.
add TFCond_StealthedUserBuffFade and disable TFCond_StealthedUserBuffFade is working but Timer_Hidden is not. Don't know why it's not working :/
What u mean addconds are not getting removed?
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
Research
SourceMod Donor
Join Date: Nov 2011
Old 02-26-2015 , 07:00   Re: [TF2][FF2]Give Passive abillity for Boss
Reply With Quote #5

Quote:
Originally Posted by Michalplyoutube View Post
What u mean addconds are not getting removed?
Yes.
Research is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 02-26-2015 , 07:10   Re: [TF2][FF2]Give Passive abillity for Boss
Reply With Quote #6

Use this

PHP Code:
    if(IsPlayerAlive(client)) //removing addcond from alive boss.
    
{
            
TF2_RemoveCondition(clientTFCond_OnFire);
            
TF2_RemoveCondition(clientTFCond_Bonked);
            
TF2_RemoveCondition(clientTFCond_Milked);
            
TF2_RemoveCondition(clientTFCond_Bleeding);
            
TF2_RemoveCondition(clientTFCond_MarkedForDeath);
    } 
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
Research
SourceMod Donor
Join Date: Nov 2011
Old 02-26-2015 , 07:22   Re: [TF2][FF2]Give Passive abillity for Boss
Reply With Quote #7

Quote:
Originally Posted by Michalplyoutube View Post
Use this

PHP Code:
    if(IsPlayerAlive(client)) //removing addcond from alive boss.
    
{
            
TF2_RemoveCondition(clientTFCond_OnFire);
            
TF2_RemoveCondition(clientTFCond_Bonked);
            
TF2_RemoveCondition(clientTFCond_Milked);
            
TF2_RemoveCondition(clientTFCond_Bleeding);
            
TF2_RemoveCondition(clientTFCond_MarkedForDeath);
    } 
PHP Code:
L 02/26/2015 21:19:57: [SMNative "IsPlayerAlive" reportedInvalid client index 0
L 02
/26/2015 21:19:57: [SMDisplaying call stack trace for plugin "freaks/ff2_in_hidden.ff2":
L 02/26/2015 21:19:57: [SM]   [0]  Line 2495ff2_in_hidden.sp::Timer_Hidden() 
darn.
Research is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 02-26-2015 , 07:43   Re: [TF2][FF2]Give Passive abillity for Boss
Reply With Quote #8

Quote:
Originally Posted by Research View Post
PHP Code:
L 02/26/2015 21:19:57: [SMNative "IsPlayerAlive" reportedInvalid client index 0
L 02
/26/2015 21:19:57: [SMDisplaying call stack trace for plugin "freaks/ff2_in_hidden.ff2":
L 02/26/2015 21:19:57: [SM]   [0]  Line 2495ff2_in_hidden.sp::Timer_Hidden() 
darn.
Perhaps try this:
PHP Code:
    if(client && IsPlayerAlive(client)) //removing addcond from alive boss.
    
{
            
TF2_RemoveCondition(clientTFCond_OnFire);
            
TF2_RemoveCondition(clientTFCond_Bonked);
            
TF2_RemoveCondition(clientTFCond_Milked);
            
TF2_RemoveCondition(clientTFCond_Bleeding);
            
TF2_RemoveCondition(clientTFCond_MarkedForDeath);
    } 
__________________
...
Oshizu is offline
Research
SourceMod Donor
Join Date: Nov 2011
Old 02-26-2015 , 08:00   Re: [TF2][FF2]Give Passive abillity for Boss
Reply With Quote #9

Quote:
Originally Posted by Oshizu View Post
Perhaps try this:
PHP Code:
    if(client && IsPlayerAlive(client)) //removing addcond from alive boss.
    
{
            
TF2_RemoveCondition(clientTFCond_OnFire);
            
TF2_RemoveCondition(clientTFCond_Bonked);
            
TF2_RemoveCondition(clientTFCond_Milked);
            
TF2_RemoveCondition(clientTFCond_Bleeding);
            
TF2_RemoveCondition(clientTFCond_MarkedForDeath);
    } 
thanks for help.
no more error but timer still not working

Last edited by Research; 02-26-2015 at 08:01.
Research is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 02-26-2015 , 08:37   Re: [TF2][FF2]Give Passive abillity for Boss
Reply With Quote #10

Quote:
Originally Posted by Research View Post
thanks for help.
no more error but timer still not working
The timer works it must be working

Whats not working in timer?
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube 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 01:28.


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