这篇教程C++ CAST_CRE函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CAST_CRE函数的典型用法代码示例。如果您正苦于以下问题:C++ CAST_CRE函数的具体用法?C++ CAST_CRE怎么用?C++ CAST_CRE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CAST_CRE函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: JustDied void JustDied(Unit* /*Killer*/) { Unit* pLeftHead = Unit::GetUnit(*me, LeftHeadGUID); Unit* pRightHead = Unit::GetUnit(*me, RightHeadGUID); if (!pLeftHead || !pRightHead) return; DoScriptText(YELL_DIE_L, pLeftHead); CAST_AI(mob_omrogg_heads::mob_omrogg_headsAI, CAST_CRE(pRightHead)->AI())->DoDeathYell(); if (instance) instance->SetData(TYPE_OMROGG, DONE); }
开发者ID:Asandru,项目名称:Script-Land,代码行数:15,
示例2: JustDied void JustDied(Unit* /*killer*/) { Creature* pLeftHead = Creature::GetCreature(*me, LeftHeadGUID); Creature* pRightHead = Creature::GetCreature(*me, RightHeadGUID); if (!pLeftHead || !pRightHead) return; pLeftHead->AI()->Talk(YELL_DIE_L); CAST_AI(mob_omrogg_heads::mob_omrogg_headsAI, CAST_CRE(pRightHead)->AI())->DoDeathYell(); if (instance) instance->SetData(TYPE_OMROGG, DONE); }
开发者ID:P-Kito,项目名称:InfinityCore,代码行数:15,
示例3: MoveInLineOfSight void MoveInLineOfSight(Unit* who) { ScriptedAI::MoveInLineOfSight(who); if (who->GetEntry() == GHOULS && me->IsWithinDistInMap(who, 10.0f)) { if (Unit* owner = who->GetOwner()) { if (owner->GetTypeId() == TYPEID_PLAYER) { if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE) CAST_CRE(who)->CastSpell(owner, 52517, true); //Todo: Creatures must not be removed, but, must instead // stand next to Gothik and be commanded into the pit // and dig into the ground. CAST_CRE(who)->DespawnOrUnsummon(); if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_COMPLETE) owner->RemoveAllMinionsByEntry(GHOULS); } } } }
开发者ID:AnthoDevMoP,项目名称:InfinityCore,代码行数:24,
示例4: PassengerBoarded void PassengerBoarded(Unit* who, int8 seatId, bool apply) { if (!me->GetVehicle()) return; if (seatId == SEAT_PLAYER) { if (!apply) return; else DoScriptText(SAY_PLAYER_RIDING,me); if (Creature* pTurret = CAST_CRE(vehicle->GetPassenger(SEAT_TURRET))) { pTurret->setFaction(me->GetVehicleBase()->getFaction()); pTurret->SetUInt32Value(UNIT_FIELD_FLAGS, 0); // unselectable pTurret->AI()->AttackStart(who); } if (Unit* pDevice = CAST_CRE(vehicle->GetPassenger(SEAT_DEVICE))) { pDevice->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); pDevice->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } } //else //throw passenger bugged, when fixed uncomment this part. // if (seatId == SEAT_TURRET) // { // if (apply) // return; // if (Unit* device = vehicle->GetPassenger(SEAT_DEVICE)) // { // device->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); // device->SetUInt32Value(UNIT_FIELD_FLAGS, 0); // unselectable // } // } }
开发者ID:Barragan,项目名称:MadboxpcWOW-core-,代码行数:36,
示例5: PassengerBoarded void PassengerBoarded(Unit *who, int8 /*seatId*/, bool apply) { if (who->GetTypeId() == TYPEID_UNIT) { if (who->GetEntry() == 32933) left = apply; else if (who->GetEntry() == 32934) right = apply; if (!apply && instance) instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_DISARMED_START_EVENT); who->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); CAST_CRE(who)->SetReactState(REACT_PASSIVE); } }
开发者ID:MobileDev,项目名称:P-Core,代码行数:16,
示例6: JustDied void JustDied(Unit* pKiller) { if (pKiller->GetTypeId() == TYPEID_PLAYER) { CAST_PLR(pKiller)->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_YGGDRAS_1, CAST_PLR(pKiller)); CAST_PLR(pKiller)->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_YGGDRAS_2, CAST_PLR(pKiller)); } for (uint8 i = 0; i < 2; ++i) DoCast(pKiller, SPELL_JORMUNGAR_SPAWN, true); if (m_creature->isSummon()) if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner())) if (npc_gurgthockAI* pAI = CAST_AI(npc_gurgthockAI,pSummoner->AI())) pAI->bEventInProgress = false; }
开发者ID:Ickybad,项目名称:diamondcore2,代码行数:16,
示例7: MovementInform void MovementInform(uint32 uiType, uint32 /*uiId*/) { if (uiType != POINT_MOTION_TYPE) return; if (me->isSummon()) { if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner())) { if (npc_lord_gregor_lescovarAI* pAI = CAST_AI(npc_lord_gregor_lescovarAI,pSummoner->AI())) { pAI->uiTimer = 2000; pAI->uiPhase = 5; } //me->ChangeOrient(0.0f, pSummoner); } } }
开发者ID:LolJK,项目名称:PhantomCore,代码行数:18,
示例8: JustDied void JustDied(Unit* /*Killer*/) { if (LeftHead && RightHead) { Unit* Left = Unit::GetUnit(*me,LeftHead); Unit* Right = Unit::GetUnit(*me,RightHead); if (!Left || !Right) return; DoScriptText(YELL_DIE_L, Left); ((mob_omrogg_headsAI*)CAST_CRE(Right)->AI())->DoDeathYell(); } if (pInstance) pInstance->SetData(TYPE_WARBRINGER, DONE); }
开发者ID:Regolan,项目名称:blizzlikecore,代码行数:18,
示例9: EnterCombat void EnterCombat(Unit* /*who*/) { if (pInstance) pInstance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS); DoZoneInCombat(); me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); DoPlaySoundToSet(me, SOUND_YELL_AGGRO); for (uint8 i = 0; i < 4; ++i) { Unit* Temp = Unit::GetUnit((*me), AddGUID[i]); if (Temp && Temp->isAlive()) CAST_CRE(Temp)->AI()->AttackStart(me->getVictim()); else { EnterEvadeMode(); break; } } }
开发者ID:dsstest,项目名称:ArkCORE,代码行数:18,
示例10: Reset void Reset() { if (instance) { //for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i) for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) { //Unit* unit = Unit::GetUnit(*me, FelCrystals[i]); Unit* unit = Unit::GetUnit(*me, *itr); if (unit) { if (!unit->isAlive()) CAST_CRE(unit)->Respawn(); // Let the core handle setting death state, etc. // Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here. unit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } } instance->HandleGameObject(instance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true); // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here) // Small door opened after event are expected to be closed by default // Set Inst data for encounter instance->SetData(DATA_SELIN_EVENT, NOT_STARTED); } else sLog->outError(ERROR_INST_DATA); DrainLifeTimer = urand(3000, 7000); DrainManaTimer = DrainLifeTimer + 5000; FelExplosionTimer = 2100; if (IsHeroic()) DrainCrystalTimer = urand(10000, 15000); else DrainCrystalTimer = urand(20000, 25000); EmpowerTimer = 10000; IsDraining = false; DrainingCrystal = false; CrystalGUID = 0; }
开发者ID:Eralan,项目名称:Darkcore,代码行数:40,
示例11: MoveInLineOfSight void MoveInLineOfSight(Unit *who) { ScriptedAI::MoveInLineOfSight(who); if (who->GetEntry() == NPC_DRAKOS && me->IsWithinDistInMap(who, 10.0f)) { if (Unit *owner = who->GetOwner()) { if (owner->GetTypeId() == TYPEID_PLAYER) { if ((CAST_PLR(owner)->GetQuestStatus(QUEST_DRAKOS1) == QUEST_STATUS_INCOMPLETE) || (CAST_PLR(owner)->GetQuestStatus(QUEST_DRAKOS2) == QUEST_STATUS_INCOMPLETE)) { CAST_PLR(owner)->KilledMonsterCredit(NPC_DRAKOS, me->GetGUID()); } CAST_CRE(who)->ForcedDespawn(); if ((CAST_PLR(owner)->GetQuestStatus(QUEST_DRAKOS1) == QUEST_STATUS_COMPLETE) && (CAST_PLR(owner)->GetQuestStatus(QUEST_DRAKOS2) == QUEST_STATUS_INCOMPLETE)) owner->RemoveAllMinionsByEntry(NPC_DRAKOS); } } } }
开发者ID:Asandru,项目名称:Script-Land,代码行数:22,
示例12: Reset void Reset() { if (pInstance) { //for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i) for (std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) { //Unit* pUnit = Unit::GetUnit(*me, FelCrystals[i]); Unit* pUnit = Unit::GetUnit(*me, *itr); if (pUnit) { if (!pUnit->isAlive()) CAST_CRE(pUnit)->Respawn(); // Let MaNGOS handle setting death state, etc. // Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here. pUnit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } } GameObject* Door = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR)); if (Door) Door->SetGoState(GO_STATE_ACTIVE); // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here) // Small door opened after event are expected to be closed by default // Set Inst data for encounter if (me->isDead()) pInstance->SetData(DATA_SELIN_EVENT, DONE); else pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED); } else error_log(ERROR_INST_DATA); DrainLifeTimer = 3000 + rand()%4000; DrainManaTimer = DrainLifeTimer + 5000; FelExplosionTimer = 2100; DrainCrystalTimer = 10000 + rand()%5000; DrainCrystalTimer = 20000 + rand()%5000; CheckTimer = 1000; IsDraining = false; DrainingCrystal = false; CrystalGUID = 0; }
开发者ID:ShadowCore,项目名称:ShadowCore,代码行数:39,
示例13: ItemUse_item_yehkinyas_bramblebool ItemUse_item_yehkinyas_bramble(Player* player, Item* _Item, SpellCastTargets const& targets){ if (player->GetQuestStatus(3520) == QUEST_STATUS_INCOMPLETE) { Unit* unit_target = targets.getUnitTarget(); if (unit_target && unit_target->GetTypeId() == TYPEID_UNIT && unit_target->isDead() && // cast only on corpse 5307 or 5308 (unit_target->GetEntry() == 5307 || unit_target->GetEntry() == 5308)) { CAST_CRE(unit_target)->RemoveCorpse(); // remove corpse for cancelling second use return false; // all ok } } WorldPacket data(SMSG_CAST_FAILED, (4 + 2)); // prepare packet error message data << uint32(10699); // itemId data << uint8(SPELL_FAILED_BAD_TARGETS); // reason player->GetSession()->SendPacket(&data); // send message: Bad target player->SendEquipError(EQUIP_ERR_NONE, _Item, NULL); // break spell return true;}
开发者ID:Phentora,项目名称:OregonCore,代码行数:22,
示例14: Reset void Reset() { Enraged = false; if (pInstance) { Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_SACROLASH)); if (Temp) { if (Temp->isDead()) { CAST_CRE(Temp)->Respawn(); } else { if (Temp->getVictim()) { me->getThreatManager().addThreat(Temp->getVictim(),0.0f); } } } } if (!me->isInCombat()) { ConflagrationTimer = 45000; BlazeTimer = 100; PyrogenicsTimer = 15000; ShadownovaTimer = 40000; EnrageTimer = 360000; FlamesearTimer = 15000; IntroYellTimer = 10000; SisterDeath = false; } if (pInstance) pInstance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED); }
开发者ID:morno,项目名称:blizzlikecore,代码行数:38,
示例15: Reset void Reset() { InCombat = false; Enraged = false; if(pInstance) { Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_ALYTHESS)); if (Temp) if (Temp->isDead()) { CAST_CRE(Temp)->Respawn(); }else { if(Temp->getVictim()) { me->getThreatManager().addThreat(Temp->getVictim(),0.0f); InCombat = true; } } } if(!InCombat) { ShadowbladesTimer = 10000; ShadownovaTimer = 30000; ConfoundingblowTimer = 25000; ShadowimageTimer = 20000; ConflagrationTimer = 30000; EnrageTimer = 360000; SisterDeath = false; } if(pInstance) pInstance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED); }
开发者ID:Anonymus111,项目名称:chaoscore,代码行数:37,
示例16: UpdateAI void UpdateAI(const uint32 diff) { if (SayTimer <= diff) { if (Event) SayTimer = NextStep(++Step); } else SayTimer -= diff; if (Attack) { Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID); me->SetFaction(14); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); if (pPlayer) { Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); if (Creepjack) { Creepjack->Attack(pPlayer, true); Creepjack->SetFaction(14); Creepjack->GetMotionMaster()->MoveChase(pPlayer); Creepjack->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); if (Malone) { Malone->Attack(pPlayer, true); Malone->SetFaction(14); Malone->GetMotionMaster()->MoveChase(pPlayer); Malone->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } DoStartMovement(pPlayer); AttackStart(pPlayer); } Attack = false; } if ((me->GetHealth() * 100) / me->GetMaxHealth() < 15 && !Done) { Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); if (Creepjack) { CAST_CRE(Creepjack)->AI()->EnterEvadeMode(); Creepjack->SetFaction(1194); Creepjack->GetMotionMaster()->MoveTargetedHome(); Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); if (Malone) { CAST_CRE(Malone)->AI()->EnterEvadeMode(); Malone->SetFaction(1194); Malone->GetMotionMaster()->MoveTargetedHome(); Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFaction(1194); Done = true; DoScriptText(SAY_GIVEUP, me, NULL); me->DeleteThreatList(); me->CombatStop(); me->GetMotionMaster()->MoveTargetedHome(); Player* player = Unit::GetPlayer(*me, PlayerGUID); if (player) player->GroupEventHappens(QUEST_WBI, me); reset_timer = 30000; } if (Done == true && reset_timer <= diff) { Reset(); } else reset_timer -= diff; DoMeleeAttackIfReady(); }
开发者ID:Mystiko,项目名称:OregonCore,代码行数:77,
示例17: UpdateAI void UpdateAI(const uint32 diff) { //Only if not incombat check if the event is started if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) { Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); if (pTarget) { AttackStart(pTarget); } } //Return since we have no target if (!UpdateVictim()) return; //someone evaded! if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) { EnterEvadeMode(); return; } if (!me->HasAura(SPELL_WINDFURY_WEAPON)) { DoCast(me, SPELL_WINDFURY_WEAPON); } //FrostShock_Timer if (FrostShock_Timer <= diff) { DoCast(me->getVictim(), SPELL_FROST_SHOCK); FrostShock_Timer = 25000+rand()%5000; } else FrostShock_Timer -= diff; //Spitfire_Timer if (Spitfire_Timer <= diff) { DoCast(me, SPELL_SPITFIRE_TOTEM); Unit *SpitfireTotem = Unit::GetUnit(*me, CREATURE_SPITFIRE_TOTEM); if (SpitfireTotem) { CAST_CRE(SpitfireTotem)->AI()->AttackStart(me->getVictim()); } Spitfire_Timer = 60000; } else Spitfire_Timer -= diff; //PoisonCleansing_Timer if (PoisonCleansing_Timer <= diff) { DoCast(me, SPELL_POISON_CLEANSING_TOTEM); PoisonCleansing_Timer = 30000; } else PoisonCleansing_Timer -= diff; //Earthbind_Timer if (Earthbind_Timer <= diff) { DoCast(me, SPELL_EARTHBIND_TOTEM); Earthbind_Timer = 45000; } else Earthbind_Timer -= diff; DoMeleeAttackIfReady(); }
开发者ID:FrenchCORE,项目名称:Server,代码行数:64,
示例18: UpdateAI void UpdateAI (const uint32 diff) { //Random movement if (movement_timer <= diff) { uint32 rndpos = rand()%8; me->GetMotionMaster()->MovePoint(1, SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]); movement_timer = 6000; } else movement_timer -= diff; //toxic spores if (bolt_timer <= diff) { Unit* target = NULL; target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (target) { Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000); if (trig) { trig->setFaction(14); trig->CastSpell(trig, SPELL_TOXIC_SPORES, true); } } bolt_timer = 10000+rand()%5000; } else bolt_timer -= diff; //Check_Timer if (Check_Timer <= diff) { if (instance) { //check if vashj is death Unit* Vashj = NULL; Vashj = Unit::GetUnit((*me), instance->GetData64(DATA_LADYVASHJ)); if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashj::boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3)) { //remove me->setDeathState(DEAD); me->RemoveCorpse(); me->setFaction(35); } } Check_Timer = 1000; } else Check_Timer -= diff; }
开发者ID:FirstCore,项目名称:FunCore,代码行数:48,
示例19: KilledUnit void KilledUnit(Unit* who) { Unit* pMalchezaar = Unit::GetUnit(*me, malchezaar); if (pMalchezaar) CAST_CRE(pMalchezaar)->AI()->KilledUnit(who); }
开发者ID:Bootz,项目名称:OpenStage-Project,代码行数:6,
示例20: JustDied void JustDied(Unit*) { if (Creature* Shaffar = me->FindNearestCreature(ENTRY_SHAFFAR, 100)) ((boss_nexusprince_shaffarAI*)(CAST_CRE(Shaffar)->AI()))->RemoveBeaconFromList(me); }
开发者ID:Suwai,项目名称:SunfireCore,代码行数:5,
示例21: OnQuestAccept bool OnQuestAccept(Player* plr, GameObject* go, Quest const* quest) { if (quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) { if (Unit* Anachronos_Quest_Trigger = go->FindNearestCreature(15454, 100, plr)) { Unit *Merithra = Anachronos_Quest_Trigger->SummonCreature(15378, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); Unit *Caelestrasz = Anachronos_Quest_Trigger->SummonCreature(15379, -8032.767f, 1533.148f, 2.61f, 1.5f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); Unit *Arygos = Anachronos_Quest_Trigger->SummonCreature(15380, -8034.52f, 1537.843f, 2.61f, 5.7f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); /* Unit *Fandral = */ Anachronos_Quest_Trigger->SummonCreature(15382, -8028.462f, 1535.843f, 2.61f, 3.141592f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); Creature *Anachronos = Anachronos_Quest_Trigger->SummonCreature(15381, -8028.75f, 1538.795f, 2.61f, 4, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); if (Merithra) { Merithra->SetUInt32Value(UNIT_NPC_FLAGS, 0); Merithra->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); Merithra->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15420); Merithra->setFaction(35); } if (Caelestrasz) { Caelestrasz->SetUInt32Value(UNIT_NPC_FLAGS, 0); Caelestrasz->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); Caelestrasz->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15419); Caelestrasz->setFaction(35); } if (Arygos) { Arygos->SetUInt32Value(UNIT_NPC_FLAGS, 0); Arygos->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); Arygos->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15418); Arygos->setFaction(35); } if (Anachronos) { CAST_AI(npc_anachronos_the_ancient::npc_anachronos_the_ancientAI, Anachronos->AI())->PlayerGUID = plr->GetGUID(); CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->Failed=false; CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->PlayerGUID = plr->GetGUID(); CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->EventStarted=true; CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->Announced=true; } } } return true; }
开发者ID:Bootz,项目名称:SkyFireEMU_420,代码行数:48,
示例22: NextStep uint32 NextStep(uint32 Step) { Unit* arca = Unit::GetUnit(*me, ArcanagosGUID); Map* map = me->GetMap(); switch (Step) { case 0: return 9999999; case 1: me->MonsterYell(SAY_DIALOG_MEDIVH_1, LANG_UNIVERSAL, 0); return 10000; case 2: if (arca) CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_2, LANG_UNIVERSAL, 0); return 20000; case 3: me->MonsterYell(SAY_DIALOG_MEDIVH_3, LANG_UNIVERSAL, 0); return 10000; case 4: if (arca) CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, 0); return 20000; case 5: me->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, 0); return 20000; case 6: if (arca) CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, 0); return 10000; case 7: FireArcanagosTimer = 500; return 5000; case 8: FireMedivhTimer = 500; DoCast(me, SPELL_MANA_SHIELD); return 10000; case 9: me->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false); return 10000; case 10: if (arca) DoCast(arca, SPELL_CONFLAGRATION_BLAST, false); return 1000; case 11: if (arca) CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, 0); return 5000; case 12: arca->GetMotionMaster()->MovePoint(0, -11010.82f, -1761.18f, 156.47f); arca->setActive(true); arca->InterruptNonMeleeSpells(true); arca->SetSpeed(MOVE_FLIGHT, 2.0f); return 10000; case 13: me->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, 0); return 10000; case 14: me->SetVisible(false); me->ClearInCombat(); if (map->IsDungeon()) { InstanceMap::PlayerList const &PlayerList = map->GetPlayers(); for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { if (i->getSource()->isAlive()) { if (i->getSource()->GetQuestStatus(9645) == QUEST_STATUS_INCOMPLETE) i->getSource()->CompleteQuest(9645); } } } return 50000; case 15: arca->DealDamage(arca, arca->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); return 5000; default : return 9999999; } }
开发者ID:Krill156,项目名称:FreyaCore,代码行数:79,
示例23: UpdateAI void UpdateAI(const uint32 diff) { if (SayTimer <= diff) { if (Event) SayTimer = NextStep(++Step); } else SayTimer -= diff; if (Attack) { Player* player = Unit::GetPlayer(*me, PlayerGUID); me->setFaction(14); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); if (player) { Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); if (Creepjack) { Creepjack->Attack(player, true); Creepjack->setFaction(14); Creepjack->GetMotionMaster()->MoveChase(player); Creepjack->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); if (Malone) { Malone->Attack(player, true); Malone->setFaction(14); Malone->GetMotionMaster()->MoveChase(player); Malone->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } DoStartMovement(player); AttackStart(player); } Attack = false; } if (HealthBelowPct(5) && !Done) { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->RemoveAllAuras(); Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); if (Creepjack) { CAST_CRE(Creepjack)->AI()->EnterEvadeMode(); Creepjack->setFaction(1194); Creepjack->GetMotionMaster()->MoveTargetedHome(); Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); if (Malone) { CAST_CRE(Malone)->AI()->EnterEvadeMode(); Malone->setFaction(1194); Malone->GetMotionMaster()->MoveTargetedHome(); Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } me->setFaction(1194); Done = true; Talk(SAY_GIVEUP); me->DeleteThreatList(); me->CombatStop(); me->GetMotionMaster()->MoveTargetedHome(); Player* player = Unit::GetPlayer(*me, PlayerGUID); if (player) CAST_PLR(player)->GroupEventHappens(QUEST_WBI, me); } DoMeleeAttackIfReady(); }
开发者ID:heros,项目名称:LasCore,代码行数:70,
示例24: DoEncounterAction bool DoEncounterAction(Unit *who, bool attack, bool reset, bool checkAllDead) { if (!instance) return false; Creature *Thane = CAST_CRE(Unit::GetUnit(*me, instance->GetData64(DATA_THANE))); Creature *Lady = CAST_CRE(Unit::GetUnit(*me, instance->GetData64(DATA_LADY))); Creature *Baron = CAST_CRE(Unit::GetUnit(*me, instance->GetData64(DATA_BARON))); Creature *Sir = CAST_CRE(Unit::GetUnit(*me, instance->GetData64(DATA_SIR))); if (Thane && Lady && Baron && Sir) { if (attack && who) { CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Thane->AI())->encounterActionAttack = true; CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Lady->AI())->encounterActionAttack = true; CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Baron->AI())->encounterActionAttack = true; CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Sir->AI())->encounterActionAttack = true; CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Thane->AI())->AttackStart( who); CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Lady->AI())->AttackStart( who); CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Baron->AI())->AttackStart( who); CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Sir->AI())->AttackStart( who); } if (reset) { if (instance->GetBossState(BOSS_HORSEMEN) != NOT_STARTED) { if (!Thane->isAlive()) Thane->Respawn(); if (!Lady->isAlive()) Lady->Respawn(); if (!Baron->isAlive()) Baron->Respawn(); if (!Sir->isAlive()) Sir->Respawn(); CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Thane->AI())->encounterActionReset = true; CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Lady->AI())->encounterActionReset = true; CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Baron->AI())->encounterActionReset = true; CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Sir->AI())->encounterActionReset = true; CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Thane->AI())->EnterEvadeMode(); CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Lady->AI())->EnterEvadeMode(); CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Baron->AI())->EnterEvadeMode(); CAST_AI(boss_four_horsemen::boss_four_horsemenAI, Sir->AI())->EnterEvadeMode(); } } if (checkAllDead) return !Thane->isAlive() && !Lady->isAlive() && !Baron->isAlive() && !Sir->isAlive(); } return false; }
开发者ID:dsstest,项目名称:ArkCORE,代码行数:71,
注:本文中的CAST_CRE函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CAST_DOWN函数代码示例 C++ CAST_AI函数代码示例 |