[DiscordArchive] Mind if you show me how you did it?
[DiscordArchive] Mind if you show me how you did it?
Archived author: Dioxain • Posted: 2025-08-06T00:47:12.616000+00:00
Original source
Mind if you show me how you did it?
![[Image: image.png?ex=690bf04d&is=690a9ecd&hm=42e...c130229e9&]](https://cdn.discordapp.com/attachments/1255602330431127753/1402453175251894382/image.png?ex=690bf04d&is=690a9ecd&hm=42e0d53f92e7ece80d5e6a44226741c7f98b671663873684d708082c130229e9&)
Archived author: Dioxain • Posted: 2025-08-06T00:48:13.349000+00:00
Original source
I know how to add a new gossip menu option for the database, but I haven't a clue about "spell cast smart script"
![[Image: image.png?ex=690bf04d&is=690a9ecd&hm=42e...c130229e9&]](https://cdn.discordapp.com/attachments/1255602330431127753/1402453175251894382/image.png?ex=690bf04d&is=690a9ecd&hm=42e0d53f92e7ece80d5e6a44226741c7f98b671663873684d708082c130229e9&)
Archived author: Mithria • Posted: 2025-08-06T00:50:05.600000+00:00
Original source
the only issue is you'd have to attach the script to every barber in the game individually so it'd be a fair bit of them
Archived author: Dioxain • Posted: 2025-08-06T00:50:25.943000+00:00
Original source
fine by me 
Archived author: Mithria • Posted: 2025-08-06T00:56:57.391000+00:00
Original source
in the smart_scripts table, you have to add a script for the creature you're adding this to
`entryorguid` = the entry of the creature you're adding this to
`source_type` = 0 (this means its a creature)
`event_type` = 62 (this is on gossip select)
`event_param1` = 9781 (this is barber gossip id)
`event_param2` = 0 (this is your gossip optionID)
`action_type` = 11 (this is cast spell)
`action_param1` = spell id of spell that will be cast
`action_param2` = 2 (this means triggered spell)
`target_type` = 7 (this means invoker, or the one who caused this event to occur)
you also have to change the npc's AIName in creature_template to SmartAI so it will use the smart scripts table
Archived author: Mithria • Posted: 2025-08-06T00:57:21.729000+00:00
Original source
then you make the spell that will be cast in spell_dbc, and attach a spell script to it that you code in c++
Archived author: Mithria • Posted: 2025-08-06T00:59:01.635000+00:00
Original source
i also recommend adding another gossip menu with text explaining what just happened and adding that menu id to the ActionMenuID field for the gossip_menu_option you made, that way it will run the smart script on option select, and display a gossip page that explains to the player that they are flagged for a recustomization
Archived author: Mithria • Posted: 2025-08-06T00:59:03.081000+00:00
Original source
or something
Archived author: Mithria • Posted: 2025-08-06T00:59:19.272000+00:00
Original source
i gtg to the store but you can ask me whatever and i'll get back to you
Archived author: Dioxain • Posted: 2025-08-06T01:03:07.172000+00:00
Original source
blimey o.o I'm going to have to document that extensively in my code or else I'll have no idea coming back to it months later xD