View Single Post
Old 01-19-2006, 07:29 AM   #29
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by rgdelta
Unfortunatly the 2 scripts I need in the archive have the compare does not match the scripts are a_sion_cut.ncs and a_sion_cut2.ncs
Here are two scripts that match a_sion_cut and a_sion_cut2 without any errors, if those in the decompiled archive doesn't work:

Code:
// ST: a_sion_cut.nss (153HAR_s.rim)

void main() {
    object oSion = GetObjectByTag("DarthSion");
    if (!GetIsObjectValid(oSion)) {
        AurPostString("Darth Sion isn't here, don't bother with the rest of the cut scene", 5, 7, 10.0);
        return;
    }
    
    SetPartyLeader(NPC_PLAYER);
    
    object oPC = GetFirstPC();
    object oAtton = GetObjectByTag("atton");
    object oKreia = GetObjectByTag("kreia");
    
    if (!GetIsObjectValid(oAtton) || !GetIsObjectValid(oKreia)) {
        AurPostString("No Atton or Kreia, don't bother with the rest of the cut scene", 5, 7, 10.0);
        return;
    }
    
    int nParam = GetScriptParameter(1);
    switch (nParam) {
        case 0: {
            AssignCommand(oPC,    ClearAllActions());
            AssignCommand(oKreia, ClearAllActions());
            AssignCommand(oAtton, ClearAllActions());
            
            AssignCommand(oPC,    ActionJumpToLocation(GetLocation(GetObjectByTag("WP_pc"))));
            AssignCommand(oKreia, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_npc2"))));
            AssignCommand(oAtton, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_npc3"))));

            object oWP1 = GetObjectByTag("WP_SION_PC1");
            object oWP2 = GetObjectByTag("WP_SION_PC2");
            object oWP3 = GetObjectByTag("WP_SION_PC3");
            AssignCommand(oPC, ActionForceMoveToLocation(GetLocation(oWP1)));

            vector vPos = GetPositionFromLocation( GetLocation(GetObjectByTag("WP_pc_look")) );
            AssignCommand(oPC, ActionDoCommand(SetFacingPoint(vPos)));

            AssignCommand(oPC, SetLockOrientationInDialog(oPC, TRUE));
            DelayCommand(0.1, AssignCommand(oKreia, ActionForceMoveToLocation(GetLocation(oWP2))));
            DelayCommand(0.1, AssignCommand(oAtton, ActionForceMoveToLocation(GetLocation(oWP3))));
        }
        break;
        
        case 1:
            AssignCommand(oPC, ActionWait(1.8));
            AssignCommand(oPC, ActionPlayAnimation( ANIMATION_FIREFORGET_HEAD_TURN_LEFT ));
        break;
        
        case 2: {
            AssignCommand(oPC,    ClearAllActions());
            AssignCommand(oKreia, ClearAllActions());
            AssignCommand(oAtton, ClearAllActions());
            
            AssignCommand(oPC, SetLockOrientationInDialog(oPC, FALSE));
            
            vector vFace1 = GetPositionFromLocation(GetLocation(oSion));
            AssignCommand(oPC,    ActionDoCommand(SetFacingPoint(vFace1)));
            AssignCommand(oKreia, ActionDoCommand(SetFacingPoint(vFace1)));
            
            DelayCommand(0.5, AssignCommand(oAtton, ActionDoCommand(SetFacingPoint(vFace1))));
        }
        break;
        
        case 3:
        break;
        
        case 4: {
            effect eSlow = EffectMovementSpeedDecrease(50);
            AssignCommand(oSion, ClearAllActions());
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSlow, oSion, 4.0);
            AssignCommand(oSion, ActionForceMoveToObject(GetObjectByTag("WP_SION_2")));
        }
        break;
        
        case 5: {
            AssignCommand(oKreia, ClearAllActions());
            AurPostString("Kreia flourish.", 5, 12, 10.0);
            
            vector vFace2 = GetPositionFromLocation(GetLocation(oPC));
            AssignCommand(oKreia, ActionDoCommand(SetFacingPoint(vFace2)));
            
            AssignCommand(oKreia, SetLockOrientationInDialog(oKreia, TRUE));
            AssignCommand(oKreia, CreatureFlourishWeapon(oKreia));
        }
        break;
        
        case 6:
            AurPostString("Kreia runs first WP.", 5, 14, 10.0);
            AssignCommand(oKreia, ClearAllActions());
            AssignCommand(oKreia, ActionForceMoveToObject(GetObjectByTag("WP_kreia_leave_1"), TRUE));
        break;
        
        case 7:
            AssignCommand(oKreia, ClearAllActions());
            AssignCommand(oKreia, ActionForceMoveToObject(GetObjectByTag("WP_kreia_leave_2"), TRUE));
        break;
        
        case 8: {
            object oDoor = GetObjectByTag("kreia_sion_door");
            if (GetIsObjectValid(oDoor)) {
                AssignCommand(oDoor, ActionCloseDoor(oDoor));
                AssignCommand(oDoor, SetLocked(oDoor, TRUE));
            }
        }
        break;
        
        case 9: {
            AssignCommand(oKreia, ClearAllActions());
            
            vector vFace3 = GetPositionFromLocation(GetLocation(oPC));
            AssignCommand(oKreia, ActionDoCommand(SetFacingPoint(vFace3)));
            
            AssignCommand(oKreia, SetLockOrientationInDialog(oKreia, TRUE));
        }
        break;
        
        case 10: {
            object oKreiaCheck = GetObjectByTag("kreia");
            if (GetIsObjectValid(oKreiaCheck)) {
                AurPostString("Kreia removed from party.", 5, 10, 10.0);
                RemovePartyMember(NPC_KREIA);
            }
        }
        break;
        
        case 11:
            AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, OBJECT_SELF) ));
            AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_LEFTWEAPON, OBJECT_SELF) ));
            AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON2, OBJECT_SELF) ));
            AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_LEFTWEAPON2, OBJECT_SELF) ));
            AssignCommand(oKreia, ActionEquipItem( CreateItemOnObject("w_melee_06", oKreia, 1, TRUE), INVENTORY_SLOT_RIGHTWEAPON, TRUE) );
        break;
        
        case 12: {
            object oSword = GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, oKreia);
            DestroyObject(oSword);
        }
        break;
    }
}
Code:
// ST: a_sion_cut2.nss (153HAR_s.rim)

