Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if type(F_InitGarages) ~= "function" then
- F_InitGarages = function()
- DATLoad("Garages.DAT", 1)
- GarageClearAll()
- GarageAdd(TRIGGER._Garage_SchoolGrounds, POINTLIST._Garage_SchoolGrounds)
- GarageAdd(TRIGGER._Garage_RichArea, POINTLIST._Garage_RichArea)
- GarageAdd(TRIGGER._Garage_BusinessArea, POINTLIST._Garage_BusinessArea)
- GarageAdd(TRIGGER._Garage_PoorArea, POINTLIST._Garage_PoorArea)
- end
- end
- shared.userDeviceIsPC = type(_G["ClassMusicSetPlayers"]) == "function"
- if type(shared.mods) ~= "table" then
- shared.mods = {}
- end
- _G.T_SocialTalk = function()
- while not SystemIsReady() do
- Wait(0)
- end
- shared.mods.SocialTalk = {}
- -- Localization:
- local rand = _G.math.random
- local len = _G.table.getn
- local psan
- psan = function(animPath, actFile)
- PedSetAITree(gPlayer, "/Global/AI", "Act/AI/AI.act")
- PedSetActionNode(gPlayer, animPath, actFile)
- PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
- end
- local spase = _G.SoundPlayAmbientSpeechEvent
- -- Load animations:
- shared.mods.SocialTalk.AnimationGroup = {"Ambient", "Ambient2", "Ambient3", "SFAT_F", "SNERD_F", "SGEN_F", "SGIRL_F", "SBULL_F", "NPC_Chat_1", "NPC_Chat_2", "NPC_Chat_F"}
- for _, v in ipairs(shared.mods.SocialTalk.AnimationGroup) do
- LoadAnimationGroup(v)
- end
- -- Setup:
- shared.mods.SocialTalk.Animations = {
- s = 1,
- {"/Global/Ambient/Talking/Talking/FAT/SpeechAnims/Anims", "Act/Anim/Ambient.act"},
- {"/Global/Ambient/Talking/Talking/NerdMale/SpeechAnims/Anims", "Act/Anim/Ambient.act"},
- {"/Global/Ambient/Talking/Talking/Male/SpeechAnims/Anims", "Act/Anim/Ambient.act"},
- --{"/Global/Ambient/Talking/Talking/Male2/AGR1/Anims", "Act/Anim/Ambient.act"}, -- Doesn't work to Player, only NPC.
- {"/Global/Ambient/Talking/Talking/Male2/AGR2/Anims", "Act/Anim/Ambient.act"},
- {"/Global/Ambient/Talking/Talking/GEN/SpeechAnims/Anims", "Act/Anim/Ambient.act"},
- {"/Global/Ambient/Talking/Talking", "Act/Anim/Ambient.act"},
- {"/Global/Ambient/Talking/Talking/Female/SpeechAnims/Anims", "Act/Anim/Ambient.act"},
- {"/Global/Ambient/Talking/Talking/Female2/AGRF/Anims", "Act/Anim/Ambient.act"},
- }
- local anims = shared.mods.SocialTalk.Animations
- shared.mods.SocialTalk.Speech = {
- npc = {
- s = 1,
- "CONVERSATION_CONTINUATION",
- "CONVERSATION_GOSSIP",
- "CONVERSATION_GOSSIP_CHAPTER_1",
- "CONVERSATION_GOSSIP_CHAPTER_2",
- "CONVERSATION_GOSSIP_CHAPTER_3",
- "CONVERSATION_GOSSIP_CHAPTER_4",
- "CONVERSATION_GOSSIP_CHAPTER_5",
- "CONVERSATION_GOSSIP_CHAPTER_6",
- "CONVERSATION_GOSSIP_PRIVATE",
- "CONVERSATION_GOSSIP_REPLY",
- "CONVERSATION_NEGATIVE_PERSONAL",
- "CONVERSATION_NEGATIVE_REPLY",
- "CONVERSATION_NEGATIVE_STATEMENT",
- "CONVERSATION_PARTING",
- "CONVERSATION_POSITIVE_PERSONAL",
- "CONVERSATION_POSITIVE_REPLY",
- "CONVERSATION_QUESTION",
- "CONVERSATION_QUESTION_REPLY",
- "CONVERSATION_QUESTION_RESPONSE",
- "CONVERSATION_START",
- "CONVERSATION_END",
- },
- player = {
- s = 1,
- "PLAYER_AFFIRMATIVE",
- "PLAYER_APOLOGY_AUTHORITY_GOOD",
- "PLAYER_APOLOGY_SMOOTH",
- "PLAYER_EXCUSE",
- "PLAYER_IDLE",
- "PLAYER_IDLE_CLASS",
- "PLAYER_IDLE_RAIN",
- "PLAYER_IDLE_SHIVER",
- "PLAYER_IDLE_TIRED",
- "PLAYER_IDLE_WINTER",
- "PLAYER_OFFICE",
- "PLAYER_APOLOGY_GIRL",
- "PLAYER_FLIRT_GOOD",
- "PLAYER_FLIRT_POOR"
- }
- }
- local speech = shared.mods.SocialTalk.Speech
- local girlsFaction = {
- [1] = true,
- [2] = true,
- [3] = true,
- [4] = true,
- [5] = true,
- [6] = true
- }
- local target
- while true do
- Wait(0)
- --[[if not PedIsModel(gPlayer, 0) and not PedIsDoingTask(gPlayer, "/Global/PlayerAI", true) then
- PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
- end]]
- target = PedGetTargetPed(gPlayer)
- -- Change model:
- --[[if shared.userDeviceIsPC then
- if IsButtonPressed(8, 0) and IsButtonBeingPressed(11, 0) then
- PlayerSwapModel(rand(2) == 1 and "player" or (rand(2) == 1 and "PRGirl_Pinky" or "GN_Littleblkboy"))
- --PedSetActionTree(gPlayer, "/Global/Player", "Act/Player.act")
- --PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
- end
- else
- if IsButtonHeld(8, 0) and IsButtonBeingPressed(6, 0) then
- PlayerSwapModel(rand(2) == 1 and "player" or (rand(2) == 1 and "PRGirl_Pinky" or "GN_Littleblkboy"))
- --PedSetActionTree(gPlayer, "/Global/Player", "Act/Player.act")
- --PedSetAITree(gPlayer, "/Global/PlayerAI", "Act/PlayerAI.act")
- end
- end]]
- if (PedMePlaying(gPlayer, "Default_KEY") or PedMePlaying(gPlayer, "Talking")) and PedIsValid(target) and not PedIsInCombat(target) and PedIsSocializing(target) and (PedMePlaying(target, "Default_KEY") or PedMePlaying(target, "Talking") or SoundSpeechPlaying(target, "SUCKING_UP")) and PedGetTargetPed(target) == gPlayer and IsButtonBeingPressed(7, 0) then
- Wait(1)
- PedSetWantsToSocializeWithPed(target, gPlayer)
- if PedIsModel(gPlayer, 0) then
- if SoundSpeechPlaying(gPlayer, "PLAYER_GREET_GENERIC") or rand(3) < 3 then
- SoundStopCurrentSpeechEvent(gPlayer)
- end
- if PedIsFemale(target) then
- if girlsFaction[PedGetFaction(target)] then
- anims.s = rand(len(anims)-2)
- psan(anims[anims.s][1], anims[anims.s][2])
- speech.player.s = rand(len(speech.player))
- spase(gPlayer, speech.player[speech.player.s])
- else
- anims.s = rand(len(anims)-2)
- psan(anims[anims.s][1], anims[anims.s][2])
- speech.player.s = rand(len(speech.player)-3)
- spase(gPlayer, speech.player[speech.player.s])
- end
- else
- anims.s = rand(len(anims)-2)
- psan(anims[anims.s][1], anims[anims.s][2])
- speech.player.s = rand(len(speech.player)-3)
- spase(gPlayer, speech.player[speech.player.s])
- end
- else
- if PedIsFemale(gPlayer) then
- anims.s = rand(len(anims)-2, len(anims))
- psan(anims[anims.s][1], anims[anims.s][2])
- speech.npc.s = rand(len(speech.npc)-1)
- spase(gPlayer, speech.npc[speech.npc.s])
- else
- anims.s = rand(len(anims)-2)
- psan(anims[anims.s][1], anims[anims.s][2])
- speech.npc.s = rand(len(speech.npc)-1)
- spase(gPlayer, speech.npc[speech.npc.s])
- end
- end
- Wait(rand(2) == 1 and rand(0, 200) or rand(500, 1500))
- anims.s = PedIsFemale(target) and rand(len(anims)-2, len(anims)) or rand(len(anims)-2)
- --PedSetTaskNode(target, "/Global/AI/Reactions/Stimuli/Response/RespondGreet/GreetSocial", "Act/AI/AI.act")
- PedSocialKeepAlive(target)
- PedFaceObject(target, gPlayer, 2)
- PedSetActionNode(target, anims[anims.s][1], anims[anims.s][2])
- speech.npc.s = rand(len(speech.npc)-1)
- spase(target, speech.npc[speech.npc.s])
- if rand(6) == 1 then
- spase(target, speech.npc[len(speech.npc)])
- PedStopSocializing(target)
- PedSetTaskNode(target, "/Global/AI", "Act/AI/AI.act")
- PedWander(target)
- end
- end
- end
- end
- shared.mods.TALKING.mainThread = CreateThread("T_SocialTalk")
Add Comment
Please, Sign In to add comment