Jump to content

question about guids


Guest DasBlub

Recommended Posts

hi all, i've a question about the GUIDs which are used.

there is the function Unit::GetUnit(WorldObject& object, uint64 guid), this function can return either a player, a creature or a pet. all three are only identified by the guid. but we have remarked on our server, that there is for example both, a player with the guid 11 AND a creature with the guid 11. so the guid doesn't seems to be unique...

so my question is, is this a bug, or not? and if not, how is it then "unique", when two units have the same guid?

Link to comment
Share on other sites

a player with the guid 11 AND a creature with the guid 11.
Are you sure you were not looking at the lower 32 bits of the GUID instead of the full ? A full creature GUID cannot be 11 because its highguid is 0xF130 so the smallest value is 265188460724224. In debug output only the low part of the guid is shown usually so you can have a creature and a player with the same, that's not a problem.
Link to comment
Share on other sites

hi all, i've a question about the GUIDs which are used.

there is the function Unit::GetUnit(WorldObject& object, uint64 guid), this function can return either a player, a creature or a pet. all three are only identified by the guid. but we have remarked on our server, that there is for example both, a player with the guid 11 AND a creature with the guid 11. so the guid doesn't seems to be unique...

so my question is, is this a bug, or not? and if not, how is it then "unique", when two units have the same guid?

Different object types can't have same guid, because of highguid part...

Link to comment
Share on other sites

The fields usually only store the lower part of the GUID as well.

oh ok, thanks.

my problem is, that i wanna implement the daily quests now correctly. for that i wanna insert a record into the table character_quest_status_daily, but when there is only stored the lower part, i can't insert a row with the guid of the npc...

Link to comment
Share on other sites

but it shouldn't be so, it isn't so, that you can 25 dailies per day, you should only be able to take ONE daily per day.

for that, i wanted to save it in this db, to store the actual dailie quest, so it keeps the same after a servercrash

As arrai said, you still don't need to store the questgiver's guid.

create a new table in DB characters, call it daily_quest (for example)

2 fields in the table, `id`=character's guid and `date`= date last daily was taken

do check at character trying to take daily quest, if the date field for their id entry=today's date, do not allow them to take quest

if it != today's date, let them take quest and update date=today's date

i.e. character guid=1

table daily_quest contents:

(id, date)

(1, 19-11-2008)

They will NOT be allowed to take another daily quest today since they already took one.

Link to comment
Share on other sites

but it shouldn't be so, it isn't so, that you can 25 dailies per day, you should only be able to take ONE daily per day.

for that, i wanted to save it in this db, to store the actual dailie quest, so it keeps the same after a servercrash

You can complete 25 daily quests per day, that's correct.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use