本文整理汇总了C++中OpenDoor函数的典型用法代码示例。如果您正苦于以下问题:C++ OpenDoor函数的具体用法?C++ OpenDoor怎么用?C++ OpenDoor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OpenDoor函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: noBuilding
/**
*
*
* @author OLiver
*/
nobUsual::nobUsual(BuildingType type,
MapPoint pos,
unsigned char player,
Nation nation)
: noBuilding(type, pos, player, nation),
worker(NULL), disable_production(false), disable_production_virtual(false),
last_ordered_ware(0), orderware_ev(NULL), productivity_ev(NULL), is_working(false)
{
std::fill(wares.begin(), wares.end(), 0);
// Entsprechend so viele Listen erstellen, wie nötig sind, bei Bergwerken 3
if(USUAL_BUILDING_CONSTS[type_ - 10].wares_needed_count)
ordered_wares.resize(USUAL_BUILDING_CONSTS[type_ - 10].wares_needed_count);
else
ordered_wares.clear();
// Arbeiter bestellen
GameClientPlayer& owner = gwg->GetPlayer(player);
owner.AddJobWanted(USUAL_BUILDING_CONSTS[type_ - 10].job, this);
// Tür aufmachen,bis Gebäude besetzt ist
OpenDoor();
const std::list<nobUsual*>& otherBlds = owner.GetBuildings(type);
if(otherBlds.empty())
productivity = 0;
else
{
// New building gets half the average productivity from all buildings of the same type
int sumProductivity = 0;
for(std::list<nobUsual*>::const_iterator it = otherBlds.begin(); it != otherBlds.end(); ++it)
sumProductivity += (*it)->GetProductivity();
productivity = sumProductivity / otherBlds.size() / 2;
}
// Set last productivities to current to avoid resetting it on first recalculation event
std::fill(last_productivities.begin(), last_productivities.end(), productivity);
// Gebäude in den Index eintragen, damit die Wirtschaft auch Bescheid weiß
// Do this AFTER the productivity calculation or we will get this building too!
owner.AddUsualBuilding(this);
}
开发者ID:gattschardo,项目名称:s25client,代码行数:46,代码来源:nobUsual.cpp
示例2: DoWipe
// Wipe has been detected. Perform cleanup and reset.
void DoWipe()
{
if (GetData(DATA_MARWYN_EVENT) != DONE) {
SetData(DATA_WAVE_COUNT, FAIL);
uiWaveCount = 0;
events.Reset();
DoUpdateWorldState(WORLD_STATE_HOR, 1);
DoUpdateWorldState(WORLD_STATE_HOR_WAVE_COUNT, uiWaveCount);
OpenDoor(uiFrontDoor);
// TODO
// in case of wipe, the event is normally restarted by jumping into the center of the room.
// As I can't find a trigger area there, just respawn Jaina/Sylvanas so the event may be restarted.
if (Creature* pFalric = instance->GetCreature(uiFalric))
pFalric->SetVisible(false);
if (Creature* pMarwyn = instance->GetCreature(uiMarwyn))
pMarwyn->SetVisible(false);
}
}
开发者ID:Josemurillo,项目名称:frokTinkel,代码行数:22,代码来源:instance_halls_of_reflection.cpp
示例3: switch
void Scheduler::Passenger()
{
Serial.print("----- Passenger Command ");
switch(opCode){
case 0: break;
case 1: ScheduleCalls(floor,"UP");
Serial.print(" op: Hall Call Up");
Serial.print("\tFloor : "+String(floor)+"-----\n");
break;
case 2: ScheduleCalls(floor,"DOWN");
Serial.print(" op: Hall Call Down");
Serial.print("\tFloor : "+String(floor)+"-----\n");
break;
case 3: InsertDestination(floor,elevatorID);
Serial.print(" op:Insert Destination for Elevator "+String(elevatorID+1));
Serial.print("\tFloor : "+String(floor)+"-----\n");
break;
case 4: OpenDoor(elevatorID);
Serial.print(" op: Open Door for Elevator "+String(elevatorID+1));
Serial.print("-----\n");
break;
case 5: CloseDoor(elevatorID);
Serial.print(" op: Close Door for Elevator "+String(elevatorID+1));
Serial.print("-----\n");
break;
case 6: CancelCalls(floor,elevatorID);
Serial.print(" op: Cancel floor for Elevator "+String(elevatorID+1));
Serial.print("\tFloor : "+String(floor)+"-----\n");
break;
case 7: Serial.print(" op: Alarm status:");
Alarm(elevatorID);
Serial.print(" for Elevator "+String(elevatorID+1));
Serial.print("-----\n");
break;
default : break;
}
}
开发者ID:programenthusiast813,项目名称:elevator_control_system,代码行数:39,代码来源:Scheduler.cpp
示例4: ProcessCardSwipe
int ProcessCardSwipe(int swipeFD,int arduinoFD, MYSQL * conn)
{
int ret = 0;
const unsigned bufferSize = 256;
char buffer[bufferSize+1];
buffer[bufferSize] = '\0';
bzero(buffer,bufferSize);
unsigned readSize = ReadKeyboard(swipeFD,buffer,bufferSize);
if(readSize == 10)
{
int opendoor = 0;
buffer[readSize] = '\0';
// 0123456789012345678901234567890123 45678901
char query[] = "select * from users where swipe = \"XXXXXXXXX\" limit 0,1 ";
memcpy(query+35,buffer,9);
// printf("%s (%d)\n",query,sizeof(query));
opendoor = RunSQLquery(conn,query,sizeof(query));
if(opendoor == 1)
{
alarm(0); //Cancel any previous alarms
OpenDoor(arduinoFD);
alarm(5); //schedule an alarm to go off in 5 seconds to close the door
}
memcpy(query+35,"XXXXXXXXX",9);
ret = 1;
}
else if(readSize == 0)
{
ret = 1;
}
else
{
ret = 0;
}
return ret;
}
开发者ID:dgastler,项目名称:Door,代码行数:39,代码来源:Swipe.c
示例5: DoWipe
void DoWipe()
{
if (GetData(DATA_FALRIC_EVENT) == DONE && GetData(DATA_MARWYN_EVENT) != DONE)
WaveCnt = 5;
else
WaveCnt = 0;
events.Reset();
DoUpdateWorldState(WORLD_STATE_HOR, 0);
DoUpdateWorldState(WORLD_STATE_HOR_WAVE_COUNT, WaveCnt);
OpenDoor(FrontDoorGUID);
if (Creature * Falric = instance->GetCreature(FalricGUID))
if (Falric->isAlive())
Falric->AI()->EnterEvadeMode();
if (Creature * Marwyn = instance->GetCreature(MarwynGUID))
if (Marwyn->isAlive())
Marwyn->AI()->EnterEvadeMode();
}
开发者ID:ivansiwi,项目名称:TrinityCore,代码行数:22,代码来源:instance_halls_of_reflection.cpp
示例6: switch
void instance_naxxramas::SetData(uint32 uiType, uint32 uiData)
{
switch(uiType)
{
case TYPE_ANUB_REKHAN:
m_auiEncounter[0] = uiData;
DoUseDoorOrButton(m_uiAnubDoorGUID);
if (uiData == DONE)
{
OpenDoor(m_uiAnubGateGUID);
m_uiArachnofobiaTimer = 0;
m_bIsArachnofobia = true;
}
break;
case TYPE_FAERLINA:
m_auiEncounter[1] = uiData;
DoUseDoorOrButton(m_uiFaerWebGUID);
if (uiData == DONE)
{
OpenDoor(m_uiFaerDoorGUID);
OpenDoor(m_uiMaexOuterGUID);
}
break;
case TYPE_MAEXXNA:
m_auiEncounter[2] = uiData;
DoUseDoorOrButton(m_uiMaexInnerGUID, uiData);
if (uiData == DONE)
{
DoUseDoorOrButton(m_uiAracEyeRampGUID);
DoUseDoorOrButton(m_uiAracEyeGUID);
DoRespawnGameObject(m_uiAracPortalGUID, 30*MINUTE);
Immortal();
DoTaunt();
// Arachnofobia
if(m_uiArachnofobiaTimer <= 20 * 60000 && m_bIsArachnofobia)
{
Arachnofobia();
m_bIsArachnofobia = false;
}
}
break;
case TYPE_NOTH:
m_auiEncounter[3] = uiData;
DoUseDoorOrButton(m_uiNothEntryDoorGUID);
if (uiData == DONE)
{
OpenDoor(m_uiNothExitDoorGUID);
OpenDoor(m_uiHeigEntryDoorGUID);
}
break;
case TYPE_HEIGAN:
m_auiEncounter[4] = uiData;
DoUseDoorOrButton(m_uiHeigEntryDoorGUID);
if (uiData == DONE)
{
OpenDoor(m_uiHeigExitDoorGUID);
OpenDoor(m_uiLoathebDoorGUID);
}
break;
case TYPE_LOATHEB:
m_auiEncounter[5] = uiData;
DoUseDoorOrButton(m_uiLoathebDoorGUID);
if (uiData == DONE)
{
DoUseDoorOrButton(m_uiPlagEyeRampGUID);
DoUseDoorOrButton(m_uiPlagEyeGUID);
DoRespawnGameObject(m_uiPlagPortalGUID, 30*MINUTE);
DoTaunt();
Immortal();
}
break;
case TYPE_RAZUVIOUS:
m_auiEncounter[6] = uiData;
if (uiData == DONE)
OpenDoor(m_uiGothikEntryDoorGUID);
break;
case TYPE_GOTHIK:
switch(uiData)
{
case IN_PROGRESS:
DoUseDoorOrButton(m_uiGothikEntryDoorGUID);
DoUseDoorOrButton(m_uiGothCombatGateGUID);
break;
case SPECIAL:
DoUseDoorOrButton(m_uiGothCombatGateGUID);
break;
case FAIL:
if (m_auiEncounter[7] == IN_PROGRESS)
DoUseDoorOrButton(m_uiGothCombatGateGUID);
DoUseDoorOrButton(m_uiGothikEntryDoorGUID);
break;
case DONE:
OpenDoor(m_uiGothikEntryDoorGUID);
OpenDoor(m_uiGothikExitDoorGUID);
OpenDoor(m_uiHorsemenDoorGUID);
OpenDoor(m_uiGothCombatGateGUID);
break;
}
//.........这里部分代码省略.........
开发者ID:Dkocir,项目名称:ScriptDev2_2010,代码行数:101,代码来源:instance_naxxramas.cpp
示例7: OpenDoor
// used in order to unlock the door to Vezax and make vezax attackable
void instance_ulduar::DoOpenMadnessDoorIfCan()
{
if(m_auiEncounter[7] == DONE && m_auiEncounter[8] == DONE && m_auiEncounter[9] == DONE && m_auiEncounter[10] == DONE)
OpenDoor(m_uiAncientGateGUID);
OpenDoor(m_uiAncientGateGUID);
}
开发者ID:Bearq,项目名称:mangos,代码行数:7,代码来源:instance_ulduar.cpp
示例8: OnGameObjectCreate
void OnGameObjectCreate(GameObject* go)
{
// TODO: init state depending on encounters
switch (go->GetEntry())
{
case GO_FROSTMOURNE:
Frostmourne = go->GetGUID();
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
HandleGameObject(0, false, go);
break;
case GO_FROSTMOURNE_ALTAR:
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
HandleGameObject(0, true, go);
break;
case GO_FRONT_DOOR:
FrontDoor = go->GetGUID();
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
OpenDoor(FrontDoor);
break;
case GO_FROSTWORN_DOOR:
FrostwornDoor = go->GetGUID();
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
if (Encounter[1] == DONE)
OpenDoor(FrostwornDoor);
else
CloseDoor(FrostwornDoor);
break;
case GO_RUN_DOOR:
RunDoor = go->GetGUID();
break;
case GO_ARTHAS_DOOR:
ArthasDoor = go->GetGUID();
break;
case GO_ICE_WALL_1:
WallID[0] = go->GetGUID();
break;
case GO_ICE_WALL_2:
WallID[1] = go->GetGUID();
break;
case GO_ICE_WALL_3:
WallID[2] = go->GetGUID();
break;
case GO_ICE_WALL_4:
WallID[3] = go->GetGUID();
break;
case GO_CAVE:
CaveDoor = go->GetGUID();
break;
case GO_CAPTAIN_CHEST_1:
go->SetPhaseMask(2, true);
if (!instance->IsHeroic() && TeamInInstance == HORDE)
Chest = go->GetGUID();
break;
case GO_CAPTAIN_CHEST_3:
go->SetPhaseMask(2, true);
if (instance->IsHeroic() && TeamInInstance == HORDE)
Chest = go->GetGUID();
break;
case GO_CAPTAIN_CHEST_2:
go->SetPhaseMask(2, true);
if (!instance->IsHeroic() && TeamInInstance == ALLIANCE)
Chest = go->GetGUID();
break;
case GO_CAPTAIN_CHEST_4:
go->SetPhaseMask(2, true);
if (instance->IsHeroic() && TeamInInstance == ALLIANCE)
Chest = go->GetGUID();
break;
case GO_SKYBREAKER:
go->SetPhaseMask(2, true);
if (TeamInInstance == ALLIANCE)
Gunship = go->GetGUID();
break;
case GO_ORGRIM_HAMMER:
go->SetPhaseMask(2, true);
if (TeamInInstance == HORDE)
Gunship = go->GetGUID();
break;
case GO_PORTAL:
go->SetPhaseMask(2, true);
uiPortal = go->GetGUID();
break;
}
}
开发者ID:AwkwardDev,项目名称:Darkcore-Rebase,代码行数:85,代码来源:instance_halls_of_reflection.cpp
示例9: OpenXtDoor
// used to open the door to XT (custom script because Leviathan is disabled)
// this will be removed when the Leviathan will be implemented
void OpenXtDoor()
{
if(m_auiEncounter[1] == DONE && m_auiEncounter[2] == DONE)
OpenDoor(m_uiXT002GateGUID);
}
开发者ID:Iov,项目名称:scriptdev2,代码行数:7,代码来源:instance_ulduar.cpp
示例10: SetData
void SetData(uint32 uiType, uint32 uiData)
{
switch(uiType)
{
case TYPE_STAGE: m_auiEncounter[0] = uiData; break;
case TYPE_BEASTS: m_auiEncounter[1] = uiData; break;
case TYPE_JARAXXUS: m_auiEncounter[2] = uiData; break;
case TYPE_CRUSADERS: if (uiData == FAIL && (m_auiEncounter[3] == FAIL || m_auiEncounter[3] == NOT_STARTED))
m_auiEncounter[3] = NOT_STARTED;
else m_auiEncounter[3] = uiData;
if (uiData == DONE) {
if (GameObject* pChest = instance->GetGameObject(m_uiCrusadersCacheGUID))
if (pChest && !pChest->isSpawned())
pChest->SetRespawnTime(7*DAY);
};
break;
case TYPE_CRUSADERS_COUNT: if (uiData == 0) --m_auiCrusadersCount;
else m_auiCrusadersCount = uiData;
break;
case TYPE_VALKIRIES: if (m_auiEncounter[4] == SPECIAL && uiData == SPECIAL) uiData = DONE;
m_auiEncounter[4] = uiData; break;
case TYPE_LICH_KING: m_auiEncounter[5] = uiData; break;
case TYPE_ANUBARAK: m_auiEncounter[6] = uiData;
if (uiData == DONE) {
if(Difficulty == RAID_DIFFICULTY_10MAN_HEROIC){
if ( m_auiEncounter[7] >= 25) m_uiTributeChest1GUID = m_uiTC10h25GUID;
if ( m_auiEncounter[7] >= 45) m_uiTributeChest2GUID = m_uiTC10h45GUID;
if ( m_auiEncounter[7] >= 49) m_uiTributeChest3GUID = m_uiTC10h50GUID;
m_uiTributeChest4GUID = m_uiTC10h99GUID;
}
if(Difficulty == RAID_DIFFICULTY_25MAN_HEROIC){
if ( m_auiEncounter[7] >= 25) m_uiTributeChest1GUID = m_uiTC25h25GUID;
if ( m_auiEncounter[7] >= 45) m_uiTributeChest2GUID = m_uiTC25h45GUID;
if ( m_auiEncounter[7] >= 49) m_uiTributeChest3GUID = m_uiTC25h50GUID;
m_uiTributeChest4GUID = m_uiTC25h99GUID;
}
// Attention! It is (may be) not off-like, but spawning all Tribute Chests is real
// reward for clearing TOC instance
if (m_uiTributeChest1GUID)
if (GameObject* pChest1 = instance->GetGameObject(m_uiTributeChest1GUID))
if (pChest1 && !pChest1->isSpawned()) pChest1->SetRespawnTime(7*DAY);
if (m_uiTributeChest2GUID)
if (GameObject* pChest2 = instance->GetGameObject(m_uiTributeChest2GUID))
if (pChest2 && !pChest2->isSpawned()) pChest2->SetRespawnTime(7*DAY);
if (m_uiTributeChest3GUID)
if (GameObject* pChest3 = instance->GetGameObject(m_uiTributeChest3GUID))
if (pChest3 && !pChest3->isSpawned()) pChest3->SetRespawnTime(7*DAY);
if (m_uiTributeChest4GUID)
if (GameObject* pChest4 = instance->GetGameObject(m_uiTributeChest4GUID))
if (pChest4 && !pChest4->isSpawned()) pChest4->SetRespawnTime(7*DAY);
};
break;
case TYPE_COUNTER: m_auiEncounter[7] = uiData; uiData = DONE; break;
case TYPE_EVENT: m_auiEncounter[8] = uiData; uiData = NOT_STARTED; break;
case TYPE_EVENT_TIMER: m_auiEventTimer = uiData; uiData = NOT_STARTED; break;
case TYPE_NORTHREND_BEASTS: m_auiNorthrendBeasts = uiData; break;
case DATA_HEALTH_FJOLA: m_uiDataDamageFjola = uiData; uiData = NOT_STARTED; break;
case DATA_HEALTH_EYDIS: m_uiDataDamageEydis = uiData; uiData = NOT_STARTED; break;
case DATA_CASTING_VALKYRS: m_uiValkyrsCasting = uiData; uiData = NOT_STARTED; break;
}
if (IsEncounterInProgress())
{
CloseDoor(GetData64(GO_WEST_PORTCULLIS));
CloseDoor(GetData64(GO_NORTH_PORTCULLIS));
// CloseDoor(GetData64(GO_SOUTH_PORTCULLIS));
}
else
{
OpenDoor(GetData64(GO_WEST_PORTCULLIS));
OpenDoor(GetData64(GO_NORTH_PORTCULLIS));
// OpenDoor(GetData64(GO_SOUTH_PORTCULLIS));
};
if (uiData == FAIL && uiType != TYPE_STAGE
&& uiType != TYPE_EVENT
&& uiType != TYPE_COUNTER
&& uiType != TYPE_EVENT_TIMER)
{
if (IsRaidWiped())
{
--m_auiEncounter[7];
needsave = true;
}
uiData = NOT_STARTED;
}
if ((uiData == DONE && uiType != TYPE_STAGE
&& uiType != TYPE_EVENT
&& uiType != TYPE_EVENT_TIMER)
|| needsave == true)
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
for(uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
saveStream << m_auiEncounter[i] << " ";
//.........这里部分代码省略.........
开发者ID:SeTM,项目名称:mangos,代码行数:101,代码来源:instance_trial_of_the_crusader.cpp
示例11: OpenDoor
// used in order to unlock the door to Vezax and make vezax attackable
void instance_ulduar::DoOpenMadnessDoorIfCan()
{
if(m_auiEncounter[TYPE_MIMIRON] == DONE && m_auiEncounter[TYPE_HODIR] == DONE && m_auiEncounter[TYPE_THORIM] == DONE && m_auiEncounter[TYPE_FREYA] == DONE)
OpenDoor(GO_ANCIENT_GATE);
}
开发者ID:Reamer,项目名称:cyber-scriptdev2,代码行数:6,代码来源:instance_ulduar.cpp
示例12: SetData
void SetData(uint32 type, uint32 data)
{
if (type == DATA_WAVE_COUNT && data == SPECIAL)
{
bIntroDone = true;
CloseDoor(uiFrontDoor);
CloseDoor(uiRunDoor);
events.ScheduleEvent(EVENT_NEXT_WAVE, 9000);
return;
}
if (uiWaveCount && data == NOT_STARTED)
DoWipe();
switch (type)
{
case DATA_FALRIC_EVENT:
uiEncounter[0] = data;
if (data == DONE)
events.ScheduleEvent(EVENT_NEXT_WAVE, 9000);
if (Creature* partner = instance->GetCreature(uiPartner2))
partner->SetVisible(false);
break;
case DATA_MARWYN_EVENT:
uiEncounter[1] = data;
if (data == DONE)
{
OpenDoor(uiFrostswornDoor);
OpenDoor(uiFrontDoor);
}
break;
case DATA_FROSTSWORN_EVENT:
uiEncounter[2] = data;
if (data == DONE)
{
OpenDoor(uiArthasDoor);
SetData(DATA_PHASE, 3);
instance->SummonCreature(NPC_LICH_KING_BOSS, OutroSpawns[0]);
instance->SummonCreature(NPC_SYLVANAS_PART2, OutroSpawns[1]);
}
if (Creature* partner = instance->GetCreature(uiPartner2))
partner->SetVisible(true);
break;
case DATA_LICHKING_EVENT:
uiEncounter[3] = data;
if (data == IN_PROGRESS)
{
OpenDoor(uiRunDoor);
if (instance->IsHeroic())
DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_NOT_RETREATING_EVENT);
}
if (data == FAIL)
{
for(uint8 i = 0; i<4; i++)
OpenDoor(uiWallID[i]);
CloseDoor(uiRunDoor);
if (Creature* pLichKing = instance->GetCreature(uiLichKing))
pLichKing->DespawnOrUnsummon(10000);
if (Creature* pLider = instance->GetCreature(uiLider))
pLider->DespawnOrUnsummon(10000);
DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_NOT_RETREATING_EVENT);
DoCastSpellOnPlayers(5); // Kill all players
SetData(DATA_PHASE, 3);
instance->SummonCreature(NPC_LICH_KING_BOSS, OutroSpawns[0]);
instance->SummonCreature(NPC_SYLVANAS_PART2, OutroSpawns[1]);
}
if (data == DONE)
{
if (GameObject *pChest = instance->GetGameObject(uiChest))
pChest->SetPhaseMask(1, true);
if (GameObject *pPortal = instance->GetGameObject(uiPortal))
pPortal->SetPhaseMask(1, true);
//ToDo Complete Achievement ACHIEV_HALLS_OF_REFLECTION_N
if (instance->IsHeroic())
{
//ToDo Complete Achievement(ACHIEV_HALLS_OF_REFLECTION_H);
DoCastSpellOnPlayers(SPELL_ACHIEV_CHECK);
DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_NOT_RETREATING_EVENT);
}
}
break;
case DATA_WAVES_BEGIN:
uiWaveBegin = data;
break;
case DATA_SUMMONS:
if (data == 3) uiSummons = 0;
else if (data == 1) ++uiSummons;
else if (data == 0) --uiSummons;
data = NOT_STARTED;
break;
case DATA_ICE_WALL_1:
uiWall[0] = data;
break;
case DATA_ICE_WALL_2:
uiWall[1] = data;
//.........这里部分代码省略.........
开发者ID:Gamerzon94,项目名称:fixes,代码行数:101,代码来源:instance_halls_of_reflection.cpp
示例13: LiftDoorBehaveInit
void* LiftDoorBehaveInit(void* bhdata, STRATEGYBLOCK* sbptr)
{
LIFT_DOOR_BEHAV_BLOCK *doorbhv;
LIFT_DOOR_TOOLS_TEMPLATE *doortt;
MORPHCTRL* morphctrl;
MORPHHEADER* morphheader;
MORPHFRAME* morphframe;
MODULE * my_mod;
doorbhv = (LIFT_DOOR_BEHAV_BLOCK*)AllocateMem(sizeof(LIFT_DOOR_BEHAV_BLOCK));
if (!doorbhv)
{
memoryInitialisationFailure = 1;
return ((void *)NULL);
}
doorbhv->bhvr_type = I_BehaviourLiftDoor;
// from loaders
doortt = (LIFT_DOOR_TOOLS_TEMPLATE*)bhdata;
// Set up a new Morph Control
morphctrl = (MORPHCTRL*)AllocateMem(sizeof(MORPHCTRL));
if (!morphctrl)
{
memoryInitialisationFailure = 1;
return ((void *)NULL);
}
morphheader = (MORPHHEADER*)AllocateMem(sizeof(MORPHHEADER));
if (!morphheader)
{
memoryInitialisationFailure = 1;
return ((void *)NULL);
}
morphframe = (MORPHFRAME*)AllocateMem(sizeof(MORPHFRAME));
if (!morphframe)
{
memoryInitialisationFailure = 1;
return ((void *)NULL);
}
morphframe->mf_shape1 = doortt->shape_open;
morphframe->mf_shape2 = doortt->shape_closed;
morphheader->mph_numframes = 1;
morphheader->mph_maxframes = ONE_FIXED;
morphheader->mph_frames = morphframe;
morphctrl->ObMorphCurrFrame = 0;
morphctrl->ObMorphFlags = 0;
morphctrl->ObMorphSpeed = 0;
morphctrl->ObMorphHeader = morphheader;
// Copy the name over
COPY_NAME (sbptr->SBname, doortt->nameID);
// Setup module ref
{
MREF mref=doortt->my_module;
ConvertModuleNameToPointer (&mref, MainSceneArray[0]->sm_marray);
my_mod = mref.mref_ptr;
}
GLOBALASSERT (my_mod);
my_mod->m_sbptr = sbptr;
sbptr->SBmoptr = my_mod;
sbptr->SBmomptr = my_mod->m_mapptr;
sbptr->SBflags.no_displayblock = 1;
doorbhv->door_state = doortt->state;
doorbhv->PDmctrl = morphctrl;
doorbhv->door_closing_speed=doortt->door_closing_speed;
doorbhv->door_opening_speed=doortt->door_opening_speed;
// all lift doors have a closed starting state except the
// one where the lift is - fill in other data
sbptr->SBmorphctrl = doorbhv->PDmctrl;
if(doorbhv->door_state == I_door_open)
{
sbptr->SBmorphctrl->ObMorphCurrFrame = 0;
OpenDoor(sbptr->SBmorphctrl, DOOR_OPENFASTSPEED);
}
else
{
GLOBALASSERT(doorbhv->door_state == I_door_closed);
sbptr->SBmorphctrl->ObMorphCurrFrame = 1;
CloseDoor(sbptr->SBmorphctrl, DOOR_CLOSEFASTSPEED);
}
doorbhv->request_state = doorbhv->door_state;
// copy data into relevant structures
sbptr->SBmorphctrl = doorbhv->PDmctrl;
if(sbptr->SBmoptr)
{
sbptr->SBmoptr->m_flags |= m_flag_open;
//.........这里部分代码省略.........
开发者ID:OpenSourcedGames,项目名称:Aliens-vs-Predator,代码行数:101,代码来源:bh_ldoor.c
示例14: LiftDoorBehaveFun
void LiftDoorBehaveFun(STRATEGYBLOCK* sbptr)
{
LIFT_DOOR_BEHAV_BLOCK *doorbhv;
MORPHCTRL *mctrl;
DISPLAYBLOCK* dptr;
MODULE *mptr;
GLOBALASSERT(sbptr);
doorbhv = (LIFT_DOOR_BEHAV_BLOCK*)sbptr->SBdataptr;
GLOBALASSERT((doorbhv->bhvr_type == I_BehaviourLiftDoor));
mctrl = doorbhv->PDmctrl;
GLOBALASSERT(mctrl);
mptr = sbptr->SBmoptr;
GLOBALASSERT(mptr);
dptr = sbptr->SBdptr;
/* update morphing.... */
UpdateMorphing(mctrl);
switch(doorbhv->door_state)
{
case I_door_opening:
{
mptr->m_flags |= m_flag_open;
if(mctrl->ObMorphFlags & mph_flag_finished)
{
if (doorbhv->SoundHandle!=SOUND_NOACTIVEINDEX)
{
Sound_Play(SID_DOOREND,"d",&mptr->m_world);
Sound_Stop(doorbhv->SoundHandle);
}
doorbhv->door_state = I_door_open;
}
break;
}
case I_door_closing:
{
if(mctrl->ObMorphFlags & mph_flag_finished)
{
if (doorbhv->SoundHandle!=SOUND_NOACTIVEINDEX)
{
Sound_Play(SID_DOOREND,"d",&mptr->m_world);
Sound_Stop(doorbhv->SoundHandle);
}
doorbhv->door_state = I_door_closed;
mptr->m_flags &= ~m_flag_open;
}
else if(AnythingInMyModule(sbptr->SBmoptr))
{
if (doorbhv->SoundHandle==SOUND_NOACTIVEINDEX)
{
Sound_Play(SID_DOORSTART,"d",&mptr->m_world);
Sound_Play(SID_DOORMID,"del",&mptr->m_world,&doorbhv->SoundHandle);
}
OpenDoor(mctrl, doorbhv->door_opening_speed);
doorbhv->door_state = I_door_opening;
mptr->m_flags |= m_flag_open;
}
break;
}
case I_door_open:
{
mptr->m_flags |= m_flag_open;
if(doorbhv->request_state == I_door_closed)
{
if (doorbhv->SoundHandle==SOUND_NOACTIVEINDEX)
{
Sound_Play(SID_DOORSTART,"d",&mptr->m_world);
Sound_Play(SID_DOORMID,"del",&mptr->m_world,&doorbhv->SoundHandle);
}
CloseDoor(mctrl, doorbhv->door_closing_speed);
doorbhv->door_state = I_door_closing;
}
break;
}
case I_door_closed:
{
mptr->m_flags &= ~m_flag_open;
if(doorbhv->request_state == I_door_open)
{
if (doorbhv->SoundHandle==SOUND_NOACTIVEINDEX)
{
Sound_Play(SID_DOORSTART,"d",&mptr->m_world);
Sound_Play(SID_DOORMID,"del",&mptr->m_world,&doorbhv->SoundHandle);
}
OpenDoor(mctrl, doorbhv->door_opening_speed);
doorbhv->door_state = I_door_opening;
mptr->m_flags |= m_flag_open;
}
break;
}
default:
LOCALASSERT(1==0);
}
}
开发者ID:OpenSourcedGames,项目名称:Aliens-vs-Predator,代码行数:99,代码来源:bh_ldoor.c
示例15: SetData
void SetData(uint32 type, uint32 data)
{
switch (type)
{
case DATA_WAVE_COUNT:
if (GetData(DATA_MARWYN_EVENT) == DONE)
{
WaveCnt = 0;
DoUpdateWorldState(WORLD_STATE_HOR_WAVE_COUNT, 0);
DoUpdateWorldState(WORLD_STATE_HOR, WaveCnt);
events.CancelEvent(EVENT_NEXT_WAVE);
break;
}
if (data == START_WAVES) // Start der Wellen
{
CloseDoor(FrontDoorGUID);
events.ScheduleEvent(EVENT_NEXT_WAVE, 0);
break;
}
if (data == START_NEXT_WAVE_INSTANT) // Nächste Welle sofort
{
events.RescheduleEvent(EVENT_NEXT_WAVE, 0);
break;
}
if (data == START_NEXT_WAVE) // Nächste Welle starten
{
events.RescheduleEvent(EVENT_NEXT_WAVE, SEKUNDEN_60);
break;
}
if (WaveCnt && data == START_RESET) // Wipe
{
DoWipe();
break;
}
break;
case DATA_INTRO_EVENT:
IntroDone = data;
break;
case DATA_FALRIC_EVENT:
Encounter[0] = data;
if (data == DONE)
events.RescheduleEvent(EVENT_NEXT_WAVE, SEKUNDEN_60);
break;
case DATA_MARWYN_EVENT:
Encounter[1] = data;
if (data == DONE)
{
DoUpdateWorldState(WORLD_STATE_HOR, 0);
OpenDoor(FrostwornDoorGUID);
OpenDoor(FrontDoorGUID);
}
break;
case DATA_FROSWORN_EVENT:
Encounter[2] = data;
if (data == DONE)
{
OpenDoor(ArthasDoorGUID);
SetData(DATA_PHASE, 3);
instance->SummonCreature(BOSS_LICH_KING, OutroSpawns[0]);
instance->SummonCreature(NPC_JAINA_OUTRO, OutroSpawns[1]);
}
break;
case DATA_LICHKING_EVENT:
Encounter[3] = data;
switch(data)
{
case IN_PROGRESS:
OpenDoor(RunDoorGUID);
if (instance->IsHeroic())
DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_NOT_RETREATING_EVENT);
break;
case FAIL:
for (uint8 i=0; i<4; ++i)
OpenDoor(WallGUID[i]);
CloseDoor(RunDoorGUID);
if (Creature * LichKing = instance->GetCreature(LichKingGUID))
LichKing->DespawnOrUnsummon(10000);
if (Creature * Leader = instance->GetCreature(LeaderGUID))
Leader->DespawnOrUnsummon(10000);
DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_NOT_RETREATING_EVENT);
DoCastSpellOnPlayers(SPELL_SUICIDE); // Alle Spieler begehen Selbsmord!
SetData(DATA_PHASE, 3);
instance->SummonCreature(BOSS_LICH_KING, OutroSpawns[0]);
instance->SummonCreature(NPC_JAINA_OUTRO, OutroSpawns[1]);
break;
case DONE:
if (GameObject * Chest = instance->GetGameObject(ChestGUID))
Chest->SetPhaseMask(1, true);
if (GameObject * Portal = instance->GetGameObject(PortalGUID))
Portal->SetPhaseMask(1, true);
DoCompleteAchievement(ACHIEV_HALLS_OF_REFLECTION_N);
if (instance->IsHeroic())
{
DoCompleteAchievement(ACHIEV_HALLS_OF_REFLECTION_H);
//.........这里部分代码省略.........
开发者ID:ivansiwi,项目名称:TrinityCore,代码行数:101,代码来源:instance_halls_of_reflection.cpp
示例16: switch
void instance_ulduar::SetData(uint32 uiType, uint32 uiData)
{
switch(uiType)
{
case TYPE_LEVIATHAN:
m_auiEncounter[0] = uiData;
DoUseDoorOrButton(m_uiShieldWallGUID);
if (uiData == DONE)
OpenDoor(m_uiLeviathanGateGUID);
break;
case TYPE_IGNIS:
m_auiEncounter[1] = uiData;
break;
case TYPE_RAZORSCALE:
m_auiEncounter[2] = uiData;
break;
case TYPE_XT002:
m_auiEncounter[3] = uiData;
if (uiData == DONE || uiData == FAIL)
OpenDoor(m_uiXT002GateGUID);
else if (uiData == IN_PROGRESS)
CloseDoor(m_uiXT002GateGUID);
break;
case TYPE_ASSEMBLY:
m_auiEncounter[4] = uiData;
if (uiData == DONE)
{
OpenDoor(m_uiIronCouncilDoorGUID);
OpenDoor(m_uiArchivumDoorGUID);
OpenDoor(m_uiShatteredHallsDoorGUID);
}
else if (uiData == IN_PROGRESS)
CloseDoor(m_uiIronCouncilDoorGUID);
else if (uiData == FAIL)
OpenDoor(m_uiIronCouncilDoorGUID);
break;
case TYPE_KOLOGARN:
m_auiEncounter[5] = uiData;
if (uiData == DONE)
{
DoRespawnGameObject(m_uiKologarnLootGUID, 30*MINUTE);
if (GameObject* pGo = instance->GetGameObject(m_uiKologarnBridgeGUID))
{
pGo->SetUInt32Value(GAMEOBJECT_LEVEL, 0);
pGo->SetGoState(GO_STATE_READY);
}
}
break;
case TYPE_AURIAYA:
m_auiEncounter[6] = uiData;
if (uiData == DONE)
{
if (GameObject* pGO = instance->GetGameObject(m_uiMimironTramGUID))
{
pGO->SetUInt32Value(GAMEOBJECT_LEVEL, 0);
pGO->SetGoState(GO_STATE_READY);
}
}
break;
// Keepers
case TYPE_MIMIRON:
m_auiEncounter[7] = uiData;
DoUseDoorOrButton(m_uiMimironDoor1GUID);
DoUseDoorOrButton(m_uiMimironDoor2GUID);
DoUseDoorOrButton(m_uiMimironDoor3GUID);
if (uiData == DONE)
{
if(m_auiHardBoss[3] != DONE)
DoRespawnGameObject(m_uiMimironLootGUID, 30*MINUTE);
// used to make the friendly keeper visible
if(Creature* pImage = instance->GetCreature(m_uiMimironImageGUID))
pImage->SetVisibility(VISIBILITY_ON);
DoOpenMadnessDoorIfCan();
}
break;
case TYPE_HODIR:
m_auiEncounter[8] = uiData;
if (uiData == DONE)
{
OpenDoor(m_uiHodirEnterDoorGUID);
DoUseDoorOrButton(m_uiHodirWallGUID);
DoUseDoorOrButton(m_uiHodirExitDoorGUID);
DoRespawnGameObject(m_uiHodirLootGUID, 30*MINUTE);
// used to make the friendly keeper visible
if(Creature* pImage = instance->GetCreature(m_uiHodirImageGUID))
pImage->SetVisibility(VISIBILITY_ON);
DoOpenMadnessDoorIfCan();
}
else if (uiData == IN_PROGRESS)
CloseDoor(m_uiHodirEnterDoorGUID);
else if (uiData == FAIL)
OpenDoor(m_uiHodirEnterDoorGUID);
break;
case TYPE_THORIM:
m_auiEncounter[9] = uiData;
DoUseDoorOrButton(m_uiArenaEnterDoorGUID);
if (uiData == IN_PROGRESS)
//.........这里部分代码省略.........
开发者ID:Bearq,项目名称:mangos,代码行数:101,代码来源:instance_ulduar.cpp
示例17: EVENT_OpenDoor
/*-------------------------------------------------------------------
Procedure : Open BGObject Door
Input : uint8 * Data
Output : nothing
-------------------------------------------------------------------*/
void EVENT_OpenDoor( uint8 * Data )
{
OpenDoor( (uint16) *Data );
}
开发者ID:ForsakenW,项目名称:forsaken,代码行数:9,代码来源:Triggers.c
示例18: SetData
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_RAGEWINTERCHILLEVENT: Encounters[0] = data; break;
case DATA_ANETHERONEVENT:
Encounters[1] = data;
break;
case DATA_KAZROGALEVENT: Encounters[2] = data; break;
case DATA_AZGALOREVENT:
{
Encounters[3] = data;
if (data == DONE)
{
if (ArchiYell)break;
ArchiYell = true;
Creature* pCreature = instance->GetCreature(Azgalor);
if (pCreature)
{
Creature* pUnit = pCreature->SummonCreature(
|
请发表评论