Jump to content

Force Stun, Force Hate, Force Control Mind and Force Paralysis (SP)


Recommended Posts

Make sure you don't have scripts and cookies blocked etc.

 

well, i got some trouble with "not secure connection" issue when i go to firefox site to download the last version.

i have windows XPSP3 As Os, simply because i not like much the UI of windows 7 and in past i had 7 but i got troubles and i was formatted the computer. strangely, the last time i watched a repository into Git, some month ago, the site wors fine. i have installed ne w version of java and silverlight just now, but trouble is not fixed. i not use windows firewall, my antivirus is nod32.

Link to comment

mmm, interessing. for my code stuff i removed the restriction that avoid to saberist to be mindtricked, stunned or charmed. o.o

i discovered an important issue: for saberist the confusion power expire without trouble, but charming no. if a saberist switch to team_player it never return to team_enemy D: i pass the last days become crazy because charming code of FP_HATE never expired and now i discover that work only with no-saberist. with saberist the switching team never expired with the end of force power. o.o

Link to comment

@@ensiform LOL, i think now you will have a lot of fun. Why  i got troubles with git? but not only with git, also with many site that spread me error "unsure connection" or make me this kind of no template interface as you look in my screenshot XD. it was....

 

 

... the clock of my computer. O.O Yes. the date was to  november 26th . today is 11th XD Now git work and also other stuffs! XD soon i make a repository ROTFLMAO. XD

 

What can i say... Back to future. :sun:

Link to comment

firefox is a freeware D: why they should cut away the support for XP users? 10% of internet users use again XP.

 

mmm, i did with force stun, force hate, force fear, force controlmind, and also force wrack (it's like a merge between controlmind and hate, @ with this power is possible to control the foes and they turn to player team. XD so is possible to take down the NPC with one of their teammate. :) )

 

the unique power i need to end is the more difficult, the forze freeze. i have not much clear how to add a freeze function with the same power time duration.

@@Stoiss @@Serenity937 anyone can give me a little hint or help about force freeze? i put here the power code.

 

 

 
void ForceFreeze( gentity_t *self )
{
    trace_t    tr;
    vec3_t    end, forward;
    gentity_t    *traceEnt;
    qboolean    targetLive = qfalse;

    if ( self->health <= 0 )
    {
        return;
    }
    //FIXME: if Freeze 3 and aiming at an enemy need more force power
    if ( !WP_ForcePowerUsable( self, FP_FREEZE, 0 ) )
    {
        return;
    }

    if ( self->client->ps.weaponTime >= 800 )
    {//just did one!
        return;
    }
    if ( self->client->ps.saberLockTime > level.time )
    {//FIXME: can this be a way to break out?
        return;
    }

    AngleVectors( self->client->ps.viewangles, forward, NULL, NULL );
    VectorNormalize( forward );
    VectorMA( self->client->renderInfo.eyePoint, 2048, forward, end );
    
    //Cause a distraction if enemy is not fighting
    gi.trace( &tr, self->client->renderInfo.torsoPoint, vec3_origin, vec3_origin, end, self->s.number, MASK_OPAQUE|CONTENTS_BODY, (EG2_Collision)0, 0 );
    if ( tr.entityNum == ENTITYNUM_NONE || tr.fraction == 1.0 || tr.allsolid || tr.startsolid )
    {
        return;
    }
    
    traceEnt = &g_entities[tr.entityNum];
    
    if( traceEnt->NPC && traceEnt->NPC->scriptFlags & SCF_NO_FORCE )
    {
        return;
    }

    if ( traceEnt && traceEnt->client  )
    {
        switch ( traceEnt->client->NPC_class )
        {
        case CLASS_GALAKMECH:
        case CLASS_ATST:
        case CLASS_SAND_CREATURE:
        case CLASS_MOUSE:
        case CLASS_DESANN:
        case CLASS_JAN:
        case CLASS_LIZARD:
        case CLASS_MURJJ:
        case CLASS_FLIER2:
        case CLASS_GLIDER:
        case CLASS_FISH:
        case CLASS_CLAW:
        case CLASS_MORGANKATARN:
        case CLASS_REELO:
        case CLASS_KYLE:
        case CLASS_LUKE:
        case CLASS_SHADOWTROOPER:
        case CLASS_LANDO:
        case CLASS_GALAK:
        case CLASS_GONK:
        case CLASS_ROCKETTROOPER:
        //no droids either
        case CLASS_R2D2:
        case CLASS_R5D2:
        case CLASS_MARK2:
        case CLASS_MARK1:  
        case CLASS_SEEKER:
        case CLASS_SENTRY:
        case CLASS_REMOTE:
        case CLASS_PROTOCOL:
        case CLASS_ASSASSIN_DROID:
        case CLASS_SABER_DROID:
        case CLASS_WAMPA:
        case CLASS_BOBAFETT: // gli Elementali e i Demoni posson esser condizionati ma non boss class ed elementali supremi.  
            break;
        case CLASS_RANCOR:
            if ( !(traceEnt->spawnflags&1) )
            {
                targetLive = qtrue;
            }
            break;
        default:
            targetLive = qtrue;
            break;
        }
    }
    if ( targetLive
        && traceEnt->NPC
        && traceEnt->health > 0 )
    {//hit an organic non-player
        if ( G_ActivateBehavior( traceEnt, BSET_MINDTRICK ) )
        {//activated a script on him
            //FIXME: do the visual sparkles effect on their heads, still?
            WP_ForcePowerStart( self, FP_FREEZE, 0 );
        }
        else if ( traceEnt->client->playerTeam != self->client->playerTeam )
        {//an enemy of high level
            int override = 0;
            if ( (traceEnt->NPC->scriptFlags&SCF_NO_MIND_TRICK) )
            {// Anche se una classe non può esser condizionata, essa resterà comunque confusa dall'hate per un attimo.
                if ( traceEnt->client->NPC_class != CLASS_GONK )
                {
                    G_AddVoiceEvent( traceEnt, Q_irand( EV_CONFUSE1, EV_CONFUSE3 ), Q_irand( 3000, 5000 ) );
                }
            }
            else if ( self->client->ps.forcePowerLevel[FP_FREEZE] == FORCE_LEVEL_1
                    && traceEnt->s.weapon != WP_NONE        //don't charm people who aren't capable of fighting... like ugnaughts and droids, just confuse them
                    && !Pilot_AnyVehiclesRegistered()        //also, don't charm guys when bikes are near
                    )
            {//haha!  AT LEVEL 3 PUOI CONFONDER CHI IMPUGNA UNA SPADA!
                if ( /*traceEnt->s.weapon != WP_SABER
                && */traceEnt->client->NPC_class != CLASS_DESANN )
                {//turn them to our side
                    //if mind trick 3 and aiming at an enemy need more force power
                    override = 30;
                    if ( self->client->ps.forcePower < 30 )
                    {
                        return;
                    }
                    if ( traceEnt->enemy )
                    {
                        G_ClearEnemy( traceEnt );
                    }
                    if ( traceEnt->NPC )
                    {
                        traceEnt->NPC->tempBehavior = BS_CINEMATIC;
                        traceEnt->client->ps.pm_type = PM_FREEZE;
                    }
                    //FIXME: maybe pick an enemy right here?
                    //FIXME: does nothing to TEAM_FREE and TEAM_NEUTRALs!!!
                    //FIXME: need a *charmed* timer on this...?  Or do TEAM_PLAYERS assume that "confusion" means they should switch to team_enemy when done?
                    traceEnt->NPC->tempBehavior = BS_CINEMATIC;
                    traceEnt->client->ps.pm_type = PM_FREEZE;
                    traceEnt->NPC->charmedTime = level.time + FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]];
                    // traceEnt->NPC->charmedTime = level.time + FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]];
                    if ( traceEnt->ghoul2.size() && traceEnt->chestBolt != -1 )
                    {//FIXME: what if already playing effect?
                        G_PlayEffect( G_EffectIndex( "force/slowtime" ), traceEnt->playerModel, traceEnt->chestBolt, traceEnt->s.number, traceEnt->currentOrigin, FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]], qtrue );
                        G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/slowtime.mp3" );
                        NPC_PlayConfusionSound( traceEnt );
                    }
                }
            }
            else if ( self->client->ps.forcePowerLevel[FP_FREEZE] == FORCE_LEVEL_2
                    && traceEnt->s.weapon != WP_NONE        //don't charm people who aren't capable of fighting... like ugnaughts and droids, just confuse them
                    && !Pilot_AnyVehiclesRegistered()        //also, don't charm guys when bikes are near
                    )
            {//haha!  AT LEVEL 2 PUOI CONFONDER CHI IMPUGNA UNA SPADA!
                if ( traceEnt->s.weapon != WP_SABER
                && traceEnt->client->NPC_class != CLASS_DESANN )
                {//turn them to our side
                    //if mind trick 3 and aiming at an enemy need more force power
                    override = 60;
                    if ( self->client->ps.forcePower < 60 )
                    {
                        return;
                    }
                    if ( traceEnt->enemy )
                    {
                        G_ClearEnemy( traceEnt );
                    }
                    if ( traceEnt->NPC )
                    {
                        traceEnt->NPC->tempBehavior = BS_CINEMATIC;
                        traceEnt->client->ps.pm_type = PM_FREEZE;
                    }
                    //FIXME: maybe pick an enemy right here?
                    //FIXME: does nothing to TEAM_FREE and TEAM_NEUTRALs!!!
                    //FIXME: need a *charmed* timer on this...?  Or do TEAM_PLAYERS assume that "confusion" means they should switch to team_enemy when done?
                    traceEnt->NPC->tempBehavior = BS_CINEMATIC;
                    traceEnt->client->ps.pm_type = PM_FREEZE;
                    traceEnt->NPC->charmedTime = level.time + FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]];
                    if ( traceEnt->ghoul2.size() && traceEnt->chestBolt != -1 )
                    {//FIXME: what if already playing effect?
                        G_PlayEffect( G_EffectIndex( "force/incapacitate" ), traceEnt->playerModel, traceEnt->chestBolt, traceEnt->s.number, traceEnt->currentOrigin, FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]], qtrue );
                        G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/incapacitate.mp3" );
                        NPC_PlayConfusionSound( traceEnt );
                    }
                }
            }
            else if ( self->client->ps.forcePowerLevel[FP_FREEZE] == FORCE_LEVEL_3
                    && traceEnt->s.weapon != WP_NONE        //don't charm people who aren't capable of fighting... like ugnaughts and droids, just confuse them
                    && !Pilot_AnyVehiclesRegistered()        //also, don't charm guys when bikes are near
                    )
            {//haha!  AT LEVEL 3 PUOI CONFONDER CHI IMPUGNA UNA SPADA!
                if ( /*traceEnt->s.weapon != WP_SABER
                && */traceEnt->client->NPC_class != CLASS_DESANN )
                {//turn them to our side
                    //if mind trick 3 and aiming at an enemy need more force power
                    override = 80;
                    if ( self->client->ps.forcePower < 80 )
                    {
                        return;
                    }
                    if ( traceEnt->enemy )
                    {
                        G_ClearEnemy( traceEnt );
                    }
                    if ( traceEnt->NPC )
                    {
                        traceEnt->NPC->tempBehavior = BS_CINEMATIC;
                        traceEnt->client->ps.pm_type = PM_FREEZE;
                    }
                    //FIXME: maybe pick an enemy right here?
                    //FIXME: does nothing to TEAM_FREE and TEAM_NEUTRALs!!!
                    //FIXME: need a *charmed* timer on this...?  Or do TEAM_PLAYERS assume that "confusion" means they should switch to team_enemy when done?
                    // traceEnt->NPC->confusionTime = level.time + FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]];
                    traceEnt->NPC->tempBehavior = BS_CINEMATIC;
                    traceEnt->client->ps.pm_type = PM_FREEZE;
                    traceEnt->client->ps.saberMove = self->client->ps.saberBounceMove = LS_READY;//don't finish whatever saber anim you may have been in
                    traceEnt->client->ps.saberBlocked = BLOCKED_NONE;
                    traceEnt->NPC->charmedTime = level.time + FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]];
                    if ( traceEnt->ghoul2.size() && traceEnt->chestBolt != -1 )
                    {//FIXME: what if already playing effect?
                        G_PlayEffect( G_EffectIndex( "force/incapacitate" ), traceEnt->playerModel, traceEnt->chestBolt, traceEnt->s.number, traceEnt->currentOrigin, FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]], qtrue );
                        G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/incapacitate.mp3" );
                        NPC_PlayConfusionSound( traceEnt );
                    }
                }
            }
        }
        else if ( traceEnt->client->playerTeam == self->client->playerTeam )
        {//an ally can turned into an enemy! watch out!
            //maybe just have him look at you?  Respond?  Take your enemy?
            if ( traceEnt->client->ps.pm_type < PM_DEAD && traceEnt->NPC!=NULL && !(traceEnt->NPC->scriptFlags&SCF_NO_RESPONSE) )
            {
                NPC_UseResponse( traceEnt, self, qfalse );
                WP_ForcePowerStart( self, FP_FREEZE, 1 );
            }
        }//NOTE: no effect on TEAM_NEUTRAL?
        else
        {
                NPC_Jedi_PlayConfusionSound( traceEnt );
        }
        vec3_t    torsoDir;
        AngleVectors( traceEnt->client->renderInfo.torsoAngles, torsoDir, NULL, NULL );
        VectorNormalize( torsoDir );
        G_PlayEffect( "force/incapacitate_touch", traceEnt->client->renderInfo.torsoPoint, torsoDir );

        //make sure this plays and that you cannot press fire for about 1 second after this
        //FIXME: BOTH_FORCEMINDTRICK or BOTH_FORCEDISTRACT
        NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCEGRIP_HOLD, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_RESTART|SETANIM_FLAG_HOLD );
        //FIXME: build-up or delay this until in proper part of anim
    }
    else
    {
        if ( self->client->ps.forcePowerLevel[FP_FREEZE] > FORCE_LEVEL_0 && tr.fraction * 2048 > 64 )
        {//don't create a diversion less than 64 from you of if at power level 1
            //use distraction anim instead
            G_PlayEffect( G_EffectIndex( "force/incapacitate_touch" ), tr.endpos, tr.plane.normal );
            //FIXME: these events don't seem to always be picked up...?
            AddSoundEvent( self, tr.endpos, 512, AEL_DISCOVERED, qtrue, qtrue );
            AddSightEvent( self, tr.endpos, 512, AEL_DISCOVERED, 50 );
            WP_ForcePowerStart( self, FP_FREEZE, 0 );
        }
        NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCEGRIP_HOLD, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_RESTART|SETANIM_FLAG_HOLD );
    }
    self->client->ps.saberMove = self->client->ps.saberBounceMove = LS_READY;//don't finish whatever saber anim you may have been in
    self->client->ps.saberBlocked = BLOCKED_NONE;
    self->client->ps.weaponTime = 1000;
    if ( self->client->ps.forcePowersActive&(1<<FP_SPEED) )
    {
        self->client->ps.weaponTime = floor( self->client->ps.weaponTime * g_timescale->value );
    }
}

 

