Hey guys !
I’m working on a new instance, I did the instance script and the main script.
When I try to access to a boss with GetGuidData the function doesn’t return anything.
Here the code I made :
void OnCreatureCreate(Creature* creature) override
{
switch (creature->GetEntry())
{
case NPC_NETRISTRASZA:
netristraszaGUID = creature->GetGUID();
break;
case NPC_ANTONN_GRAVE:
antonnGUID = creature->GetGUID();
break;
default:
break;
}
}
ObjectGuid GetGuidData(uint32 type) const override
{
switch (type)
{
case DATA_NETRISTRASZA:
return netristraszaGUID;
case DATA_ANTONN_GRAVE:
return antonnGUID;
default:
break;
}
return ObjectGuid::Empty;
}
And when I try to access DATA_ANTONN_GRAVE :
if (Creature* antonn = _instance->GetCreature(_instance->GetGuidData(DATA_ANTONN_GRAVE)))
antonn->AI()->Talk(SAY_ANTONN_GRAVE_01);
I’m open to any suggestions!
Thanks
[SIZE=16px]EDIT : I resolved my issue by using ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_ANTONN_GRAVE))).[/SIZE]
[SIZE=16px]Actually the _objectGuids list in InstanceScript is empty, don’t know why.[/SIZE]