Index: src/game/Object.cpp =================================================================== --- src/game/Object.cpp (revision 5316) +++ src/game/Object.cpp (working copy) @@ -15,7 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #include "Common.h" #include "SharedDefines.h" #include "WorldPacket.h" @@ -539,7 +538,7 @@ } } } - else //case UPDATETYPE_VALUES + else //case UPDATETYPE_VALUES { if (isType(TYPE_GAMEOBJECT) && !((GameObject*)this)->IsTransport()) { @@ -1197,13 +1196,33 @@ uint32 team = 0; if (GetTypeId()==TYPEID_PLAYER) team = ((Player*)this)->GetTeam(); + + //int test; test = atoi((const char *) + + //(WorldDatabase.PQuery("SELECT creatureguid FROM event_scripts WHERE datalong='%u'",id))); + + sLog.outDebug("CreatureGUID IS: %x",(WorldDatabase.PQuery("SELECT creatureguid FROM event_scripts WHERE datalong='%s'",id))); + + uint32 creatureguid = 0; - if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), GetMapId(), x, y, z, ang, id, team)) + // sLog.outDebug("CreatureGUID IS: %x",creatureguid); + + if(creatureguid > 0) + { + if (!pCreature->Create(creatureguid, GetMapId(), x, y, z, ang, id, team)) { delete pCreature; return NULL; } - + } + else + { + if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), GetMapId(), x, y, z, ang, id, team)) + { + delete pCreature; + } + } + pCreature->Summon(spwtype, despwtime); //return the creature therewith the summoner has access to it