what i want from this power: 1: npc cannot move. 2: npc animation is stuck until power duration.

2: saber defense and parries are disabled until power duration :\

thanks for every answer. at moment  efx and sound and casting animation is perfect, but power not make any effect on NPCs.

Link to comment

firefox is a freeware D: why they should cut away the support for XP users? 10% of internet users use again XP.

 

mmm, i did with force stun, force hate, force fear, force controlmind, and also force wrack (it's like a merge between controlmind and hate, @ with this power is possible to control the foes and they turn to player team. XD so is possible to take down the NPC with one of their teammate. :) )

 

the unique power i need to end is the more difficult, the forze freeze. i have not much clear how to add a freeze function with the same power time duration.

@@Stoiss @@Serenity937 anyone can give me a little hint or help about force freeze? i put here the power code.

 
void ForceFreeze( gentity_t *self )
{
    trace_t    tr;
    vec3_t    end, forward;
    gentity_t    *traceEnt;
    qboolean    targetLive = qfalse;

    if ( self->health <= 0 )
    {
        return;
    }
    //FIXME: if Freeze 3 and aiming at an enemy need more force power
    if ( !WP_ForcePowerUsable( self, FP_FREEZE, 0 ) )
    {
        return;
    }

    if ( self->client->ps.weaponTime >= 800 )
    {//just did one!
        return;
    }
    if ( self->client->ps.saberLockTime > level.time )
    {//FIXME: can this be a way to break out?
        return;
    }

    AngleVectors( self->client->ps.viewangles, forward, NULL, NULL );
    VectorNormalize( forward );
    VectorMA( self->client->renderInfo.eyePoint, 2048, forward, end );
    
    //Cause a distraction if enemy is not fighting
    gi.trace( &tr, self->client->renderInfo.torsoPoint, vec3_origin, vec3_origin, end, self->s.number, MASK_OPAQUE|CONTENTS_BODY, (EG2_Collision)0, 0 );
    if ( tr.entityNum == ENTITYNUM_NONE || tr.fraction == 1.0 || tr.allsolid || tr.startsolid )
    {
        return;
    }
    
    traceEnt = &g_entities[tr.entityNum];
    
    if( traceEnt->NPC && traceEnt->NPC->scriptFlags & SCF_NO_FORCE )
    {
        return;
    }

    if ( traceEnt && traceEnt->client  )
    {
        switch ( traceEnt->client->NPC_class )
        {
        case CLASS_GALAKMECH:
        case CLASS_ATST:
        case CLASS_SAND_CREATURE:
        case CLASS_MOUSE:
        case CLASS_DESANN:
        case CLASS_JAN:
        case CLASS_LIZARD:
        case CLASS_MURJJ:
        case CLASS_FLIER2:
        case CLASS_GLIDER:
        case CLASS_FISH:
        case CLASS_CLAW:
        case CLASS_MORGANKATARN:
        case CLASS_REELO:
        case CLASS_KYLE:
        case CLASS_LUKE:
        case CLASS_SHADOWTROOPER:
        case CLASS_LANDO:
        case CLASS_GALAK:
        case CLASS_GONK:
        case CLASS_ROCKETTROOPER:
        //no droids either
        case CLASS_R2D2:
        case CLASS_R5D2:
        case CLASS_MARK2:
        case CLASS_MARK1:  
        case CLASS_SEEKER:
        case CLASS_SENTRY:
        case CLASS_REMOTE:
        case CLASS_PROTOCOL:
        case CLASS_ASSASSIN_DROID:
        case CLASS_SABER_DROID:
        case CLASS_WAMPA:
        case CLASS_BOBAFETT: // gli Elementali e i Demoni posson esser condizionati ma non boss class ed elementali supremi.  
            break;
        case CLASS_RANCOR:
            if ( !(traceEnt->spawnflags&1) )
            {
                targetLive = qtrue;
            }
            break;
        default:
            targetLive = qtrue;
            break;
        }
    }
    if ( targetLive
        && traceEnt->NPC
        && traceEnt->health > 0 )
    {//hit an organic non-player
        if ( G_ActivateBehavior( traceEnt, BSET_MINDTRICK ) )
        {//activated a script on him
            //FIXME: do the visual sparkles effect on their heads, still?
            WP_ForcePowerStart( self, FP_FREEZE, 0 );
        }
        else if ( traceEnt->client->playerTeam != self->client->playerTeam )
        {//an enemy of high level
            int override = 0;
            if ( (traceEnt->NPC->scriptFlags&SCF_NO_MIND_TRICK) )
            {// Anche se una classe non può esser condizionata, essa resterà comunque confusa dall'hate per un attimo.
                if ( traceEnt->client->NPC_class != CLASS_GONK )
                {
                    G_AddVoiceEvent( traceEnt, Q_irand( EV_CONFUSE1, EV_CONFUSE3 ), Q_irand( 3000, 5000 ) );
                }
            }
            else if ( self->client->ps.forcePowerLevel[FP_FREEZE] == FORCE_LEVEL_1
                    && traceEnt->s.weapon != WP_NONE        //don't charm people who aren't capable of fighting... like ugnaughts and droids, just confuse them
                    && !Pilot_AnyVehiclesRegistered()        //also, don't charm guys when bikes are near
                    )
            {//haha!  AT LEVEL 3 PUOI CONFONDER CHI IMPUGNA UNA SPADA!
                if ( /*traceEnt->s.weapon != WP_SABER
                && */traceEnt->client->NPC_class != CLASS_DESANN )
                {//turn them to our side
                    //if mind trick 3 and aiming at an enemy need more force power
                    override = 30;
                    if ( self->client->ps.forcePower < 30 )
                    {
                        return;
                    }
                    if ( traceEnt->enemy )
                    {
                        G_ClearEnemy( traceEnt );
                    }
                    if ( traceEnt->NPC )
                    {
                        traceEnt->NPC->tempBehavior = BS_CINEMATIC;
                        traceEnt->client->ps.pm_type = PM_FREEZE;
                    }
                    //FIXME: maybe pick an enemy right here?
                    //FIXME: does nothing to TEAM_FREE and TEAM_NEUTRALs!!!
                    //FIXME: need a *charmed* timer on this...?  Or do TEAM_PLAYERS assume that "confusion" means they should switch to team_enemy when done?
                    traceEnt->NPC->tempBehavior = BS_CINEMATIC;
                    traceEnt->client->ps.pm_type = PM_FREEZE;
                    traceEnt->NPC->charmedTime = level.time + FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]];
                    // traceEnt->NPC->charmedTime = level.time + FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]];
                    if ( traceEnt->ghoul2.size() && traceEnt->chestBolt != -1 )
                    {//FIXME: what if already playing effect?
                        G_PlayEffect( G_EffectIndex( "force/slowtime" ), traceEnt->playerModel, traceEnt->chestBolt, traceEnt->s.number, traceEnt->currentOrigin, FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]], qtrue );
                        G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/slowtime.mp3" );
                        NPC_PlayConfusionSound( traceEnt );
                    }
                }
            }
            else if ( self->client->ps.forcePowerLevel[FP_FREEZE] == FORCE_LEVEL_2
                    && traceEnt->s.weapon != WP_NONE        //don't charm people who aren't capable of fighting... like ugnaughts and droids, just confuse them
                    && !Pilot_AnyVehiclesRegistered()        //also, don't charm guys when bikes are near
                    )
            {//haha!  AT LEVEL 2 PUOI CONFONDER CHI IMPUGNA UNA SPADA!
                if ( traceEnt->s.weapon != WP_SABER
                && traceEnt->client->NPC_class != CLASS_DESANN )
                {//turn them to our side
                    //if mind trick 3 and aiming at an enemy need more force power
                    override = 60;
                    if ( self->client->ps.forcePower < 60 )
                    {
                        return;
                    }
                    if ( traceEnt->enemy )
                    {
                        G_ClearEnemy( traceEnt );
                    }
                    if ( traceEnt->NPC )
                    {
                        traceEnt->NPC->tempBehavior = BS_CINEMATIC;
                        traceEnt->client->ps.pm_type = PM_FREEZE;
                    }
                    //FIXME: maybe pick an enemy right here?
                    //FIXME: does nothing to TEAM_FREE and TEAM_NEUTRALs!!!
                    //FIXME: need a *charmed* timer on this...?  Or do TEAM_PLAYERS assume that "confusion" means they should switch to team_enemy when done?
                    traceEnt->NPC->tempBehavior = BS_CINEMATIC;
                    traceEnt->client->ps.pm_type = PM_FREEZE;
                    traceEnt->NPC->charmedTime = level.time + FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]];
                    if ( traceEnt->ghoul2.size() && traceEnt->chestBolt != -1 )
                    {//FIXME: what if already playing effect?
                        G_PlayEffect( G_EffectIndex( "force/incapacitate" ), traceEnt->playerModel, traceEnt->chestBolt, traceEnt->s.number, traceEnt->currentOrigin, FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]], qtrue );
                        G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/incapacitate.mp3" );
                        NPC_PlayConfusionSound( traceEnt );
                    }
                }
            }
            else if ( self->client->ps.forcePowerLevel[FP_FREEZE] == FORCE_LEVEL_3
                    && traceEnt->s.weapon != WP_NONE        //don't charm people who aren't capable of fighting... like ugnaughts and droids, just confuse them
                    && !Pilot_AnyVehiclesRegistered()        //also, don't charm guys when bikes are near
                    )
            {//haha!  AT LEVEL 3 PUOI CONFONDER CHI IMPUGNA UNA SPADA!
                if ( /*traceEnt->s.weapon != WP_SABER
                && */traceEnt->client->NPC_class != CLASS_DESANN )
                {//turn them to our side
                    //if mind trick 3 and aiming at an enemy need more force power
                    override = 80;
                    if ( self->client->ps.forcePower < 80 )
                    {
                        return;
                    }
                    if ( traceEnt->enemy )
                    {
                        G_ClearEnemy( traceEnt );
                    }
                    if ( traceEnt->NPC )
                    {
                        traceEnt->NPC->tempBehavior = BS_CINEMATIC;
                        traceEnt->client->ps.pm_type = PM_FREEZE;
                    }
                    //FIXME: maybe pick an enemy right here?
                    //FIXME: does nothing to TEAM_FREE and TEAM_NEUTRALs!!!
                    //FIXME: need a *charmed* timer on this...?  Or do TEAM_PLAYERS assume that "confusion" means they should switch to team_enemy when done?
                    // traceEnt->NPC->confusionTime = level.time + FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]];
                    traceEnt->NPC->tempBehavior = BS_CINEMATIC;
                    traceEnt->client->ps.pm_type = PM_FREEZE;
                    traceEnt->client->ps.saberMove = self->client->ps.saberBounceMove = LS_READY;//don't finish whatever saber anim you may have been in
                    traceEnt->client->ps.saberBlocked = BLOCKED_NONE;
                    traceEnt->NPC->charmedTime = level.time + FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]];
                    if ( traceEnt->ghoul2.size() && traceEnt->chestBolt != -1 )
                    {//FIXME: what if already playing effect?
                        G_PlayEffect( G_EffectIndex( "force/incapacitate" ), traceEnt->playerModel, traceEnt->chestBolt, traceEnt->s.number, traceEnt->currentOrigin, FreezeTime[self->client->ps.forcePowerLevel[FP_FREEZE]], qtrue );
                        G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/incapacitate.mp3" );
                        NPC_PlayConfusionSound( traceEnt );
                    }
                }
            }
        }
        else if ( traceEnt->client->playerTeam == self->client->playerTeam )
        {//an ally can turned into an enemy! watch out!
            //maybe just have him look at you?  Respond?  Take your enemy?
            if ( traceEnt->client->ps.pm_type < PM_DEAD && traceEnt->NPC!=NULL && !(traceEnt->NPC->scriptFlags&SCF_NO_RESPONSE) )
            {
                NPC_UseResponse( traceEnt, self, qfalse );
                WP_ForcePowerStart( self, FP_FREEZE, 1 );
            }
        }//NOTE: no effect on TEAM_NEUTRAL?
        else
        {
                NPC_Jedi_PlayConfusionSound( traceEnt );
        }
        vec3_t    torsoDir;
        AngleVectors( traceEnt->client->renderInfo.torsoAngles, torsoDir, NULL, NULL );
        VectorNormalize( torsoDir );
        G_PlayEffect( "force/incapacitate_touch", traceEnt->client->renderInfo.torsoPoint, torsoDir );

        //make sure this plays and that you cannot press fire for about 1 second after this
        //FIXME: BOTH_FORCEMINDTRICK or BOTH_FORCEDISTRACT
        NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCEGRIP_HOLD, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_RESTART|SETANIM_FLAG_HOLD );
        //FIXME: build-up or delay this until in proper part of anim
    }
    else
    {
        if ( self->client->ps.forcePowerLevel[FP_FREEZE] > FORCE_LEVEL_0 && tr.fraction * 2048 > 64 )
        {//don't create a diversion less than 64 from you of if at power level 1
            //use distraction anim instead
            G_PlayEffect( G_EffectIndex( "force/incapacitate_touch" ), tr.endpos, tr.plane.normal );
            //FIXME: these events don't seem to always be picked up...?
            AddSoundEvent( self, tr.endpos, 512, AEL_DISCOVERED, qtrue, qtrue );
            AddSightEvent( self, tr.endpos, 512, AEL_DISCOVERED, 50 );
            WP_ForcePowerStart( self, FP_FREEZE, 0 );
        }
        NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCEGRIP_HOLD, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_RESTART|SETANIM_FLAG_HOLD );
    }
    self->client->ps.saberMove = self->client->ps.saberBounceMove = LS_READY;//don't finish whatever saber anim you may have been in
    self->client->ps.saberBlocked = BLOCKED_NONE;
    self->client->ps.weaponTime = 1000;
    if ( self->client->ps.forcePowersActive&(1<<FP_SPEED) )
    {
        self->client->ps.weaponTime = floor( self->client->ps.weaponTime * g_timescale->value );
    }
}

