GetData64 Problem

Hello Guys! I’m trying to add an instance, but i keep getting the following errors:

if (Creature * NetherScion = instance->GetCreature(GetData64(NPC_NETHER_SCION)))
ERROR: 12 IntelliSense: no suitable constructor exists to convert from “uint64” to “ObjectGuid”

creature->RemoveAura(creature->GetAura(8611,GetData64(guid)));
ERROR[COLOR=rgb(255,0,0)]: Error 10 error C2664: ‘Aura *Unit::GetAura(uint32,ObjectGuid,ObjectGuid,uint8) const’ : cannot convert argument 2 from ‘uint32’ to ‘ObjectGuid’

Creature * creature = instance->GetCreature(GetData64(guid));
ERROR[COLOR=rgb(255,0,0)]: Error 9 error C2664: ‘Creature *Map::GetCreature(ObjectGuid)’ : cannot convert argument 1 from ‘uint32’ to ‘ObjectGuid’

uint64 GetGuidData(uint32 type)
ERROR[COLOR=rgb(255,0,0)]: Error 3 error C4263: ‘uint32 instance_the_bastion_of_twilight::instance_the_bastion_of_twilight_InstanceMapScript::GetGuidData(uint32)’ : member function does not override any base class virtual member function

If anyone can help me fix this errors and explain me what’s wrong, please do it. I’m a newbie and I just wanna learn. Thanks!

Seems like you’re using outdated functions (we are now using ObjectGuid to store guids rather than uint64). You can check recently changed instance scripts for examples on how it’d look like.

http://collab.kpsn.org/display/tc/API+Changes

Thanks guys for your answers.

This is what I’ve don so for from that link, but I couldn’t get the script working.

http://pastebin.com/nrG476X5

Please tell me what’s wrong, or edit it I’ll figure it out what was wrong.

As I said, you’re using uint64 to store creature guids when you should use ObjectGuid instead.

These should be changed from uint64 to ObjectGuid (the ones that are actual creature guids, just a glance over the code, didn’t look in depth)

  1. private:[/li][li] uint64 uiWyrmbreaker;[/li][li] uint64 uiValiona;[/li][li] uint64 uiTheralion;[/li][li] uint64 uiFeludius;[/li][li] uint64 uiArion;[/li][li] uint64 uiIgnacious;[/li][li] uint64 uiTerrastra;[/li][li] uint64 uiMonstrosity;[/li][li] uint64 uiChogall;[/li][li] uint64 uiSinestra;[/li][li] uint64 uiSlateDrake;[/li][li] uint64 uiStormRider;[/li][li] uint64 uiNetherScion;[/li][li] uint64 uiProtoBehemoth;[/li][li] uint64 uiTimeWarden;[/li][li] uint64 uiCyclonWinds;

So, I’ve done everything I could, but I still have 4 errors:

Error 1 error C4263: 'ObjectGuid instance_the_bastion_of_twilight::instance_the_bastion_of_twilight_InstanceMapScript::GetData64(uint32)' : member function does not override any base class virtual member function Error 3 error C4263: 'ObjectGuid instance_the_bastion_of_twilight::instance_the_bastion_of_twilight_InstanceMapScript::GetGuidData(uint32)' : member function does not override any base class virtual member function Error 4 error C4264: 'ObjectGuid InstanceScript::GetGuidData(uint32) const' : no override available for virtual member function from base 'InstanceScript'; function is hidden C:UsersENJATZDesktopWOW SVBuildsrcserverscriptsscripts.dirinstance_bastion_of_twilight.cpp Error 2 error C4264: 'uint64 ZoneScript::GetData64(uint32) const' : no override available for virtual member function from base 'ZoneScript'; function is hidden C:UsersENJATZDesktopWOW SVBuildsrcserverscriptsscripts.dirinstance_bastion_of_twilight.cpp

