• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Npc Emote Back

Lightning Blade

BETA Tester
Code:
local example = NPCID

local function Npc_example(event, creature, plr, emoteid)
if(emoteid == 17) then
			creature:Emote(2)
	end
end

RegisterCreatureEvent(example , 8, Npc_example)

If you /bow the npc attached to this script, the npc will bow back. You can change Emote(2) to anything a like Emote(10) and get another Emote to be played.

Note: This have been fully tested.
 

slp13at420

Mad Scientist
0.o now that's funny n giveas me n idea ... :challengeaccepted: something like a dynamic table of all npc'z n a script that gets loop-loaded to all npc's that randomly will pick an emote that the npc will react too and a random return emote or... a chance to just piss it off and it turn on you rofl...

:juggle:
tables.n.loops.n.tables.n.loops

hmmm I think I will give it a try see what happens .... I think it can be done there-for it can be done.
just gotta find emote limits n check em out...n get really fkn high...
...........
oh yea n yea it works ....
 
Last edited:

Rochet2

Moderator / Eluna Dev
0.o now that's funny n giveas me n idea ... :challengeaccepted: something like a dynamic table of all npc'z n a script that gets loop-loaded to all npc's that randomly will pick an emote that the npc will react too and a random return emote or... a chance to just piss it off and it turn on you rofl...

:juggle:
tables.n.loops.n.tables.n.loops

hmmm I think I will give it a try see what happens .... I think it can be done there-for it can be done.
just gotta find emote limits n check em out...n get really fkn high...
...........
oh yea n yea it works ....

I would like to note that the hook is an AI hook, which means that it will remove the C++ scripted AI and very likely SAI from the creature.
So if you for example use this for bosses, they lose their normal scripts.
We should probably make an error for using lua with AI hook and C++ at the same time or script it so that its possible.
 

slp13at420

Mad Scientist

this is what I sent to him:

Code:
[COLOR="#808080"]
-- this is supposed to hook the script to creature event 8 on receive emote
-- if the emote matches a random pre-determined emote value then a random pre-determined return emote
-- will happen. ooorrrrr... the creature may just attack you.... its a work in progress
-- slp13at420 emudevs.com

local Emotemax = 20 -- I don't know the actual max value for emotes lol
local percent = 0.25
				
local function NPC_EMOTE(event, creature, player, emoteid)

math.randomseed(tonumber(os.time()*os.time()))

local Reactor = math.random(1, Emotemax)
local Reaction = math.random(1, Emotemax)

	if(emoteid==Reactor)then
		if(Reaction < (Emotemax-(Emotemax*percent)))then
			creature:Emote(Reaction)
		else
			creature:AttackStart(player)
		end
	end
end

RegisterCreatureEvent(100, 8, NPC_EMOTE)
RegisterCreatureEvent(3100, 8, NPC_EMOTE)


[/COLOR]

I still need to add some verbal response if you piss it off. and maybe table the creature entry ids and loop the RegisterCreatureEvent.

https://github.com/BlackWolfsDen/misc/blob/master/NPC_Emote.lua

 
Last edited:
Top