what i want from this power: 1: npc cannot move. 2: npc animation is stuck until power duration.

2: saber defense and parries are disabled until power duration :\

thanks for every answer. at moment  efx and sound and casting animation is perfect, but power not make any effect on NPCs.

 

 

I don't want to control the target. I just want to be able to put my crosshair over the target, use the force power and his playerteam changes without controlling him. Then instead of attacking me, he will start attacking his allies.

Link to comment

Well you're right ensi.

i not agree much this mentality because is the programmed obsolescence. people is ever forced to use the last version of program of operating system. it's not much correct because peoples cannot choice. if someone is fine with an OS, why cannot continue to use it?

That's is just my opinion, however.

However, someone can give me an hint about freezing? :\ i am little stuck on that.

i found code of pm_freeze, npc_freeze, d_npcfreeze command, and BS_cinematic, but they i haven't found nothing that working for moment. 

 

@ you are lucky, this is exactly what do my force hate power . i share with you the code.

act just like mindtrick level 3. you poin an enemy with crosshair with power selected and press f. i added also a visual efx with a burning red cloud inside the face of enemy.

the funniest thing of this power is that this can switch team every time you cast it. so you can also turn allied in an enemy... and turn again into an ally XD. testing this power give me a lot of hilarous laught. 

void ForceHate( gentity_t *self )
{
    trace_t    tr;
    vec3_t    end, forward;
    gentity_t    *traceEnt;
    qboolean    targetLive = qfalse;

    /*if ( WP_BreakHateTime( self ) )
    {
        return;
    }*/
    
    if ( self->health <= 0 )
    {
        return;
    }
    //FIXME: if Hate 3 and aiming at an enemy need more force power
    if ( !WP_ForcePowerUsable( self, FP_HATE, 0 ) )
    {
        return;
    }

    if ( self->client->ps.weaponTime >= 800 )
    {//just did one!
        return;
    }
    if ( self->client->ps.saberLockTime > level.time )
    {//FIXME: can this be a way to break out?
        return;
    }

    AngleVectors( self->client->ps.viewangles, forward, NULL, NULL );
    VectorNormalize( forward );
    VectorMA( self->client->renderInfo.eyePoint, 2048, forward, end );
    
    //Cause a distraction if enemy is not fighting
    gi.trace( &tr, self->client->renderInfo.eyePoint, vec3_origin, vec3_origin, end, self->s.number, MASK_OPAQUE|CONTENTS_BODY, (EG2_Collision)0, 0 );
    if ( tr.entityNum == ENTITYNUM_NONE || tr.fraction == 1.0 || tr.allsolid || tr.startsolid )
    {
        return;
    }
    
    traceEnt = &g_entities[tr.entityNum];
    
    if( traceEnt->NPC && traceEnt->NPC->scriptFlags & SCF_NO_FORCE )
    {
        return;
    }

    if ( traceEnt && traceEnt->client  )
    {
        switch ( traceEnt->client->NPC_class )
        {
        case CLASS_GALAKMECH:
        case CLASS_ATST:
        case CLASS_SAND_CREATURE:
        case CLASS_DESANN:
        case CLASS_JAN:
        case CLASS_MOUSE:
        case CLASS_LIZARD:
        case CLASS_MURJJ:
        case CLASS_FLIER2:
        case CLASS_GLIDER:
        case CLASS_FISH:
        case CLASS_CLAW:
        case CLASS_MORGANKATARN:
        case CLASS_REELO:
        case CLASS_KYLE:
        case CLASS_LUKE:
        case CLASS_SHADOWTROOPER:
        case CLASS_LANDO:
        case CLASS_GALAK:
        case CLASS_ROCKETTROOPER:
        //no droids either
        case CLASS_R2D2:
        case CLASS_R5D2:
        case CLASS_MARK2:
        case CLASS_MARK1:  
        case CLASS_SEEKER:
        case CLASS_SENTRY:
        case CLASS_REMOTE:
        case CLASS_PROTOCOL:
        case CLASS_ASSASSIN_DROID:
        case CLASS_SABER_DROID:
        case CLASS_WAMPA:
        case CLASS_BOBAFETT: // gli Elementali e i Demoni posson esser condizionati ma non boss class ed elementali supremi.  
            break;
        case CLASS_RANCOR:
            if ( !(traceEnt->spawnflags&1) )
            {
                targetLive = qtrue;
            }
            break;
        default:
            targetLive = qtrue;
            break;
        }
    }
    if ( targetLive
        && traceEnt->NPC
        && traceEnt->health > 0 )
    {//hit an organic non-player
        if ( G_ActivateBehavior( traceEnt, BSET_MINDTRICK ) )
        {//activated a script on him
            //FIXME: do the visual sparkles effect on their heads, still?
            WP_ForcePowerStart( self, FP_HATE, 0 );
        }
        else if ( traceEnt->client->playerTeam != self->client->playerTeam )
        {//an enemy of high level
            int override = 0;
            if ( (traceEnt->NPC->scriptFlags&SCF_NO_MIND_TRICK) )
            {// Anche se una classe non può esser condizionata, essa resterà comunque confusa dall'hate per un attimo.
                if ( traceEnt->client->NPC_class == CLASS_GALAK ||
                    traceEnt->client->NPC_class == CLASS_DESANN ||
                    traceEnt->client->NPC_class == CLASS_LIZARD ||
                    traceEnt->client->NPC_class == CLASS_CLAW ||
                    traceEnt->client->NPC_class == CLASS_MURJJ ||
                    traceEnt->client->NPC_class == CLASS_GLIDER ||
                    traceEnt->client->NPC_class == CLASS_FLIER2 ||
                    traceEnt->client->NPC_class == CLASS_FISH ||
                    traceEnt->client->NPC_class == CLASS_KYLE ||
                    traceEnt->client->NPC_class == CLASS_LUKE ||
                    traceEnt->client->NPC_class == CLASS_ROCKETTROOPER ||
                    traceEnt->client->NPC_class == CLASS_SHADOWTROOPER ||
                    traceEnt->client->NPC_class == CLASS_MORGANKATARN ||
                    traceEnt->client->NPC_class == CLASS_GALAKMECH ||
                    traceEnt->client->NPC_class == CLASS_LANDO ||
                    traceEnt->client->NPC_class == CLASS_WAMPA
                    )
                {
                    G_AddVoiceEvent( traceEnt, Q_irand( EV_CONFUSE1, EV_CONFUSE3 ), Q_irand( 3000, 5000 ) );
                }
            }
            else if ( self->client->ps.forcePowerLevel[FP_HATE] == FORCE_LEVEL_3
                    && traceEnt->s.weapon != WP_NONE        //don't charm people who aren't capable of fighting... like ugnaughts and droids, just confuse them
                    && !Pilot_AnyVehiclesRegistered()        //also, don't charm guys when bikes are near
                    )
            {//haha!  AT LEVEL 3 PUOI CONFONDER CHI IMPUGNA UNA SPADA!
                if ( /*traceEnt->s.weapon != WP_SABER
                && */traceEnt->client->NPC_class != CLASS_DESANN )
                {//turn them to our side
                    //if mind trick 3 and aiming at an enemy need more force power
                    override = 90;
                    if ( self->client->ps.forcePower < 90 )
                    {
                        return;
                    }
                    if ( traceEnt->enemy )
                    {
                        G_ClearEnemy( traceEnt );
                    }
                    if ( traceEnt->NPC )
                    {
                        traceEnt->NPC->tempBehavior = BS_HUNT_AND_KILL;
                    }
                    //FIXME: maybe pick an enemy right here?
                    //FIXME: does nothing to TEAM_FREE and TEAM_NEUTRALs!!!
                    team_t    saveTeam = traceEnt->client->enemyTeam;
                    traceEnt->client->enemyTeam = traceEnt->client->playerTeam;
                    traceEnt->client->playerTeam = saveTeam;
                    //FIXME: need a *charmed* timer on this...?  Or do TEAM_PLAYERS assume that "confusion" means they should switch to team_enemy when done?
                    traceEnt->NPC->charmedTime = level.time + HateTime[self->client->ps.forcePowerLevel[FP_HATE]];
                    if ( traceEnt->ghoul2.size() && traceEnt->headBolt != -1 )
                    {//FIXME: what if already playing effect?
                        G_PlayEffect( G_EffectIndex( "force/hate" ), traceEnt->playerModel, traceEnt->headBolt, traceEnt->s.number, traceEnt->currentOrigin, HateTime[self->client->ps.forcePowerLevel[FP_HATE]], qtrue );
                        G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/hate.mp3" );
                    }
                }
            }
            else if ( self->client->ps.forcePowerLevel[FP_HATE] == FORCE_LEVEL_2
                    && traceEnt->s.weapon != WP_NONE        //don't charm people who aren't capable of fighting... like ugnaughts and droids, just confuse them
                    && !Pilot_AnyVehiclesRegistered()        //also, don't charm guys when bikes are near
                    )
            {//haha!  AT LEVEL 2 PUOI CONFONDER CHI IMPUGNA UNA SPADA!
                if ( traceEnt->s.weapon != WP_SABER
                && traceEnt->client->NPC_class != CLASS_DESANN )
                {//turn them to our side
                    //if mind trick 3 and aiming at an enemy need more force power
                    override = 50;
                    if ( self->client->ps.forcePower < 50 )
                    {
                        return;
                    }
                    if ( traceEnt->enemy )
                    {
                        G_ClearEnemy( traceEnt );
                    }
                    if ( traceEnt->NPC )
                    {
                        traceEnt->NPC->tempBehavior = BS_HUNT_AND_KILL;
                    }
                    //FIXME: maybe pick an enemy right here?
                    //FIXME: does nothing to TEAM_FREE and TEAM_NEUTRALs!!!
                    team_t    saveTeam = traceEnt->client->enemyTeam;
                    traceEnt->client->enemyTeam = traceEnt->client->playerTeam;
                    traceEnt->client->playerTeam = saveTeam;
                    //FIXME: need a *charmed* timer on this...?  Or do TEAM_PLAYERS assume that "confusion" means they should switch to team_enemy when done?
                    traceEnt->NPC->charmedTime = level.time + HateTime[self->client->ps.forcePowerLevel[FP_HATE]];
                    if ( traceEnt->ghoul2.size() && traceEnt->headBolt != -1 )
                    {//FIXME: what if already playing effect?
                        G_PlayEffect( G_EffectIndex( "force/hate" ), traceEnt->playerModel, traceEnt->headBolt, traceEnt->s.number, traceEnt->currentOrigin, HateTime[self->client->ps.forcePowerLevel[FP_HATE]], qtrue );
                        G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/hate.mp3" );
                    }
                }
            }
            else if ( self->client->ps.forcePowerLevel[FP_HATE] == FORCE_LEVEL_1
                    && traceEnt->s.weapon != WP_NONE        //don't charm people who aren't capable of fighting... like ugnaughts and droids, just confuse them
                    && !Pilot_AnyVehiclesRegistered()        //also, don't charm guys when bikes are near
                    )
            {//haha!  AT LEVEL 3 PUOI CONFONDER CHI IMPUGNA UNA SPADA!
                if ( traceEnt->s.weapon != WP_SABER
                && traceEnt->client->NPC_class != CLASS_DESANN )
                {//turn them to our side
                    //if mind trick 3 and aiming at an enemy need more force power
                    override = 30;
                    if ( self->client->ps.forcePower < 30 )
                    {
                        return;
                    }
                    if ( traceEnt->enemy )
                    {
                        G_ClearEnemy( traceEnt );
                    }
                    if ( traceEnt->NPC )
                    {
                        traceEnt->NPC->tempBehavior = BS_HUNT_AND_KILL;
                    }
                    //FIXME: maybe pick an enemy right here?
                    //FIXME: does nothing to TEAM_FREE and TEAM_NEUTRALs!!!
                    team_t    saveTeam = traceEnt->client->enemyTeam;
                    traceEnt->client->enemyTeam = traceEnt->client->playerTeam;
                    traceEnt->client->playerTeam = saveTeam;
                    //FIXME: need a *charmed* timer on this...?  Or do TEAM_PLAYERS assume that "confusion" means they should switch to team_enemy when done?
                    traceEnt->NPC->charmedTime = level.time + HateTime[self->client->ps.forcePowerLevel[FP_HATE]];
                    if ( traceEnt->ghoul2.size() && traceEnt->headBolt != -1 )
                    {//FIXME: what if already playing effect?
                        G_PlayEffect( G_EffectIndex( "force/hate" ), traceEnt->playerModel, traceEnt->headBolt, traceEnt->s.number, traceEnt->currentOrigin, HateTime[self->client->ps.forcePowerLevel[FP_HATE]], qtrue );
                        G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/hate.mp3" );
                    }
                }
            }
        }
        else if ( traceEnt->client->playerTeam == self->client->playerTeam )
        {//an ally can turned into an enemy! watch out!
            if ( self->client->ps.forcePower < 50 )
                    {
                        return;
                    }
                    if ( traceEnt->enemy )
                    {
                        G_ClearEnemy( traceEnt );
                    }
                    if ( traceEnt->NPC )
                    {
                        traceEnt->NPC->tempBehavior = BS_HUNT_AND_KILL;
                    }
                    //FIXME: maybe pick an enemy right here?
                    //FIXME: does nothing to TEAM_FREE and TEAM_NEUTRALs!!!
                    team_t    saveTeam = traceEnt->client->playerTeam;
                    traceEnt->client->playerTeam = traceEnt->client->enemyTeam;
                    traceEnt->client->enemyTeam = saveTeam;
                    //FIXME: need a *charmed* timer on this...?  Or do TEAM_PLAYERS assume that "confusion" means they should switch to team_enemy when done?
                    traceEnt->NPC->charmedTime = level.time + HateTime[self->client->ps.forcePowerLevel[FP_HATE]];
                    if ( traceEnt->ghoul2.size() && traceEnt->headBolt != -1 )
                    {//FIXME: what if already playing effect?
                        G_PlayEffect( G_EffectIndex( "force/hate" ), traceEnt->playerModel, traceEnt->headBolt, traceEnt->s.number, traceEnt->currentOrigin, HateTime[self->client->ps.forcePowerLevel[FP_HATE]], qtrue );
                        G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/hate.mp3" );
                    }
            //maybe just have him look at you?  Respond?  Take your enemy?
            if ( traceEnt->client->ps.pm_type < PM_DEAD && traceEnt->NPC!=NULL && !(traceEnt->NPC->scriptFlags&SCF_NO_RESPONSE) )
            {
                NPC_UseResponse( traceEnt, self, qfalse );
                WP_ForcePowerStart( self, FP_HATE, 1 );
            }
        }//NOTE: no effect on TEAM_NEUTRAL?
        else
        {
                NPC_Jedi_PlayConfusionSound( traceEnt );
        }
        vec3_t    eyeDir;
        AngleVectors( traceEnt->client->renderInfo.eyeAngles, eyeDir, NULL, NULL );
        VectorNormalize( eyeDir );
        G_PlayEffect( "force/force_hatetouch", traceEnt->client->renderInfo.eyePoint, eyeDir );

        //make sure this plays and that you cannot press fire for about 1 second after this
        //FIXME: BOTH_FORCEMINDTRICK or BOTH_FORCEDISTRACT
        NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCEHEAL_QUICK, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_RESTART|SETANIM_FLAG_HOLD );
        //FIXME: build-up or delay this until in proper part of anim
    }
    else
    {
        if ( self->client->ps.forcePowerLevel[FP_HATE] > FORCE_LEVEL_1 && tr.fraction * 2048 > 64 )
        {//don't create a diversion less than 64 from you of if at power level 1
            //use distraction anim instead
            G_PlayEffect( G_EffectIndex( "force/force_hatetouch" ), tr.endpos, tr.plane.normal );
            //FIXME: these events don't seem to always be picked up...?
            AddSoundEvent( self, tr.endpos, 512, AEL_DISCOVERED, qtrue, qtrue );
            AddSightEvent( self, tr.endpos, 512, AEL_DISCOVERED, 50 );
            WP_ForcePowerStart( self, FP_HATE, 0 );
        }
        NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCEHEAL_QUICK, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_RESTART|SETANIM_FLAG_HOLD );
    }
    self->client->ps.saberMove = self->client->ps.saberBounceMove = LS_READY;//don't finish whatever saber anim you may have been in
    self->client->ps.saberBlocked = BLOCKED_NONE;
    self->client->ps.weaponTime = 1000;
    if ( self->client->ps.forcePowersActive&(1<<FP_SPEED) )
    {
        self->client->ps.weaponTime = floor( self->client->ps.weaponTime * g_timescale->value );
    }
}

