Raised This Month: $ Target: $400
 0% 

Team color sprite!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 06-16-2011 , 16:47   Re: Team color sprite!
Reply With Quote #1

This is .inl file, part of war3ft mod... I can only give you a code...
Podarok is offline
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 06-16-2011 , 17:01   Re: Team color sprite!
Reply With Quote #2

Here is this .inl file
PHP Code:
*/
*    
RaceOrcish Horde Functions
*/

#define CHAINLIGHTNING_DAMAGE            50        // Initial ultimate damage
#define CHAINLIGHTNING_LINEWIDTH        80        // Width of the lightning sprite
#define CRITICAL_STRIKE_CHANCE            0.15    // 15% chance of Critical Strike working

// Initial Ultimate call
public OR_ULT_ChainLightningiCasteriTargetiBodyPart )
{

    
// Display the lightning effect
    
OR_ULT_ChainEffectiCasteriTargetCHAINLIGHTNING_LINEWIDTHCHAINLIGHTNING_DAMAGEiBodyPart );
    

    
// Now we need to search for the next "jump"
    
new parm[5];
    
parm[0] = iTarget;
    
parm[1] = CHAINLIGHTNING_DAMAGE;
    
parm[2] = CHAINLIGHTNING_LINEWIDTH;
    
parm[3] = iCaster;
    
parm[4] = iBodyPart;

    
set_task0.2"_OR_ULT_ChainLightning"TASK_LIGHTNING iTargetparm);
}

// Called on subsequent ultimate calls ( i.e. lightninghitnext )
public _OR_ULT_ChainLightningparm[5] )
{
    
// parm[0] = enemy
    // parm[1] = damage
    // parm[2] = linewidth
    // parm[3] = caster
    // parm[4] = bodypart

    
new iEnemy parm[0];

    if ( !
p_data_b[iEnemy][PB_ISCONNECTED] )
    {
        return;
    }

    new 
iCaster        parm[3];
    new 
iBodyPart    parm[4];
    new 
iCasterTeam    get_user_teamiCaster )

    new 
vOrigin[3];
    
get_user_originiEnemyvOrigin );

    new 
players[32], numberofplayers;
    
get_playersplayersnumberofplayers"a" );


    new 
iiTarget 0;
    new 
iClosestTarget 0iClosestDistance 0;
    new 
iDistanceBetween 0;
    new 
vTargetOrigin[3]

    
// Loop through every player
    
for ( 0numberofplayersi++ )
    {
        
iTarget players[i];
        
        
// Make sure our target player isn't on the same team!
        
if ( get_user_teamiTarget ) != iCasterTeam )
        {
            
get_user_originiTargetvTargetOrigin )
            
            
iDistanceBetween get_distancevOriginvTargetOrigin );

            
// Verify the user is within range and has not been previously hit
            
if ( iDistanceBetween LIGHTNING_RANGE && !p_data_b[iTarget][PB_LIGHTNINGHIT] )
            {

                
// Make sure target isn't immune!
                
if ( ULT_CanUserBlockUltiTarget )  )
                {
                    
ULT_RemoveChargeiTarget);
                    
                    
// Let the caster know the ultimate was blocked!
                    
ULT_BlockediCaster );
                    
                    
// Just say the user was hit so they aren't tried to be hit the next round (possibility of removing multiple charges)
                    
p_data_b[iTarget][PB_LIGHTNINGHIT] = true;
                }

                
// Then we can hit this user!
                
else
                {
                    
                    
// This user is closest!! Lets make a note of this...
                    
if ( iDistanceBetween iClosestDistance || iClosestTarget == )
                    {
                        
iClosestDistance iDistanceBetween;
                        
iClosestTarget iTarget;
                    }

                }
//end immune check
            
}//end distance/hit check
        
}//end team check
    
}//end for

    // Then we have a valid target!!!
    
if ( iClosestTarget )
    {
        
// Damage should be decreased by 2/3 on each jump
        
parm[1] = floatround(float(parm[2])*2/3);

        
// Decrease line width as well
        
parm[2] = floatround(float(parm[2])*2/3);
        
        
// Display the actual lightning
        
OR_ULT_ChainEffectiCasteriClosestTargetparm[2], parm[1], iBodyPart );

        
// Lets call this again on our next target!
        
parm[0] = iClosestTarget;
        
set_task0.2"_OR_ULT_ChainLightning"TASK_LIGHTNINGNEXT iCasterparm);
    }

    
// No valid target found - reset all lightning hit variables
    
else
    {
        for ( 
0numberofplayersi++ )
        {
            
iTarget players[i];

            
p_data_b[iTarget][PB_LIGHTNINGHIT] = false;
        }
    }

    return;
}

