[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
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?
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
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 )
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
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
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
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
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...
Archived author: Tea • Posted: 2023-10-24T10:12:05.269000+00:00
Original source
they can be if thats what you want
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