follow my tutorial about adding a new FP into SP and add this void under void_forcetelepathy into wp_saber.cpp

And you can make a foolish free for all battle also in single player game.

for allow to you to charm all classes with hate, simply remove the classes i added into the first switch case. they resist to fhe hate power because i use as bosses.

Note: at level 1 of hate you can charm only shooters. with level 2-3 you can charm also saberist.

an important note: because charm code is done for affected only Shooters (default mindtrick level 3 cannot used for dark jedi)

the saberist charmed will never return to enemy time also when power effect is up. but you can simply charm again and they will become again foes. if you charm a third time, they become allied. and so on. LOL. is a cycle.

so, if you are lazy of some teammate you can turn it into an enemy and take down without get the mission failing status :)

 

Maybe you will charm rosh? D: XD

Daedra likes this
Link to comment

Well you're right ensi.

i not agree much this mentality because is the programmed obsolescence. people is ever forced to use the last version of program of operating system. it's not much correct because peoples cannot choice. if someone is fine with an OS, why cannot continue to use it?

That's is just my opinion, however.

However, someone can give me an hint about freezing? :\ i am little stuck on that.

i found code of pm_freeze, npc_freeze, d_npcfreeze command, and BS_cinematic, but they i haven't found nothing that working for moment. 

 

@ you are lucky, this is exactly what do my force hate power . i share with you the code.

