| 1438 | GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime) |
| 1439 | { |
| 1440 | if(!IsInWorld()) |
| 1441 | return NULL; |
| 1442 | Map * map = GetMap(); |
| 1443 | if(!map) |
| 1444 | return NULL; |
| 1445 | GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(entry); |
| 1446 | if(!goinfo) |
| 1447 | { |
| 1448 | sLog.outErrorDb("Gameobject template %u not found in database!", entry); |
| 1449 | return NULL; |
| 1450 | } |
| 1451 | GameObject *go = new GameObject(); |
| 1452 | if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry,map,x,y,z,ang,rotation0,rotation1,rotation2,rotation3,100,1)) |
| 1453 | return NULL; |
| 1454 | go->SetRespawnTime(respawnTime); |
| 1455 | go->SetSpawnedByDefault(false); // do not save respawn time |
| 1456 | map->Add(go); |
| 1457 | |
| 1458 | return go; |
| 1459 | } |
| 1460 | |