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

I'm looking for message npc yell script

Status
Not open for further replies.

Xaver

Respected Member
Hello i´m hi search the script for npc wo the npc on time send say massenge

example

Npc 10000

tome 1 min send sey text : bla bla bla

can help my for this pls
 
Last edited by a moderator:

Reloac

BETA Tester
Please check where you post next time, this wasn't a release so should have been in support.
 

Rochet2

Moderator / Eluna Dev
Code:
local function TimedSay(eventId, delay, repeats, creature)
    creature:SendUnitSay("blablabla", 0)
end

local function OnReset(event, creature)
    creature:RemoveEvents()
    creature:RegisterEvent(TimedSay, 1*60*1000, 0)
end

RegisterCreatureEvent(10000, 23, OnReset)

Something like that, no?
 

Xaver

Respected Member
hi rochet i have one problem

emm script work 99%

bug is the timer is not korekt

i habe test millisecond





local function TimedSay(eventId, delay, repeats, creature)
creature:SendUnitSay("|cffF7B100Hallo Ich bin der FAQ NPC Hier kannst du Hilfe bekommen wenn du etwas nicht weist. Nutze mich.", 0)
end

local function OnReset(event, creature)
creature:RemoveEvents()
creature:RegisterEvent(TimedSay, 1*60*3000, 0)
end

RegisterCreatureEvent(500050, 23, OnReset)

3000 have past this is not 3 min in the script


wen i´m change in 5 min = 300000 milli...

wen 300000 in the script and start script come no text in 5 min

or sec

wen cange 300 sec = 5 min not work script post text in 5 sec spamm.

what is the bug here ?
 

Rochet2

Moderator / Eluna Dev
[MENTION=1168]Xaver[/MENTION]
Does the NPC have other scripts?
Do you have other scripts?
Are you using TrinityCore 4.3.4 branch?
Try see if the script still stays the same if it is the only script used.

On TrinityCore 3.3.5a and MaNGOS zero it works fine.
All 3 use the same timed event system.
I tested with this script:

Code:
local ttt

local function TimedSay(eventId, delay, repeats, creature)
    creature:SendUnitSay("|cffF7B100Hallo Ich bin der FAQ NPC Hier kannst du Hilfe bekommen wenn du etwas nicht weist. Nutze mich. "..(os.time()-ttt), 0)
    ttt = os.time()
end

local function OnChat(event, player, msg)
    if (msg == "ccs") then
        player:GetSelection():RemoveEvents()
        player:GetSelection():RegisterEvent(TimedSay, 1*60*3000, 0)
        ttt = os.time()
    end
end

RegisterPlayerEvent(18, OnChat)

which prints the time in seconds between scheduling the timed event and when it fires and prints it with the message.
It prints 180 with the timer set above, which is 3 minutes in seconds as it should.
 
Last edited:

Xaver

Respected Member
have a question,
when I reloaded scripts
stops the messenger npc and not start automatically
can I insert some like a autorefresh?

when yes how ?

thx
 

frost

Banned
i dont think there is but you can always restart your server. there has always been issues i have had when doing reloads.
 

Xaver

Respected Member
no no problems when I reboot.

but imagine 200 + player online then redes times restart ??

not good ^^

do you understand
 

slp13at420

Mad Scientist
the problem is , is that your using an `on reset` creature event hook. that doesn't occur during `reload eluna` . and if you want it to apply to ALL creatures of xx id. maybe try `movement in Line Of Site` event `27 or 28 . (the script would need some re-adjusting for this ,,if its possible)

now if its only 1 creature that this script applies to then you could write it so you just select the creature then command it to restart the timed event.
 
Last edited:

slp13at420

Mad Scientist
if your using only 1 creature for this then it can be done .. but multiple spawns of 1 creature dunno.....

if your using only 1 spawned creature for this the all you have to do is select the creature then type `load talker` and poof it will start its timer again.
theres just no event hook for creature on eluna reload.(dunno if there is really a demand for it)

