From 42fb4720a6655d6e42e62031ae0a44ebf38dfbfc Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Thu, 24 Dec 2020 19:39:31 -0600 Subject: [PATCH] Add some NPC stuff --- scripts/server/npc.js | 77 +++++++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 29 deletions(-) diff --git a/scripts/server/npc.js b/scripts/server/npc.js index b11c4516..5d9efe36 100644 --- a/scripts/server/npc.js +++ b/scripts/server/npc.js @@ -8,47 +8,58 @@ // TYPE: Server (JavaScript) // =========================================================================== +const triggerSource = { + player, + npc, + vehicle, + business, + house, +}; + const NPC = { Trigger: { - farProximity, - mediumProximity, - nearProximity, - enterLineOfSight, - exitLineOfSight, - pedCollision, - vehicleCollision, - shootGun, - swingMelee, - stealOccupiedVehicle, - stealUnoccupiedVehicle, - hotwireVehicleStart, - hotwireVehicleFail, - hotwireVehicleSucceed, - vehicleAlarmStart, - varAlarmStop, - sirenStart, - sirenStop, - vehicleEnter, - vehicleExit, - interiorEnter, - interiorExit, - attackedByMelee, - attackedByGun + farProximity, // Comes within a far distance of NPC + mediumProximity, // Comes within a medium distance of NPC + nearProximity, // Comes within a close distance of NPC + enterLineOfSight, // Enters the NPC's line of sight + exitLineOfSight, // Leaves the NPC's line of sight + pedCollision, // Bumps into ped on foot + vehicleCollision, // Bumps into ped with a vehicle + shootGun, // Shoots a gun (target isn't a factor, it's just about only shooting a gun in general) + swingMelee, // Swings a melee weapon (target doesnt matter, it's just about only swinging a melee weapon in general) + hotwireVehicleStart, // Begin attempt to hotwire a vehicle + hotwireVehicleFail, // Failed to hotwire a vehicle + hotwireVehicleSucceed, // Succeeded at hotwiring a vehicle + vehicleAlarmStart, // Vehicle alarm goes off + vehicleAlarmStop, // Vehicle alarm shuts off (disabled, battery dead, damaged, or just turned off legitly) + sirenStart, // Any vehicle with a siren that gets activated + sirenStop, // Any vehicle with a siren that gets deactivated + vehicleEnter, // Enters any vehicle + vehicleExit, // Exits any vehicle + propertyEnter, // Enters any interior + propertyExit, // Exits any interior + attackedByMelee, // Any element is attacked by melee weapon + attackedByGun, // Any element is attacked by gun + attackedByFist, // Any element is attacked by fist }, Condition: { isInLineOfSight, isFarProximity, isMediumProximity, isNearProximity, - isEnemyFaction, - isAllyFaction, - isSameFaction, + isEnemyClan, + isAllyClan, isSameClan, + isNotInClan, isLawEnforcement, + isFirefighter, + isParamedic, isCriminal, hasWantedLevel, isSelfVehicle, + isPlayerVehicle, isOtherVehicle, + isClanVehicle, isEmergencyVehicle, isPoliceVehicle, isDriver, @@ -64,6 +75,9 @@ const NPC = { isSniper, isRPG, isFlameThrower, + isTalking, + isShouting, + isWhispering, }, Response: { shout, @@ -77,7 +91,9 @@ const NPC = { fleeRun, attackMelee, attackFist, + walkToward, runToward, + sprintToward, crouch, phoneCall, walkieTalkieMessage, @@ -86,9 +102,12 @@ const NPC = { fleeTo, driveTo, enterVehicle, + exitVehicle, + pullOutOfVehicle, + enterProperty, } }; -function beginNPCInteraction() { - +function npcTrigger(triggerName, triggerSource) { + } \ No newline at end of file