Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] Hello, I have a specific code for a game command. I want to implement the following: A player enters

[DiscordArchive] Hello, I have a specific code for a game command. I want to implement the following: A player enters

[DiscordArchive] Hello, I have a specific code for a game command. I want to implement the following: A player enters

rektbyfaith
Administrator
0
10-24-2023, 09:43 AM
#1
Archived author: Elf_DEV • Posted: 2023-10-24T09:43:57.145000+00:00
Original source

Hello, I have a specific code for a game command. I want to implement the following: A player enters a command, after that a series of code should be executed every 3 seconds. How can this be implemented? Can I have an example please?
rektbyfaith
10-24-2023, 09:43 AM #1

Archived author: Elf_DEV • Posted: 2023-10-24T09:43:57.145000+00:00
Original source

Hello, I have a specific code for a game command. I want to implement the following: A player enters a command, after that a series of code should be executed every 3 seconds. How can this be implemented? Can I have an example please?

rektbyfaith
Administrator
0
10-24-2023, 09:44 AM
#2
Archived author: ModoX • Posted: 2023-10-24T09:44:28.183000+00:00
Original source

apply custom aura via command, let aura tick periodically every 3s and then do stuff
rektbyfaith
10-24-2023, 09:44 AM #2

Archived author: ModoX • Posted: 2023-10-24T09:44:28.183000+00:00
Original source

apply custom aura via command, let aura tick periodically every 3s and then do stuff

rektbyfaith
Administrator
0
10-24-2023, 09:48 AM
#3
Archived author: Elf_DEV • Posted: 2023-10-24T09:48:17.221000+00:00
Original source

Auras are short-lived as far as I know, but I need the repetition to happen all the time until the target dies.

I need this for the implementation of roll combat.

I have the command ".attack"

It handles the player's attack on the NPC. After the attack of the player NPC follows the player and I need that while the NPC is alive he every three seconds attacked the player ( According to the battle system is to generate random numbers of defense and damage, then in case if the defense is less than the number of attack to remove the player's health )
rektbyfaith
10-24-2023, 09:48 AM #3

Archived author: Elf_DEV • Posted: 2023-10-24T09:48:17.221000+00:00
Original source

Auras are short-lived as far as I know, but I need the repetition to happen all the time until the target dies.

I need this for the implementation of roll combat.

I have the command ".attack"

It handles the player's attack on the NPC. After the attack of the player NPC follows the player and I need that while the NPC is alive he every three seconds attacked the player ( According to the battle system is to generate random numbers of defense and damage, then in case if the defense is less than the number of attack to remove the player's health )

rektbyfaith
Administrator
0
10-24-2023, 09:54 AM
#4
Archived author: ModoX • Posted: 2023-10-24T09:54:55.671000+00:00
Original source

then you can just do it in npc ai, even easier
rektbyfaith
10-24-2023, 09:54 AM #4

Archived author: ModoX • Posted: 2023-10-24T09:54:55.671000+00:00
Original source

then you can just do it in npc ai, even easier

rektbyfaith
Administrator
0
10-24-2023, 09:56 AM
#5
Archived author: ModoX • Posted: 2023-10-24T09:56:29.556000+00:00
Original source

on command, access nearby npc (or summon it, w/e), then `creature->AI()->DoAction(use some cool id here)`
in the related creature script you then implement the method `DoAction`. There you could use a TaskScheduler to schedule something every 3s and repeat it every 3s.
Then you also gotta implement `UpdateAI` to update the TaskScheduler every tick
rektbyfaith
10-24-2023, 09:56 AM #5

Archived author: ModoX • Posted: 2023-10-24T09:56:29.556000+00:00
Original source

on command, access nearby npc (or summon it, w/e), then `creature->AI()->DoAction(use some cool id here)`
in the related creature script you then implement the method `DoAction`. There you could use a TaskScheduler to schedule something every 3s and repeat it every 3s.
Then you also gotta implement `UpdateAI` to update the TaskScheduler every tick

rektbyfaith
Administrator
0
10-24-2023, 10:03 AM
#6
Archived author: Tea • Posted: 2023-10-24T10:03:35.825000+00:00
Original source

auras arent short lived, why do you think that? give it infinite duration
rektbyfaith
10-24-2023, 10:03 AM #6

Archived author: Tea • Posted: 2023-10-24T10:03:35.825000+00:00
Original source

auras arent short lived, why do you think that? give it infinite duration

rektbyfaith
Administrator
0
10-24-2023, 10:03 AM
#7
Archived author: Elf_DEV • Posted: 2023-10-24T10:03:49.896000+00:00
Original source

In general, I understood a little, thanks, but I am new to Trinity Core, I would like to clarify. I write ```Creature->AI()->DoAction(Attack)``` in the script for processing the command itself, and then write the processing of the identifier itself and write the attack identifier itself in another script? If yes, then more specifically in what
rektbyfaith
10-24-2023, 10:03 AM #7

Archived author: Elf_DEV • Posted: 2023-10-24T10:03:49.896000+00:00
Original source

In general, I understood a little, thanks, but I am new to Trinity Core, I would like to clarify. I write ```Creature->AI()->DoAction(Attack)``` in the script for processing the command itself, and then write the processing of the identifier itself and write the attack identifier itself in another script? If yes, then more specifically in what

rektbyfaith
Administrator
0
10-24-2023, 10:05 AM
#8
Archived author: Elf_DEV • Posted: 2023-10-24T10:05:17.936000+00:00
Original source

I'm new to Trinity Core development, so I could be wrong...
rektbyfaith
10-24-2023, 10:05 AM #8

Archived author: Elf_DEV • Posted: 2023-10-24T10:05:17.936000+00:00
Original source

I'm new to Trinity Core development, so I could be wrong...

rektbyfaith
Administrator
0
10-24-2023, 10:12 AM
#9
Archived author: Tea • Posted: 2023-10-24T10:12:05.269000+00:00
Original source

they can be if thats what you want
rektbyfaith
10-24-2023, 10:12 AM #9

Archived author: Tea • Posted: 2023-10-24T10:12:05.269000+00:00
Original source

they can be if thats what you want

rektbyfaith
Administrator
0
10-24-2023, 10:13 AM
#10
Archived author: Tea • Posted: 2023-10-24T10:13:22.335000+00:00
Original source

but for a new person writing a simple creature script is easier than making a custom spell and then scripting that
rektbyfaith
10-24-2023, 10:13 AM #10

Archived author: Tea • Posted: 2023-10-24T10:13:22.335000+00:00
Original source

but for a new person writing a simple creature script is easier than making a custom spell and then scripting that

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)