act just like mindtrick level 3. you poin an enemy with crosshair with power selected and press f. i added also a visual efx with a burning red cloud inside the face of enemy.

the funniest thing of this power is that this can switch team every time you cast it. so you can also turn allied in an enemy... and turn again into an ally XD. testing this power give me a lot of hilarous laught. 

void ForceHate( gentity_t *self )
{
    trace_t    tr;
    vec3_t    end, forward;
    gentity_t    *traceEnt;
    qboolean    targetLive = qfalse;

    /*if ( WP_BreakHateTime( self ) )
    {
        return;
    }*/
    
    if ( self->health <= 0 )
    {
        return;
    }
    //FIXME: if Hate 3 and aiming at an enemy need more force power
    if ( !WP_ForcePowerUsable( self, FP_HATE, 0 ) )
    {
        return;
    }

    if ( self->client->ps.weaponTime >= 800 )
    {//just did one!
        return;
    }
    if ( self->client->ps.saberLockTime > level.time )
    {//FIXME: can this be a way to break out?
        return;
    }

    AngleVectors( self->client->ps.viewangles, forward, NULL, NULL );
    VectorNormalize( forward );
    VectorMA( self->client->renderInfo.eyePoint, 2048, forward, end );
    
    //Cause a distraction if enemy is not fighting
    gi.trace( &tr, self->client->renderInfo.eyePoint, vec3_origin, vec3_origin, end, self->s.number, MASK_OPAQUE|CONTENTS_BODY, (EG2_Collision)0, 0 );
    if ( tr.entityNum == ENTITYNUM_NONE || tr.fraction == 1.0 || tr.allsolid || tr.startsolid )
    {
        return;
    }
    
    traceEnt = &g_entities[tr.entityNum];
    
    if( traceEnt->NPC && traceEnt->NPC->scriptFlags & SCF_NO_FORCE )
    {
        return;
    }

    if ( traceEnt && traceEnt->client  )
    {
        switch ( traceEnt->client->NPC_class )
        {
        case CLASS_GALAKMECH:
        case CLASS_ATST:
        case CLASS_SAND_CREATURE:
        case CLASS_DESANN:
        case CLASS_JAN:
        case CLASS_MOUSE:
        case CLASS_LIZARD:
        case CLASS_MURJJ:
        case CLASS_FLIER2:
        case CLASS_GLIDER:
        case CLASS_FISH:
        case CLASS_CLAW:
        case CLASS_MORGANKATARN:
        case CLASS_REELO:
        case CLASS_KYLE:
        case CLASS_LUKE:
        case CLASS_SHADOWTROOPER:
        case CLASS_LANDO:
        case CLASS_GALAK:
        case CLASS_ROCKETTROOPER:
        //no droids either
        case CLASS_R2D2:
        case CLASS_R5D2:
        case CLASS_MARK2:
        case CLASS_MARK1:  
        case CLASS_SEEKER:
        case CLASS_SENTRY:
        case CLASS_REMOTE:
        case CLASS_PROTOCOL:
        case CLASS_ASSASSIN_DROID:
        case CLASS_SABER_DROID:
        case CLASS_WAMPA:
        case CLASS_BOBAFETT: // gli Elementali e i Demoni posson esser condizionati ma non boss class ed elementali supremi.  
            break;
        case CLASS_RANCOR:
            if ( !(traceEnt->spawnflags&1) )
            {
                targetLive = qtrue;
            }
            break;
        default:
            targetLive = qtrue;
            break;
        }
    }
    if ( targetLive
        && traceEnt->NPC
        && traceEnt->health > 0 )
    {//hit an organic non-player
        if ( G_ActivateBehavior( traceEnt, BSET_MINDTRICK ) )
        {//activated a script on him
            //FIXME: do the visual sparkles effect on their heads, still?
            WP_ForcePowerStart( self, FP_HATE, 0 );
        }
        else if ( traceEnt->client->playerTeam != self->client->playerTeam )
        {//an enemy of high level
            int override = 0;
            if ( (traceEnt->NPC->scriptFlags&SCF_NO_MIND_TRICK) )
            {// Anche se una classe non può esser condizionata, essa resterà comunque confusa dall'hate per un attimo.
                if ( traceEnt->client->NPC_class == CLASS_GALAK ||
                    traceEnt->client->NPC_class == CLASS_DESANN ||
                    traceEnt->client->NPC_class == CLASS_LIZARD ||
                    traceEnt->client->NPC_class == CLASS_CLAW ||
                    traceEnt->client->NPC_class == CLASS_MURJJ ||
                    traceEnt->client->NPC_class == CLASS_GLIDER ||
                    traceEnt->client->NPC_class == CLASS_FLIER2 ||
                    traceEnt->client->NPC_class == CLASS_FISH ||
                    traceEnt->client->NPC_class == CLASS_KYLE ||
                    traceEnt->client->NPC_class == CLASS_LUKE ||
                    traceEnt->client->NPC_class == CLASS_ROCKETTROOPER ||
                    traceEnt->client->NPC_class == CLASS_SHADOWTROOPER ||
                    traceEnt->client->NPC_class == CLASS_MORGANKATARN ||
                    traceEnt->client->NPC_class == CLASS_GALAKMECH ||
                    traceEnt->client->NPC_class == CLASS_LANDO ||
                    traceEnt->client->NPC_class == CLASS_WAMPA
                    )
                {
                    G_AddVoiceEvent( traceEnt, Q_irand( EV_CONFUSE1, EV_CONFUSE3 ), Q_irand( 3000, 5000 ) );
                }
            }
            else if ( self->client->ps.forcePowerLevel[FP_HATE] == FORCE_LEVEL_3
                    && traceEnt->s.weapon != WP_NONE        //don't charm people who aren't capable of fighting... like ugnaughts and droids, just confuse them
                    && !Pilot_AnyVehiclesRegistered()        //also, don't charm guys when bikes are near
                    )
            {//haha!  AT LEVEL 3 PUOI CONFONDER CHI IMPUGNA UNA SPADA!
                if ( /*traceEnt->s.weapon != WP_SABER
                && */traceEnt->client->NPC_class != CLASS_DESANN )
                {//turn them to our side
                    //if mind trick 3 and aiming at an enemy need more force power
                    override = 90;
                    if ( self->client->ps.forcePower < 90 )
                    {
                        return;
                    }
                    if ( traceEnt->enemy )
                    {
                        G_ClearEnemy( traceEnt );
                    }
                    if ( traceEnt->NPC )
                    {
                        traceEnt->NPC->tempBehavior = BS_HUNT_AND_KILL;
                    }
                    //FIXME: maybe pick an enemy right here?
                    //FIXME: does nothing to TEAM_FREE and TEAM_NEUTRALs!!!
                    team_t    saveTeam = traceEnt->client->enemyTeam;
                    traceEnt->client->enemyTeam = traceEnt->client->playerTeam;
                    traceEnt->client->playerTeam = saveTeam;
                    //FIXME: need a *charmed* timer on this...?  Or do TEAM_PLAYERS assume that "confusion" means they should switch to team_enemy when done?
                    traceEnt->NPC->charmedTime = level.time + HateTime[self->client->ps.forcePowerLevel[FP_HATE]];
                    if ( traceEnt->ghoul2.size() && traceEnt->headBolt != -1 )
                    {//FIXME: what if already playing effect?
                        G_PlayEffect( G_EffectIndex( "force/hate" ), traceEnt->playerModel, traceEnt->headBolt, traceEnt->s.number, traceEnt->currentOrigin, HateTime[self->client->ps.forcePowerLevel[FP_HATE]], qtrue );
                        G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/hate.mp3" );
                    }
                }
            }
            else if ( self->client->ps.forcePowerLevel[FP_HATE] == FORCE_LEVEL_2
                    && traceEnt->s.weapon != WP_NONE        //don't charm people who aren't capable of fighting... like ugnaughts and droids, just confuse them
                    && !Pilot_AnyVehiclesRegistered()        //also, don't charm guys when bikes are near
                    )
            {//haha!  AT LEVEL 2 PUOI CONFONDER CHI IMPUGNA UNA SPADA!
                if ( traceEnt->s.weapon != WP_SABER
                && traceEnt->client->NPC_class != CLASS_DESANN )
                {//turn them to our side
                    //if mind trick 3 and aiming at an enemy need more force power
                    override = 50;
                    if ( self->client->ps.forcePower < 50 )
                    {
                        return;
                    }
                    if ( traceEnt->enemy )
                    {
                        G_ClearEnemy( traceEnt );
                    }
                    if ( traceEnt->NPC )
                    {
                        traceEnt->NPC->tempBehavior = BS_HUNT_AND_KILL;
                    }
                    //FIXME: maybe pick an enemy right here?
                    //FIXME: does nothing to TEAM_FREE and TEAM_NEUTRALs!!!
                    team_t    saveTeam = traceEnt->client->enemyTeam;
                    traceEnt->client->enemyTeam = traceEnt->client->playerTeam;
                    traceEnt->client->playerTeam = saveTeam;
                    //FIXME: need a *charmed* timer on this...?  Or do TEAM_PLAYERS assume that "confusion" means they should switch to team_enemy when done?
                    traceEnt->NPC->charmedTime = level.time + HateTime[self->client->ps.forcePowerLevel[FP_HATE]];
                    if ( traceEnt->ghoul2.size() && traceEnt->headBolt != -1 )
                    {//FIXME: what if already playing effect?
                        G_PlayEffect( G_EffectIndex( "force/hate" ), traceEnt->playerModel, traceEnt->headBolt, traceEnt->s.number, traceEnt->currentOrigin, HateTime[self->client->ps.forcePowerLevel[FP_HATE]], qtrue );
                        G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/hate.mp3" );
                    }
                }
            }
            else if ( self->client->ps.forcePowerLevel[FP_HATE] == FORCE_LEVEL_1
                    && traceEnt->s.weapon != WP_NONE        //don't charm people who aren't capable of fighting... like ugnaughts and droids, just confuse them
                    && !Pilot_AnyVehiclesRegistered()        //also, don't charm guys when bikes are near
                    )
            {//haha!  AT LEVEL 3 PUOI CONFONDER CHI IMPUGNA UNA SPADA!
                if ( traceEnt->s.weapon != WP_SABER
                && traceEnt->client->NPC_class != CLASS_DESANN )
                {//turn them to our side
                    //if mind trick 3 and aiming at an enemy need more force power
                    override = 30;
                    if ( self->client->ps.forcePower < 30 )
                    {
                        return;
                    }
                    if ( traceEnt->enemy )
                    {
                        G_ClearEnemy( traceEnt );
                    }
                    if ( traceEnt->NPC )
                    {
                        traceEnt->NPC->tempBehavior = BS_HUNT_AND_KILL;
                    }
                    //FIXME: maybe pick an enemy right here?
                    //FIXME: does nothing to TEAM_FREE and TEAM_NEUTRALs!!!
                    team_t    saveTeam = traceEnt->client->enemyTeam;
                    traceEnt->client->enemyTeam = traceEnt->client->playerTeam;
                    traceEnt->client->playerTeam = saveTeam;
                    //FIXME: need a *charmed* timer on this...?  Or do TEAM_PLAYERS assume that "confusion" means they should switch to team_enemy when done?
                    traceEnt->NPC->charmedTime = level.time + HateTime[self->client->ps.forcePowerLevel[FP_HATE]];
                    if ( traceEnt->ghoul2.size() && traceEnt->headBolt != -1 )
                    {//FIXME: what if already playing effect?
                        G_PlayEffect( G_EffectIndex( "force/hate" ), traceEnt->playerModel, traceEnt->headBolt, traceEnt->s.number, traceEnt->currentOrigin, HateTime[self->client->ps.forcePowerLevel[FP_HATE]], qtrue );
                        G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/hate.mp3" );
                    }
                }
            }
        }
        else if ( traceEnt->client->playerTeam == self->client->playerTeam )
        {//an ally can turned into an enemy! watch out!
            if ( self->client->ps.forcePower < 50 )
                    {
                        return;
                    }
                    if ( traceEnt->enemy )
                    {
                        G_ClearEnemy( traceEnt );
                    }
                    if ( traceEnt->NPC )
                    {
                        traceEnt->NPC->tempBehavior = BS_HUNT_AND_KILL;
                    }
                    //FIXME: maybe pick an enemy right here?
                    //FIXME: does nothing to TEAM_FREE and TEAM_NEUTRALs!!!
                    team_t    saveTeam = traceEnt->client->playerTeam;
                    traceEnt->client->playerTeam = traceEnt->client->enemyTeam;
                    traceEnt->client->enemyTeam = saveTeam;
                    //FIXME: need a *charmed* timer on this...?  Or do TEAM_PLAYERS assume that "confusion" means they should switch to team_enemy when done?
                    traceEnt->NPC->charmedTime = level.time + HateTime[self->client->ps.forcePowerLevel[FP_HATE]];
                    if ( traceEnt->ghoul2.size() && traceEnt->headBolt != -1 )
                    {//FIXME: what if already playing effect?
                        G_PlayEffect( G_EffectIndex( "force/hate" ), traceEnt->playerModel, traceEnt->headBolt, traceEnt->s.number, traceEnt->currentOrigin, HateTime[self->client->ps.forcePowerLevel[FP_HATE]], qtrue );
                        G_SoundOnEnt( self, CHAN_ITEM, "sound/weapons/force/hate.mp3" );
                    }
            //maybe just have him look at you?  Respond?  Take your enemy?
            if ( traceEnt->client->ps.pm_type < PM_DEAD && traceEnt->NPC!=NULL && !(traceEnt->NPC->scriptFlags&SCF_NO_RESPONSE) )
            {
                NPC_UseResponse( traceEnt, self, qfalse );
                WP_ForcePowerStart( self, FP_HATE, 1 );
            }
        }//NOTE: no effect on TEAM_NEUTRAL?
        else
        {
                NPC_Jedi_PlayConfusionSound( traceEnt );
        }
        vec3_t    eyeDir;
        AngleVectors( traceEnt->client->renderInfo.eyeAngles, eyeDir, NULL, NULL );
        VectorNormalize( eyeDir );
        G_PlayEffect( "force/force_hatetouch", traceEnt->client->renderInfo.eyePoint, eyeDir );

        //make sure this plays and that you cannot press fire for about 1 second after this
        //FIXME: BOTH_FORCEMINDTRICK or BOTH_FORCEDISTRACT
        NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCEHEAL_QUICK, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_RESTART|SETANIM_FLAG_HOLD );
        //FIXME: build-up or delay this until in proper part of anim
    }
    else
    {
        if ( self->client->ps.forcePowerLevel[FP_HATE] > FORCE_LEVEL_1 && tr.fraction * 2048 > 64 )
        {//don't create a diversion less than 64 from you of if at power level 1
            //use distraction anim instead
            G_PlayEffect( G_EffectIndex( "force/force_hatetouch" ), tr.endpos, tr.plane.normal );
            //FIXME: these events don't seem to always be picked up...?
            AddSoundEvent( self, tr.endpos, 512, AEL_DISCOVERED, qtrue, qtrue );
            AddSightEvent( self, tr.endpos, 512, AEL_DISCOVERED, 50 );
            WP_ForcePowerStart( self, FP_HATE, 0 );
        }
        NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCEHEAL_QUICK, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_RESTART|SETANIM_FLAG_HOLD );
    }
    self->client->ps.saberMove = self->client->ps.saberBounceMove = LS_READY;//don't finish whatever saber anim you may have been in
    self->client->ps.saberBlocked = BLOCKED_NONE;
    self->client->ps.weaponTime = 1000;
    if ( self->client->ps.forcePowersActive&(1<<FP_SPEED) )
    {
        self->client->ps.weaponTime = floor( self->client->ps.weaponTime * g_timescale->value );
    }
}

