|
|
- #include < xtension/special >
- #include "amxx/hamsandwich" // >>Remember to Enable this module in "addons\amxmodx\configs\modules.ini"
- #include "ipci/ascend"
- stock SpecialXtension: sxDragonfist;
- new DragonHead[ 33 ];
- public plugin_init ()
- {
- register_plugin( "Dragonfist", "1.0", "ESFKAMI" );
- RegisterHam( Ham_TakeDamage, "bot", "@TakeDamage" );
- RegisterHam( Ham_TakeDamage, "player", "@TakeDamage" );
- }
- public plugin_precache() precache_model( "models/evolution/dragonfist.mdl" );
- public client_PostThink( Client )
- {
- if( getClientSWOOPDIRECTION( Client ) == SWOOP_FORWARD ) return;
- if( getClientSPECIALSTATE( Client, sxDragonfist ) )
- {
- if( is_valid_ent( DragonHead[ Client ] ) )
- remove_entity( DragonHead[ Client ] );
- DragonHead[ Client ] = 0;
- setClientPROTECT( Client, false );
- setClientSPEEDMP( Client, 1.000_000 );
- setClientSPECIALSTATE( Client, sxDragonfist, false );
- setClientSPECIALCOOLDOWN( Client, sxDragonfist, 60.000_000 );
- }
- }
- public @SpecialCreation ()
- {
- beginSpecialCreation( "Dragonfist", "www.esfkami.net", "@Dragonfist", "special_dragonfist", true );
- addSpecialCharge( IN_ATTACK, 0.500_000, 80.000_000, true );
- addSpecialControl( IN_JUMP );
- sxDragonfist = endSpecialCreation();
- }
- public @Dragonfist ( Client, CSpecialState:Status, Control, Float:Charge )
- {
- switch ( Status )
- {
- case ssCharge: // called every 0.1 secs
- {
-
- if( getClientSWOOPDIRECTION( Client ) != SWOOP_FORWARD ) return false;
- if( Charge == -1.000_000 ) emitClientSOUND( Client, CHAN_BODY, "*/wc_dragonfist.wav" );
- return true;
- }
-
- case ssChargeReleased:
- {
- if ( Charge >= 1.0 )
- {
- setClientPROTECT( Client, true );
- //setClientKI( Client, 1000.000_000 );
- setClientSPEEDMP( Client, 10.000_000 );
- setClientSWOOPTIME( Client, getClientSWOOPTIME( Client ) + 10.000_000 );
- emitClientSOUND( Client, CHAN_WEAPON, "*/w_dragonfist.wav" );
- DragonHead[ Client ] = create_entity( "env_model" );
- engfunc( EngFunc_SetModel, DragonHead[ Client ], "models/evolution/dragonfist.mdl" );
- set_rendering( DragonHead[ Client ], kRenderFxNone, 0, 0, 0, kRenderTransAdd, 100 );
- set_pev( DragonHead[ Client ], pev_aiment, Client );
- set_pev( DragonHead[ Client ], pev_movetype , MOVETYPE_FOLLOW );
- set_pev( DragonHead[ Client ], pev_scale, 0.200_000 );
- setClientSPECIALSTATE( Client, sxDragonfist, true );
- }
- }
-
- // Called when Charge > 0.0 by Death, Disconnect, IconSwitch to another Weapon, Out of Ki
- case ssChargeAborted: return false;
-
- case ssControlInvocation:
- {
- if ( Control == IN_JUMP )
- {
- if( is_valid_ent( DragonHead[ Client ] ) )
- remove_entity( DragonHead[ Client ] );
- DragonHead[ Client ] = 0;
- setClientPROTECT( Client, false );
- setClientSPEEDMP( Client, 1.000_000 );
- setClientSPECIALSTATE( Client, sxDragonfist, false );
- setClientSPECIALCOOLDOWN( Client, sxDragonfist, 60.000_000 );
- }
- return false;
- }
-
- // Called when Specialstate = true by Death, Disconnect, IconSwitch to another Weapon
- case ssForceAbort:
- {
- if( is_valid_ent( DragonHead[ Client ] ) )
- remove_entity( DragonHead[ Client ] );
- DragonHead[ Client ] = 0;
- setClientPROTECT( Client, false );
- setClientSPEEDMP( Client, 1.000_000 );
- setClientSPECIALCOOLDOWN( Client, sxDragonfist, 60.000_000 );
- return false;
- }
- }
- return true;
- }
- public @TakeDamage( Victim, Inflictor, Attacker, Float: Damage, DamageType )
- {
- if( !is_valid_ent( Attacker ) ) return;
- if( getClientSPECIALSTATE( Attacker, sxDragonfist ) )
- {
- SetHamParamFloat( 4, 256.000_000 );
- if( is_valid_ent( DragonHead[ Attacker ] ) )
- remove_entity( DragonHead[ Attacker ] );
- DragonHead[ Attacker ] = 0;
- new Float: org[ 3 ];
- pev( Victim, pev_origin, org );
- message_begin( MSG_PVS, SVC_TEMPENTITY );
- write_byte( TE_SPRITE );
- engfunc( EngFunc_WriteCoord, org[ 0 ] );
- engfunc( EngFunc_WriteCoord, org[ 1 ] );
- engfunc( EngFunc_WriteCoord, org[ 2 ] );
- write_short( engfunc( EngFunc_ModelIndex, "sprites/xflare1.spr" ) );
- write_byte( 20 );
- write_byte( 255 );
- message_end();
- setClientPROTECT( Attacker, false );
- setClientSPEEDMP( Attacker, 1.000_000 );
- setClientSPECIALSTATE( Attacker, sxDragonfist, false );
- setClientSPECIALCOOLDOWN( Attacker, sxDragonfist, 60.000_000 );
- set_msg_block( get_user_msgid( "DeathMsg" ), BLOCK_ONCE );
- message_begin( MSG_ALL, get_user_msgid( "DeathMsg" ) );
- write_byte( Attacker );
- write_byte( Victim );
- write_string( "Dragonfist" );
- message_end();
- }
- }
复制代码 |
|