ESF天神殿CS七龙珠|ESFKAMI Earth's Special Forces Homepage
Forum Home Forum Home > 代码|Codes > CCI代码|CCI Code
  New Posts New Posts
  FAQ FAQ  Forum Search    RegisterRegister  Login Login

[特殊技|SX]龙拳|Dragonfist

 Post Reply Post Reply
Author
Message
Jerry小坏 View Drop Down
Admin Group
Admin Group
Avatar

Joined: 10 Dec 2016
Location: China
Posts: 271
Post Options Post Options   Quote Jerry小坏 Quote  Post ReplyReply Direct Link To This Post Topic: [特殊技|SX]龙拳|Dragonfist
    Posted: 20 Mar 2017 at 4:01pm
#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();
}
}


Edited by Jerry小坏 - 25 Mar 2017 at 12:19pm
Back to Top
 Post Reply Post Reply

Quick Reply
Name:

Message:
   Enable BBcodes to format post
Security Code:
Code Image - Please contact webmaster if you have problems seeing this image code Load New Code
CAPTCHA Software by Web Wiz CAPTCHA version 4.0 wwf
Copyright ©2005-2008 Web Wiz
Please enter the Security Code exactly as shown in image format.
Cookies must be enabled on your web browser.
 

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.64 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in .125 seconds.