Exemplo n.º 1
0
 private static void RunSurvivors(WorldPeds worldPeds)
 {
 }
Exemplo n.º 2
0
 private static void RunWildlife(WorldPeds worldPeds)
 {
 }
Exemplo n.º 3
0
 private static void RunMilitary(WorldPeds worldPeds)
 {
 }
Exemplo n.º 4
0
 private static void RunHoard(WorldPeds worldPeds)
 {
 }
Exemplo n.º 5
0
 private static void RunBandits(WorldPeds worldPeds)
 {
 }
Exemplo n.º 6
0
 public static void RunWorldEvents(WorldPeds worldPeds)
 {
     RunSurvivors(worldPeds);
     RunWildlife(worldPeds);
     RunMilitary(worldPeds);
     RunBandits(worldPeds);
     RunHoard(worldPeds);
 }
Exemplo n.º 7
0
        public static void ConvertPedsToZeds(WorldPeds worldPeds, bool zedsAttackPlayer)
        {
            var pedsInWorld = World.GetAllPeds();

            // Don't apply zombie effects to any NPCs spawned by scripts, or previously processed peds (or the player)
            var existingPeds =
                worldPeds.Bandits//.Concat(worldPeds.Hoard)
                    .Concat(worldPeds.Military)
                    .Concat(worldPeds.Survivors)
                    .Concat(worldPeds.Wildlife)
                    .Concat(worldPeds.Zeds)
                    .Select(p => p.Handle)
                    .ToList();

            existingPeds.Add(Game.Player.Character.Handle);

            if (worldPeds.Companion != null)
            {
                existingPeds.Add(worldPeds.Companion.Handle);
            }

            var processedPeds = new List<Ped>();

            foreach (var ped in pedsInWorld)
            {
                // Don't process any existing peds, aliens or non-humans
                if (existingPeds.Contains(ped.Handle)) { continue; }
                //if (ped.Model.Hash == (uint)PedHash.MovAlien01) { continue; }
                if (!ped.IsHuman) { continue; }

                Function.Call(Hash.APPLY_PED_DAMAGE_PACK, ped.Handle, "BigHitByVehicle", 0, 1);
                Function.Call(Hash.APPLY_PED_DAMAGE_PACK, ped.Handle, "HOSPITAL_8", 0, 1);
                Function.Call(Hash.APPLY_PED_DAMAGE_PACK, ped.Handle, "HOSPITAL_9", 0, 1);
                Function.Call(Hash.APPLY_PED_DAMAGE_PACK, ped.Handle, "Explosion_Med", 0, 1);

                if (Function.Call<bool>(Hash.IS_AMBIENT_SPEECH_PLAYING, ped.Handle))
                {
                    Function.Call(Hash.STOP_CURRENT_PLAYING_AMBIENT_SPEECH, ped.Handle);
                }

                //Function.Call(Hash.STOP_PED_SPEAKING, ped.Handle, 0);

                Function.Call(Hash.SET_PED_FLEE_ATTRIBUTES, ped.Handle, 0, 0);

                if (!Function.Call<bool>(Hash.HAS_ANIM_SET_LOADED, "move_m@drunk@verydrunk"))
                {
                    Function.Call(Hash.REQUEST_ANIM_SET, "move_m@drunk@verydrunk");
                }

                Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, ped.Handle, "move_m@drunk@verydrunk", 1f);

                if (zedsAttackPlayer)
                {
                    ped.Task.GoTo(Game.Player.Character);
                }

                //if (ped.IsTouching(Game.Player.Character))
                //{
                //    Function.Call(Hash.APPLY_DAMAGE_TO_PED, Game.Player.Character.Handle, 10, 0);
                //}

                processedPeds.Add(ped);
            }

            var pedsDespawned = worldPeds.Zeds.Except(pedsInWorld);
            worldPeds.Zeds = worldPeds.Zeds.Except(pedsDespawned).ToList();
            worldPeds.Zeds.AddRange(processedPeds);

            // TODO
            //  / Add all peds in world to list
            //  / Remove player + peds in worldPeds
            //  / Set zeds to be drunk
            //  / Apply blood decals
            //  / Add ped to worldPeds.Zeds to prevent processing ped multiple times
            //  / Remove peds that have been despawned from worldPeds.Zeds
            //  - Stop peds using phones
            //  - Stop peds talking
            //  - Test that spawned npcs (bandits, wildlife, etc) don't get decals or drunk applied to them

            // Damage decal packs:
            // BigHitByVehicle, HOSPITAL_8, HOSPITAL_9, Explosion_Med

            // Example:
            // Function.Call(Hash.APPLY_PED_DAMAGE_PACK, ped, "BigHitByVehicle", 0, 1);

            // To make a ped drunk (zombie-like)
            // Function.Call(Hash.SET_PED_MOVEMENT_CLIPSET, ped.Handle, "move_m@drunk@verydrunk", 1f);
            //switch@trevor@drunk_howling
            //http://gtaforums.com/topic/817563-v-euphorianaturalmotion-messages/
        }