public 
OR_ULT_ChainEffectiCasteriTargetiLineWidthiDamageiBodyPart )
{

    
// Make sure we set this user as hit, otherwise we'll hit him again
    
p_data_b[iTarget][PB_LIGHTNINGHIT] = true;
    
    
// Damage the user
    
WC3_DamageiTargetiCasteriDamageCSW_LIGHTNINGiBodyPart );
    
    
// Create the lightining
new id=read_data(2) new CsTeams:team=cs_get_user_team(id) if(team==CS_TEAM_T) { Create_TE_BEAMENTSiCasteriTargetg_iSprites[SPR_LIGHTNING], 015 } else f(team==CS_TEAM_CT) { Create_TE_BEAMENTSiCasteriTargetg_iSprites[SPR_LIGHTNING], 015 }
    
// Get the target's origin
    
new vOrigin[3]
    
get_user_originiTargetvOrigin );
    
    
// Create an elight on the target
    
Create_TE_ELIGHTiTargetvOrigin10025525525510);

    
// Play the lightning sound
    
emit_soundiCasterCHAN_STATICg_szSounds[SOUND_LIGHTNING], 1.0ATTN_NORM0PITCH_NORM );

    return;
}

// Function checks to see if critical grenades are allowed
bool:OR_CriticalGrenadeAllowedid )
{

    
// Need to do the glove check
    
if ( ITEM_HasidITEM_GLOVES ) > ITEM_NONE && !get_pcvar_numCVAR_wc3_glove_orc_damage ) )
    {
        return 
false;
    }

    
// Check to see if we are on a disabled map
    
if ( g_bOrcNadesDisabled )
    {
        return 
false;
    }

    return 
true;
}

OR_SkillsOffensiveiAttackeriVictimiWeaponiDamageiHitPlace )
{
    static 
iSkillLevel;

    
// Critical Strike
    
iSkillLevel SM_GetSkillLeveliAttackerSKILL_CRITICALSTRIKE );
    if ( 
iSkillLevel )
    {

        if ( 
random_float0.01.0 ) <= CRITICAL_STRIKE_CHANCE )
        {
            new 
iSkillLevel SM_GetSkillLeveliAttackerSKILL_CRITICALSTRIKE );

            new 
iBonusDamage floatroundfloatiDamage ) * p_critical[iSkillLevel-1] );
            
            
// Damage our victim
            
WC3_DamageiVictimiAttackeriBonusDamageiWeaponiHitPlace );
            
            
// Make the user glow
            
SHARED_GlowiVictimiBonusDamage00);
            
            
// Lets make a screenfade
            
Create_ScreenFadeiVictim, (1<<10), (1<<10), (1<<12), 25500g_GlowLevel[iVictim][0] );
        }
    }

    
// Critical Grenade
    
iSkillLevel SM_GetSkillLeveliAttackerSKILL_CRITICALGRENADE );
    if ( 
iSkillLevel )
    {        
        
        
// Can only do this if the user has a grenade
        
if ( SHARED_IsGrenadeiWeapon ) )
        {
            
            
// Then we're clear!!
            
if ( OR_CriticalGrenadeAllowediAttacker ) )
            {
                static 
iMaxHealthiBonusDamage;
                
iMaxHealth get_user_maxhealthiVictim );
                
iBonusDamage floatroundfloatiDamage ) * p_grenade[iSkillLevel-1] );
                
                
// We don't want to do more damage than the user's maximum health
                
if ( iBonusDamage iDamage >= iMaxHealth )
                {
                    
iBonusDamage iMaxHealth - ( iDamage );
                }
                
                
// Damage the user!
                
WC3_DamageiVictimiAttackeriBonusDamageiWeaponiHitPlace );

                
// Make the user glow
                
SHARED_GlowiVictimiBonusDamage00);

                
// Lets make a screenfade
                
Create_ScreenFadeiVictim, (1<<10), (1<<10), (1<<12), 25500g_GlowLevel[iVictim][0] );
            }
        }
    }

Podarok is offline
piparins
New Member
Join Date: Nov 2010
Old 06-17-2011 , 05:07   Re: Team color sprite!
Reply With Quote #3

Maybe we can do it with get user team!!
piparins is offline
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 06-17-2011 , 05:41   Re: Team color sprite!
Reply With Quote #4

i dont think, that with get user team it would work better. Come anyone I posted the HELP.
Podarok is offline
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 06-19-2011 , 04:07   Re: Team color sprite!
Reply With Quote #5

One guy told me that the code is much more easier than is here, help pleaase.
Podarok 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 23:23.


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