void main() {
    object oSion = GetObjectByTag("DarthSion");
    object oKreia = GetObjectByTag("kreia");
    object oAtton = GetObjectByTag("atton");
    
    if (!GetIsObjectValid(oSion) || !GetIsObjectValid(oKreia) || !GetIsObjectValid(oAtton)) {
        AurPostString("No Darth Sion and/or Kreia, don't bother with the rest of the cut scene", 5, 7, 10.0);
        return;
    }
    
    int nParam = GetScriptParameter(1);
    switch (nParam) {
        case 0: {
            AssignCommand(oKreia, ClearAllActions());
            AssignCommand(oKreia, ActionJumpToLocation( GetLocation(GetObjectByTag("WP_kreia_start")) ));
            
            vector vFace1 = GetPositionFromLocation( GetLocation(GetObjectByTag("WP_fight_kreia")) );
            AssignCommand(oKreia, ActionDoCommand(SetFacingPoint(vFace1)));
            
            AssignCommand(oKreia, SetLockOrientationInDialog(oKreia, TRUE));
        }
        break;
        
        case 1: {
                effect eSlow = EffectMovementSpeedDecrease(50);
                ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSlow, oSion, 15.0);
                
                AssignCommand(oSion, ClearAllActions());
                AssignCommand(oSion, ActionForceMoveToLocation( GetLocation(GetObjectByTag("WP_fight_sion"))) );
                
                vector vFace2 = GetPositionFromLocation( GetLocation(GetObjectByTag("WP_sion_left") ));
                AssignCommand(oSion, ActionDoCommand(SetFacingPoint(vFace2)));
                
                AssignCommand(oSion, SetLockOrientationInDialog(oSion, TRUE));
        }
        break;
        
        case 2: {
            SetFakeCombatState(oKreia, TRUE);
            
            vector vSion1 = GetPositionFromLocation(GetLocation(oSion));
            AssignCommand(oKreia, ActionDoCommand(SetFacingPoint(vSion1)));
            
            AssignCommand(oKreia, ActionPlayAnimation(10173));
            AssignCommand(oKreia, ActionPlayAnimation(ANIMATION_LOOPING_READY, 1.0, -1.0));
            AssignCommand(oKreia, SetLockOrientationInDialog(oKreia, TRUE));
            AssignCommand(oKreia, CreatureFlourishWeapon(oKreia));
        }
        break;
        
        case 3: {
            AssignCommand(oKreia, ClearAllActions());
            AssignCommand(oKreia, ActionForceMoveToLocation( GetLocation(GetObjectByTag("WP_fight_kreia")) ));
            
            vector vSion2 = GetPositionFromLocation(GetLocation(oSion));
            AssignCommand(oKreia, ActionDoCommand(SetFacingPoint(vSion2)));
            
            AssignCommand(oKreia, SetLockOrientationInDialog(oKreia, TRUE));
        }
        break;
        
        case 4:
            AssignCommand(oSion, CreatureFlourishWeapon(oSion));
        break;
        
        case 5:
            AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, OBJECT_SELF) ));
            ChangeObjectAppearance(oKreia, 627);
        break;
        
        case 6: {
            vector vFace3 = GetPositionFromLocation( GetLocation(GetObjectByTag("WP_sion_right")) );
            AssignCommand(oSion, ActionDoCommand(SetFacingPoint(vFace3)));
            AssignCommand(oSion, SetLockOrientationInDialog(oSion, TRUE));
        }
        break;
        
        case 7: {
            vector vDoor = GetPositionFromLocation( GetLocation(GetObjectByTag("kreia_sion_door")) );
            AssignCommand(oSion, ActionDoCommand(SetFacingPoint(vDoor)));
            AssignCommand(oSion, SetLockOrientationInDialog(oSion, TRUE));
        }
        break;
        
        case 8:
            AssignCommand(oAtton, ClearAllActions());
            AssignCommand(oAtton, ActionForceMoveToObject(GetFirstPC(), TRUE));
        break;
        
        case 9: {
                object oSword = GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, oKreia);
                DestroyObject(oSword);
        }
        break;
        
        case 10:
        break;
        
        case 11:
            AssignCommand(oSion, ClearAllEffects());
        break;
        
        case 12:
            AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, OBJECT_SELF) ));
            AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_LEFTWEAPON, OBJECT_SELF) ));
            AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON2, OBJECT_SELF) ));
            AssignCommand(oKreia, ActionUnequipItem( GetItemInSlot(INVENTORY_SLOT_LEFTWEAPON2, OBJECT_SELF) ));
            AssignCommand(oKreia, ActionEquipItem( CreateItemOnObject("w_melee_06", oKreia, 1, TRUE), INVENTORY_SLOT_RIGHTWEAPON, TRUE) );
        break;
    }
}

stoffe is offline   you may: quote & reply,