[DiscordArchive] Custom spell and item cooldown
[DiscordArchive] Custom spell and item cooldown
Archived author: Needle • Posted: 2025-07-03T13:58:55.277000+00:00
Original source
Archived author: Needle • Posted: 2025-07-03T13:58:56.201000+00:00
Original source
Thread automatically created by hoodie in <#415944535718494208>
Archived author: hoodie • Posted: 2025-07-03T13:59:16.611000+00:00
Original source
Here are the steps of what I did:
- Using WoW Spell Editor, duplicate Hearthstone into a new spell ID 966559. "Category recovery time" set to 0, and "recovery time" set to 1800000 (30 mins). Generate Spell.dbc and replace it on server and client.
- insert into `item_template`: Using Keira editor, create a new Dalaran Hearthstone item ID 966559, tied to spell 966559 created before. Reuse a display ID of some other item with a different icon (using 48007)
- insert into `spell_script_names`, tying spell 966559 to spell script `dalaran_hearthstone` below
- Add a new module with the following loader
```
void AddSC_spell_dalaran_hs();
void Addmod_dalaran_hearthstoneScripts()
{
AddSC_spell_dalaran_hs();
}
```
- And the following spell script:
```
#include "SpellMgr.h"
#include "AreaDefines.h"
#include "Player.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "ObjectAccessor.h"
class spell_dalaran_hs : public SpellScriptLoader
{
public:
spell_dalaran_hs() : SpellScriptLoader("dalaran_hearthstone") { }
class spell_dalaran_hs_SpellScript : public SpellScript
{
PrepareSpellScript(spell_dalaran_hs_SpellScript);
void HandleAfterCast()
{
if (Unit* caster = GetCaster())
{
Player* player = caster->ToPlayer();
player->TeleportTo(MAP_NORTHREND, 5851.55, 636.693, 647.513, player->GetOrientation());
}
}
void Register() override
{
AfterCast += SpellCastFn(spell_dalaran_hs_SpellScript::HandleAfterCast);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_dalaran_hs_SpellScript();
}
};
void AddSC_spell_dalaran_hs()
{
new spell_dalaran_hs();
}
```
- Recompile, restart, delete Cache folder on the client, start game:
- `.additem 966559 1` works ok and can be used (icon didn't work though) but has the cooldown issues I mentioned above
Archived author: robinsch • Posted: 2025-07-03T14:01:00.844000+00:00
Original source
Item spell cooldowns are limited to uint16
Archived author: Rymercyble • Posted: 2025-07-03T14:03:28.909000+00:00
Original source
dont items have cooldown too ?
![[Image: 2025-07-03-10-05-34.png?ex=690cabda&is=6...e627761b3&]](https://cdn.discordapp.com/attachments/1390330972041379960/1390333367727161595/2025-07-03-10-05-34.png?ex=690cabda&is=690b5a5a&hm=5ba2bf89779a02b1776657c5b86132173d2d6c84c1c5fdfda99b694e627761b3&)
Archived author: hoodie • Posted: 2025-07-03T14:08:26.115000+00:00
Original source
There is a cooldown field for the item, but description says that it can be left blank and it would use the spell cooldown. I tried to set the cooldown there on the item too but same result
![[Image: 2025-07-03-10-05-34.png?ex=690cabda&is=6...e627761b3&]](https://cdn.discordapp.com/attachments/1390330972041379960/1390333367727161595/2025-07-03-10-05-34.png?ex=690cabda&is=690b5a5a&hm=5ba2bf89779a02b1776657c5b86132173d2d6c84c1c5fdfda99b694e627761b3&)
Archived author: robinsch • Posted: 2025-07-03T14:09:07.218000+00:00
Original source
just lower your spell ID below uint16
Archived author: hoodie • Posted: 2025-07-03T14:09:20.227000+00:00
Original source
Thanks! I will try that
![[Image: 2025-07-03-11-00-44.png?ex=690c1018&is=6...876210f52&]](https://cdn.discordapp.com/attachments/1390330972041379960/1390347318641033216/2025-07-03-11-00-44.png?ex=690c1018&is=690abe98&hm=57694ed66b77444813de0c2b9f7ae743d240cd9a48add22902c79f5876210f52&)
Archived author: hoodie • Posted: 2025-07-03T15:03:52.224000+00:00
Original source
It worked! You guys are incredible.
I'll try to figure out why the icon isn't working
![[Image: 2025-07-03-11-00-44.png?ex=690c1018&is=6...876210f52&]](https://cdn.discordapp.com/attachments/1390330972041379960/1390347318641033216/2025-07-03-11-00-44.png?ex=690c1018&is=690abe98&hm=57694ed66b77444813de0c2b9f7ae743d240cd9a48add22902c79f5876210f52&)
Archived author: Jyria • Posted: 2025-07-03T15:58:38.490000+00:00
Original source
Item.dbc for the client