azerothcore / azerothcore-wotlk

Complete Open Source and Modular solution for MMO
http://www.azerothcore.org
GNU Affero General Public License v3.0
6.2k stars 2.47k forks source link

No implementation for dynamic charmed spell cooldowns. #19187

Open heyitsbench opened 1 week ago

heyitsbench commented 1 week ago

Current Behaviour

Currently mind controlled/charmed creatures have either no cooldowns on their spells or they are enforced through spell_cooldown_overrides, acting as a SpellInfoCorrections table specifically for charmed spell cooldowns. Because of this, and the current structure of the aforementioned table, the cooldowns are restricted to a single cooldown time.

Expected Blizzlike Behaviour

As I said in a comment:

To my understanding, the way cooldowns work for creatures and their spells follows like this: A creature has a spell list (can be seen here and here). That is used for its general combat AI, and when charmed, the cooldown is determined by this spell list.

For example, an uncharmed Defias Pillager casts Fireball. Upon casting, it then gets a cooldown for when it will cast next, say min is 10s, max is 20s, and it rolls a 14s cooldown. It then can't use that spell for 14s (not necessarily that it will cast in 14s, just that it is a cooldown). It works pretty much the same way when the creature is charmed, so the pillager while charmed is commanded to cast fireball, and it rolls a 16s cooldown, that means the creature cannot be commanded to cast fireball again for 16s.

As for what these cooldowns would be if the player character itself cast these spells with no cooldown, that we cannot know unless something goes quite wrong on Blizzard's end.

Source

WoWEdit screenshots, Wrath Classic, conversations with other, smarter people

Steps to reproduce the problem

  1. Charm a Defias Pillager.
  2. Cast Fireball.
  3. Observe its cooldown.

Extra Notes

No response

AC rev. hash/commit

c9725dd4b2b06b5fcf00d297a0578e8ad73bf03a

Operating system

Windows 10 x64

Custom changes or Modules

mod-ptr-template

Kitzunu commented 1 week ago

Also rename spell_cooldown_overrides to properly "limit" the use to creature mc spells

heyitsbench commented 1 week ago

Well the "correct" solution would be to tie it into SmartAI or something like it and not use a separate table, seeing as that seems to be what Blizz did. Obviously would require a lot of research/data entry though.

Kitzunu commented 1 week ago

SAI not that good though yikes

avarishd commented 1 week ago

Wouldn't having that in creature_template_spell be better? As it's right next to the given spell(s) in question.

Gultask commented 3 days ago

SAI not optimal I think, as Blizz seemed to use a different system for creature spells. In very old screenshots they used initial and repeat timers like SAI but later they seemed to move to a frequency + cooldown based system without explicit timers, so there'd not be any upper limit to timers.

As for creature_template_spell I don't think so because it's a sniffed table, and if it had timers we'd see them.

heyitsbench commented 3 days ago

In very old screenshots they used initial and repeat timers like SAI but later they seemed to move to a frequency + cooldown based system without explicit timers

I believe it's the other way around. You can see that this screenshot (I believe taken during some Blizzcon) a window appearance of either Windows Vista or Windows 7 and includes min/max timers. In this screenshot (Iirc taken from the WoW Diary by John Staats), you can see an appearance of I believe some Windows 9x variant, and it includes frequency values.

Nyeriah commented 3 days ago

You can’t tie it to SAI because creatures don’t use SAI alone, they can also use other scripting engines