Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] Hi guys is there any existing script for worldboss announce when someone kills it and when he respaw

[DiscordArchive] Hi guys is there any existing script for worldboss announce when someone kills it and when he respaw

[DiscordArchive] Hi guys is there any existing script for worldboss announce when someone kills it and when he respaw

Pages (3): Previous 1 2 3 Next
rektbyfaith
Administrator
0
02-02-2024, 08:24 PM
#11
Archived author: iThorgrim • Posted: 2024-02-02T20:24:11.680000+00:00
Original source

```lua
local Constant = {
creature_entry = 13245,
creature_timer = 300, -- 5 minutes in seconds

messages = {
on_death = "Yes WorldBoss is down!",
on_respawn = "OMG ! The Worldboss is ready to fight!"
}
}

local function handleEvent(_, _, _, is_died)
local msg = is_died and Constant.messages.on_death or Constant.messages.on_respawn
SendWorldMessage(msg)
end

local function OnPlayerKillCreature(event, player, creature)
local entry = creature:GetEntry()
if ( entry == Constant.creature_entry) then
handleEvent(_, _, _, true)
CreateLuaEvent(handleRespawn, Constant.creature_timer * 1000)
end
end
RegisterPlayerEvent(6, OnPlayerKillCreature)
```
rektbyfaith
02-02-2024, 08:24 PM #11

Archived author: iThorgrim • Posted: 2024-02-02T20:24:11.680000+00:00
Original source

```lua
local Constant = {
creature_entry = 13245,
creature_timer = 300, -- 5 minutes in seconds

messages = {
on_death = "Yes WorldBoss is down!",
on_respawn = "OMG ! The Worldboss is ready to fight!"
}
}

local function handleEvent(_, _, _, is_died)
local msg = is_died and Constant.messages.on_death or Constant.messages.on_respawn
SendWorldMessage(msg)
end

local function OnPlayerKillCreature(event, player, creature)
local entry = creature:GetEntry()
if ( entry == Constant.creature_entry) then
handleEvent(_, _, _, true)
CreateLuaEvent(handleRespawn, Constant.creature_timer * 1000)
end
end
RegisterPlayerEvent(6, OnPlayerKillCreature)
```

rektbyfaith
Administrator
0
02-02-2024, 08:26 PM
#12
Archived author: cyberpro98 • Posted: 2024-02-02T20:26:24.997000+00:00
Original source

So here is RegisterPlayerEvent(6, OnPlayerKillCreature) So that is an event ?
rektbyfaith
02-02-2024, 08:26 PM #12

Archived author: cyberpro98 • Posted: 2024-02-02T20:26:24.997000+00:00
Original source

So here is RegisterPlayerEvent(6, OnPlayerKillCreature) So that is an event ?

rektbyfaith
Administrator
0
02-02-2024, 08:26 PM
#13
Archived author: iThorgrim • Posted: 2024-02-02T20:26:40.847000+00:00
Original source

Yes and no but yes
rektbyfaith
02-02-2024, 08:26 PM #13

Archived author: iThorgrim • Posted: 2024-02-02T20:26:40.847000+00:00
Original source

Yes and no but yes

rektbyfaith
Administrator
0
02-02-2024, 08:26 PM
#14
Archived author: cyberpro98 • Posted: 2024-02-02T20:26:50.755000+00:00
Original source

haha okay
rektbyfaith
02-02-2024, 08:26 PM #14

Archived author: cyberpro98 • Posted: 2024-02-02T20:26:50.755000+00:00
Original source

haha okay

rektbyfaith
Administrator
0
02-02-2024, 08:27 PM
#15
Archived author: Honey • Posted: 2024-02-02T20:27:06.307000+00:00
Original source

<https://www.azerothcore.org/pages/eluna/Global/RegisterPlayerEvent.html>
Here's the list.
rektbyfaith
02-02-2024, 08:27 PM #15

Archived author: Honey • Posted: 2024-02-02T20:27:06.307000+00:00
Original source

<https://www.azerothcore.org/pages/eluna/Global/RegisterPlayerEvent.html>
Here's the list.

rektbyfaith
Administrator
0
02-02-2024, 08:28 PM
#16
Archived author: cyberpro98 • Posted: 2024-02-02T20:28:42.296000+00:00
Original source

hmmm ok
rektbyfaith
02-02-2024, 08:28 PM #16

Archived author: cyberpro98 • Posted: 2024-02-02T20:28:42.296000+00:00
Original source

hmmm ok

rektbyfaith
Administrator
0
02-02-2024, 08:29 PM
#17
Archived author: iThorgrim • Posted: 2024-02-02T20:29:33.396000+00:00
Original source

To function, Eluna needs to listen to the events taking place in the game, and the RegisterPlayerEvent(6, ...) listens when the player kills a creature. Every time you or your players kill a creature, the Lua script will check whether the one you want.

If so, it will simply send your message and then create an event that will be launched 5 minutes later to say that your creature has respawned.
rektbyfaith
02-02-2024, 08:29 PM #17

Archived author: iThorgrim • Posted: 2024-02-02T20:29:33.396000+00:00
Original source

To function, Eluna needs to listen to the events taking place in the game, and the RegisterPlayerEvent(6, ...) listens when the player kills a creature. Every time you or your players kill a creature, the Lua script will check whether the one you want.

If so, it will simply send your message and then create an event that will be launched 5 minutes later to say that your creature has respawned.

rektbyfaith
Administrator
0
02-02-2024, 08:32 PM
#18
Archived author: cyberpro98 • Posted: 2024-02-02T20:32:32.882000+00:00
Original source

okay
rektbyfaith
02-02-2024, 08:32 PM #18

Archived author: cyberpro98 • Posted: 2024-02-02T20:32:32.882000+00:00
Original source

okay

rektbyfaith
Administrator
0
02-02-2024, 08:32 PM
#19
Archived author: cyberpro98 • Posted: 2024-02-02T20:32:36.551000+00:00
Original source

i will try it
rektbyfaith
02-02-2024, 08:32 PM #19

Archived author: cyberpro98 • Posted: 2024-02-02T20:32:36.551000+00:00
Original source

i will try it

rektbyfaith
Administrator
0
02-02-2024, 08:33 PM
#20
Archived author: iThorgrim • Posted: 2024-02-02T20:33:50.757000+00:00
Original source

Beware: this is just a different way of doing what you want to do, and can involve a lot of calculation for nothing, as it will make the comparison whether your player kills a Rabbit, a Wolf, a Kobold or your WorldBoss. In any case, the script will have to compare the id of the creature killed with the one you're waiting for.
rektbyfaith
02-02-2024, 08:33 PM #20

Archived author: iThorgrim • Posted: 2024-02-02T20:33:50.757000+00:00
Original source

Beware: this is just a different way of doing what you want to do, and can involve a lot of calculation for nothing, as it will make the comparison whether your player kills a Rabbit, a Wolf, a Kobold or your WorldBoss. In any case, the script will have to compare the id of the creature killed with the one you're waiting for.

Pages (3): Previous 1 2 3 Next
Recently Browsing
 
Recently Browsing