Code:
-- by Rochet2 of EmuDevs

local npcid = 3100 -- 10000
local delay = 1*60*1000 -- 60 seconds/1 minute
local cycles = 1

local function TimedSay(eventId, delay, repeats, creature)
    creature:SendUnitSay("Hey !! Pay attention to me !! BENDER !!", 0)
	creature:RemoveEvents()
    creature:RegisterEvent(TimedSay, delay, cycles)
end

local function OnReset(event, creature)
    creature:RegisterEvent(TimedSay, delay, cycles)
end

RegisterCreatureEvent(npcid, 23, OnReset)

function ReloadTalker(event, player, msg) -- select creature and type `load talker`

local message = "load talker"

	 if(msg)then 
	 
		if((msg:lower() == message)and(player:GetGMRank() >= 3))then 

			if(player:GetSelection():GetEntry() == npcid)then

				player:GetSelection():RegisterEvent(TimedSay, delay, cycles)
			else
			end
		else
		end 
	else
	end 
end

RegisterPlayerEvent(18, ReloadTalker)
 
Last edited:

Xaver

Respected Member
when say load the npc say text yes, but come no text next time.

look my npc have say text to time in 1 min ok..

im import you script, and reload lua ok

i´m select npc and i´m say load (Change to load) the npc say text but next time no come text.

when say load the npc say text ^^ but no auto say´s

do you understand
 

slp13at420

Mad Scientist
JHhJcSB.png


hmmmmmmm that's weird...it fires when the core loads as you can see in the pic.
then I reloaded Eluna and select the creature then type `load talker` and it starts talking again...
I did tweek the script a little more:

Code:
-- by Rochet2 of EmuDevs

local npcid = 3100 -- 10000
local delay = 1*10*1000 -- 10 seconds
local cycles = 1

local function TimedSay(eventId, delay, repeats, creature)
    creature:SendUnitSay("Hey !! Pay attention to me !! BENDER !!", 0)
	creature:RemoveEvents()
    creature:RegisterEvent(TimedSay, delay, cycles)
end

local function OnReset(event, creature)
    creature:RegisterEvent(TimedSay, delay, cycles)
end

RegisterCreatureEvent(npcid, 23, OnReset)

function ReloadTalker(event, player, msg) -- select creature and type `load talker`

local message = "load talker"

	 if(msg)then 
	 
		if((msg:lower() == message)and(player:GetGMRank() >= 3))then 

			if(player:GetSelection():GetEntry() == npcid)then

				player:GetSelection():RegisterEvent(TimedSay, delay, cycles)
			else
			end
		else
		end 
	else
	end 
end

RegisterPlayerEvent(18, ReloadTalker)

tested with TC2 Ace Core 3.3.5a Eluna.
also even in death he cant keep his mouth shut lol.
 
Last edited:

slp13at420

Mad Scientist
So i added the on_died event function to remove the timed event and then I was looking it over and decided to add the ability to do random yells(changed it from say to yell). you just expand on the existing table `ANN`(its key'd with the npc id.). I DONT recommend using this on mobs it WILL cause lag. but for those who wonder ,, yes the mobs will individually yell random ANNouncement's . Cuz I tested it on mobs just too see also lol.

so then I just added it to my github page:

>> Yelling NPC <<

All credits to [MENTION=6]Rochet2[/MENTION] for the script.
Credits to [MENTION=717]slp13at420[/MENTION] for the modz.

and well then I had to mod it some more ... now you can set the announcement to be yelled or said .
 
Last edited:

Xaver

Respected Member
ok you latest post ist work perfekt.

but have question emm can you remofe the funktion selection ??

wen i´m say load talker the script load ??

thanks
 

slp13at420

Mad Scientist
im not sure if it can be done without selecting the creature ... but I will do some testing tonite after work and see if I can get it to apply some other way.
 
Status
Not open for further replies.
Top