[DiscordArchive] So 6018 is Ur'Kyo, one of the many priest trainers... what if I changed his gossip_menu_id to that o
[DiscordArchive] So 6018 is Ur'Kyo, one of the many priest trainers... what if I changed his gossip_menu_id to that o
Archived author: Agent • Posted: 2024-09-28T14:47:58.851000+00:00
Original source
I was hoping this would be a simple DBC or source edit, I'm loathe to learn module creation
Archived author: sudlud • Posted: 2024-09-28T14:48:06.519000+00:00
Original source
```
// Add player scripts
class MyPlayer : public PlayerScript
{
public:
MyPlayer() : PlayerScript("MyPlayer") { }
void OnLogin(Player* player) override
{
if (sConfigMgr->GetOption<bool>("MyModule.Enable", false))
{
ChatHandler(player->GetSession()).PSendSysMessage(HELLO_WORLD);
}
}
};
```
that's the default script there, just sending a hello world
Archived author: sudlud • Posted: 2024-09-28T14:48:22.711000+00:00
Original source
it's not complicated, really
Archived author: Agent • Posted: 2024-09-28T14:49:46.749000+00:00
Original source
Oh it's just that the whole methodology of programming has changed since I was in the game 30 years ago. I don't even understand modern lingo, what is a hook I assume it's an event catcher like onlogin or onmapload etc
Archived author: sudlud • Posted: 2024-09-28T14:49:49.109000+00:00
Original source
then e.g. add this
Archived author: sudlud • Posted: 2024-09-28T14:49:52.661000+00:00
Original source
```
Optional<bool> OnPlayerIsClass(Player const* /*player*/, Classes /*playerClass*/, ClassContext context)
{
if (context == CLASS_CONTEXT_CLASS_TRAINER)
return true;
return std::nullopt;
}
```
Archived author: sudlud • Posted: 2024-09-28T14:50:23.069000+00:00
Original source
yeah
Archived author: sudlud • Posted: 2024-09-28T14:50:52.517000+00:00
Original source
an option to introduce your own functionality without directly editing the core itself
Archived author: Agent • Posted: 2024-09-28T14:51:22.233000+00:00
Original source
What if I don't mind directly editing the core? I feel that would be more straightforward for an old dog like me on such a simple mission to make trainers talk to me
Archived author: sudlud • Posted: 2024-09-28T14:51:40.617000+00:00
Original source
sure, but with a module updating the core usually has zero issues