follow my tutorial about adding a new FP into SP and add this void under void_forcetelepathy into wp_saber.cpp

And you can make a foolish free for all battle also in single player game.

for allow to you to charm all classes with hate, simply remove the classes i added into the first switch case. they resist to fhe hate power because i use as bosses.

Note: at level 1 of hate you can charm only shooters. with level 2-3 you can charm also saberist.

an important note: because charm code is done for affected only Shooters (default mindtrick level 3 cannot used for dark jedi)

the saberist charmed will never return to enemy time also when power effect is up. but you can simply charm again and they will become again foes. if you charm a third time, they become allied. and so on. LOL. is a cycle.

so, if you are lazy of some teammate you can turn it into an enemy and take down without get the mission failing status :)

 

Maybe you will charm rosh? D: XD

 

 

Looked over the tutorial.

 

8vwya.jpg

 

 

Is there any way you could provide a download for the modified SP Files to only include Force Hate? There's no way I will follow that tutorial without throwing my shoe through a wall.

Link to comment

Looked over the tutorial.

 

<script pagespeed_no_defer="">//=d.offsetWidth&&0>=d.offsetHeight)a=!1;else{c=d.getBoundingClientRect();var f=document.body;a=c.top+("pageYOffset"in window?window.pageYOffset:(document.documentElement||f.parentNode||f).scrollTop);c=c.left+("pageXOffset"in window?window.pageXOffset:(document.documentElement||f.parentNode||f).scrollLeft);f=a.toString()+","+c;b.b.hasOwnProperty(f)?a=!1:(b.b[f]=!0,a=a<=b.e.height&&c<=b.e.width)}a&&(b.a.push(e),b.d[e]=!0)};p.prototype.checkImageForCriticality=function(b){b.getBoundingClientRect&&q(this,b)};h("pagespeed.CriticalImages.checkImageForCriticality",function(b){n.checkImageForCriticality(b)});h("pagespeed.CriticalImages.checkCriticalImages",function(){r(n)});var r=function(b){b.b={};for(var d=["IMG","INPUT"],a=[],c=0;c=a.length+e.length&&(a+=e)}b.g&&(e="&rd="+encodeURIComponent(JSON.stringify(s())),131072>=a.length+e.length&&(a+=e),d=!0);t=a;if(d){c=b.f;b=b.h;var f;if(window.XMLHttpRequest)f=new XMLHttpRequest;else if(window.ActiveXObject)try{f=new ActiveXObject("Msxml2.XMLHTTP")}catch(k){try{f=new ActiveXObject("Microsoft.XMLHTTP")}catch(u){}}f&&(f.open("POST",c+(-1==c.indexOf("?")?"?":"&")+"url="+encodeURIComponent(b)),f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.send(a))}}},s=function(){var b={},d=document.getElementsByTagName("IMG");if(0==d.length)return{};var a=d[0];if(!("naturalWidth"in a&&"naturalHeight"in a))return{};for(var c=0;a=d[c];++c){var e=a.getAttribute("pagespeed_url_hash");e&&(!(e in b)&&0=b[e].k&&a.height>=b[e].j)&&(b[e]={rw:a.width,rh:a.height,ow:a.naturalWidth,oh:a.naturalHeight})}return b},t="";h("pagespeed.CriticalImages.getBeaconData",function(){return t});h("pagespeed.CriticalImages.Run",function(b,d,a,c,e,f){var k=new p(b,d,a,e,f);n=k;c&&m(function(){window.setTimeout(function(){r(k)},0)})});})();pagespeed.CriticalImages.Run('/mod_pagespeed_beacon','http://jkhub.org/index.php?s=e7d1598a310c95b2be16501c867b6120&app=forums&module=ajax§ion=topics&do=quote&t=6441&p=95307&md5check=d87983f0d9f6ad54436287f405ba0e28&isRte=1,qWLXzJ-b4O,true,false,wGSVU2GOEGM'); //]]></script>8vwya.jpg&&0

 

 

