Originally Posted by
Xmaily
I have no idea what that means could u show me a example from a script? What would i need to define at the start of it?
I don't know what emulator you are using or what, you could look at code examples from the currently scripted dungeons.
Here is a code snippet from the TrinityCore Black Temple script:
Code:
instance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED);
IllidanGUID = instance->GetData64(DATA_ILLIDANSTORMRAGE);
GateGUID = instance->GetData64(DATA_GAMEOBJECT_ILLIDAN_GATE);
DoorGUID[0] = instance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_R);
DoorGUID[1] = instance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_L);
if (JustCreated) // close all doors at create
{
instance->HandleGameObject(GateGUID, false);
for (uint8 i = 0; i < 2; ++i)
instance->HandleGameObject(DoorGUID[i], false);
}
else // open all doors, raid wiped
{
instance->HandleGameObject(GateGUID, true);
WalkCount = 1; // skip first wp
for (uint8 i = 0; i < 2; ++i)
instance->HandleGameObject(DoorGUID[i], true);
}
Or in ArcEmu, this is the Lua approach I have used:
Code:
local OBJECT_END = 0x0006
local GAMEOBJECT_BYTES_1 = OBJECT_END + 0x000B
...
local gate = pUnit:GetGameObjectNearestCoords(x, y, z, gameObjectId)
if gate then
gate:SetByte(GAMEOBJECT_BYTES_1,0,0) -- open door
gate:SetByte(GAMEOBJECT_BYTES_1,0,1) -- close door
end
The C++ code is pretty much the same.