[CODE]
ObjectGuid GetData64(uint32 type)
{
switch (type)
{
case DATA_WYRMBREAKER: return uiWyrmbreaker;
case DATA_VALIONA: return uiValiona;
case DATA_THERALION: return uiTheralion;
case DATA_FELUDIUS: return uiFeludius;
case DATA_IGNACIOUS: return uiIgnacious;
case DATA_ARION: return uiArion;
case DATA_TERRASTRA: return uiTerrastra;
case DATA_MONSTROSITY: return uiMonstrosity;
case DATA_CHOGALL: return uiChogall;
case DATA_SINESTRA: return uiSinestra;
case DATA_HB_VALIONA_THERALION: return uiValionaTheralionHealth;
case NPC_SLATE_DRAKE: return uiSlateDrake;
case NPC_STORM_RIDER: return uiStormRider;
case NPC_NETHER_SCION: return uiNetherScion;
case NPC_TIME_WARDEN: return uiTimeWarden;
case NPC_PROTO_BEHEMOTH: return uiProtoBehemoth;
case NPC_CYCLON_WIND: return uiCyclonWinds;
}

return ObjectGuid::Empty;

}[/CODE]

[CODE]
ObjectGuid GetGuidData(uint32 type)
{
switch (type)
{
case DATA_WYRMBREAKER_EVENT: return uiEncounter[0];
case DATA_VALIONA_THERALION_EVENT: return uiEncounter[1];
case DATA_COUNCIL_EVENT: return uiEncounter[2];
case DATA_CHOGALL_EVENT: return uiEncounter[3];
case DATA_SINESTRA_EVENT: return uiEncounter[4];
case DATA_ASCENDANT_PHASE: return uiAscendantCouncilPhase;
case DATA_ASCENDANT_MONSTROSITY_LIVE: return uiAscentMonstrosityHealth;
}

return ObjectGuid::Empty;
}[/CODE]

The problem now is that GetData64() should not be touched, it’s expected to return an uint64, so don’t change it to ObjectGuid. Do not use GetData64() to access creature guids, use GetGuidData() instead.

You can find many examples on how it should look like all over our repo, for example: https://github.com/TrinityCore/TrinityCore/blob/6.x/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp#L706-L772

As for this:

ObjectGuid GetGuidData(uint32 type)
{
switch (type)
{
case DATA_WYRMBREAKER_EVENT: return uiEncounter[0];
case DATA_VALIONA_THERALION_EVENT: return uiEncounter[1];
case DATA_COUNCIL_EVENT: return uiEncounter[2];
case DATA_CHOGALL_EVENT: return uiEncounter[3];
case DATA_SINESTRA_EVENT: return uiEncounter[4];
case DATA_ASCENDANT_PHASE: return uiAscendantCouncilPhase;
case DATA_ASCENDANT_MONSTROSITY_LIVE: return uiAscentMonstrosityHealth;
}

return ObjectGuid::Empty;
}

[COLOR=rgb(102,102,0)]SetBossState() is the method you’re looking for /emoticons/default_tongue.png

I’ve change back GetData64 to: uint64 GetData64(uint32 type), but the error perssists, and I get another 4 errors:

72 IntelliSense: no suitable constructor exists to convert from "uint64" to "ObjectGuid"

You’re passing uint64 into functions that expect ObjectGuid (don’t store or access guids as uint64).

Ok, but those 4 errors still perrsists, what can I do?

Anyone please?

Could you send a copy of your script after the changes?

Here: http://pastebin.com/xbEkzhTq

I can’t find the line where your latest error occurs. Could you quote which errors persist exactly?

  1. No header file, adding abstract enums for all those wayward definition errors.

  2. You mis-spelled BOSS_SINESTRA as BOSS_SINESRTA. Line 139.

  3. GetData64 is supposed to return an integer. The functions you are using are requiring an ObjectGuid. I’m not keen on investigating too much into this at 1 o’ clock in the morning, but you are misusing GetData64. I have never touched an instance script but from the looks of things I am confident you do not need it.

  4. So get rid of GetData64, and add ’ const override’ after ‘ObjectGuid GetGuidData(uint32 type)’. You can now compile again after you fixed the calls to GetData64, you can figure it out from here.