Is there any way you could provide a download for the modified SP Files to only include Force Hate? There's no way I will follow that tutorial without throwing my shoe through a wall.

Well... sure. i have again more back up of original openjk source code. D: but i need to copy paste by my large mod the block related to force hate. understood you are not a coder. well, me not too, just a beginner.

 

give me a lot of time. next day i add into my git a repository of my code. after i am glad to perform your request. it's a gift for you, okay? :)

i like to help people. ^_^

Daedra likes this
Link to comment

Well... sure. i have again more back up of original openjk source code. D: but i need to copy paste by my large mod the block related to force hate. understood you are not a coder. well, me not too, just a beginner.

 

give me a lot of time. next day i add into my git a repository of my code. after i am glad to perform your request. it's a gift for you, okay? :)

i like to help people. ^_^

And this is why having your source code on git with commits that could be easily identified as that part of the code would have made your life that much simpler :P

Link to comment

And this is why having your source code on git with commits that could be easily identified as that part of the code would have made your life that much simpler :P

Yes, i have a little question. because i am new using git and i not know much is particular upload system.

I writed the read me file and i maked a repository, but i have some problem to update my stuff into it. how can i do it withut installig git desktop? i have a Windows Xp SP3. not sure if git desktop support my OS. 

Link to comment
  • 3 weeks later...

Well i did it. merging mindtrick level 1 code and force grip code i did a perfect force freeze code,. :D

at level 1 the freezing field is weak and push and pull can broke it.

level 2 and 3 freezing field resist to push and pull and also if you jump upon enemies. :D you can break only if you shoot the enemies or if you kill the enemies. duration is 10 sec level 1, 15 sec level 2, 20 second level 3.

so my code stuff is over for the moment, i can modding other things. Thanks for all helps. i will upload into GIT what i did in these months, in case can be helpful for someone. :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...