void EnterCombat(Unit* /who/) override
{
Talk(0);
instance->SetBossState(0, IN_PROGRESS);
}But when i enter combat with that npc, the server is crashing.
Why is that? Sorry if i do something wrong but i am completely new to TrinityCore’s api.
if you don’t use Visual Studio as IDE then read an article about how to debug using the IDE of your choice (and if you are not using one either then you need to pick up one)
I don’t understand why to debug something so simple.
Because you dont know why it crashes and neither do we - until you/we test ourselves and read the crashlog or debug.
Debugging and crash logs are only avaliable with debuggers or debug compiles, so you have to debug compile at minimum.
Getting a crashlog on windows requires compiling in debug and on linux it requires using the gdb debugger in the way said in the link I sent.
Any fix suggestions are exactly that. suggestions. They are guesses at what might be wrong with your code. And do note that all suggestions so far have not been helping according to your statements.
By debugging or creating a crash log (basically debug call stack to point of crash) you can show us what exactly goes wrong and why and better yet you can see yourself. (debugging is better than logs)
nothing is simple -
Do you know if it is the Talk or the SetBossState crashing?
Do you know what in SetBossState crashes? Is instance null or is it something going wrong inside the SetBossState function?
Could be the error is in your instance script and not in the code you show here at all.
Ok call me the biggest c++ noob in the world but do i need a instance script for this to work? Because i don’t have one. Please don’t blame me for waste your time.
SetBossState is an InstanceScript method and instance for BossAI is NULL on non instance maps and maps that dont have an instance script from what I can see.