SERVER_HOOK_EMOTE = 8 --(event, pPlayer, pUnit, EmoteId)
Code:
function On_Emote_WorldHook(event, pPlayer, pUnit, EmoteId)
if EmoteId == 1 then -- The PLAYER emoteId for cheer, player and NPC emotes are different
if pPlayer:HasQuest(1) then -- The ID of the quest
pPlayer:SpawnCreature(1, pPlayer:GetX(), pPlayer:GetY(), pPlayer:GetZ(), pPlayer:GetO(), 35, 120000) -- Spawn npcid 1 at players position as friendly for 120 seconds (2mins)
end
end
end
RegisterServerHook(8, "On_Emote_WorldHook")
Bear in mind if you do this you will need to write a way to stop the player spamming the emote with a macro to spawn X npc's and crash the server.
Edited your title to add a prefix. I don't know if you want a Lua script, a C++ script etc so it's not very helpful the information you have provided.