本文整理汇总了C++中Map::CreatureRelocation方法的典型用法代码示例。如果您正苦于以下问题:C++ Map::CreatureRelocation方法的具体用法?C++ Map::CreatureRelocation怎么用?C++ Map::CreatureRelocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map::CreatureRelocation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TeleportToMyBrother
void TeleportToMyBrother()
{
if (!pInstance)
return;
Teleport_Timer = TELEPORTTIME;
if (IAmVeklor())
return; // mechanics handled by veknilash so they teleport exactly at the same time and to correct coordinates
Creature *pOtherBoss = GetOtherBoss();
if (pOtherBoss)
{
//me->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0);
float other_x = pOtherBoss->GetPositionX();
float other_y = pOtherBoss->GetPositionY();
float other_z = pOtherBoss->GetPositionZ();
float other_o = pOtherBoss->GetOrientation();
Map *thismap = me->GetMap();
thismap->CreatureRelocation(pOtherBoss, me->GetPositionX(),
me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
thismap->CreatureRelocation(me, other_x, other_y, other_z, other_o);
SetAfterTeleport();
CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->SetAfterTeleport();
}
}
示例2: JustDied
void JustDied(Unit* pKiller)
{
Map* pMap = m_creature->GetMap();
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
itr->getSource()->KilledMonsterCredit(NPC_EREGOS);
pMap->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()-100.0f, 0);
m_creature->MonsterMoveWithSpeed(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()-100.0f, 26);
DoScriptText(SAY_DEATH, m_creature);
if (m_pInstance)
m_pInstance->SetData(TYPE_EREGOS, DONE);
}
示例3: UpdateAI
void UpdateAI(const uint32 diff)
{
if (Must_Die)
{
if (Must_Die_Timer <= diff)
{
me->DespawnOrUnsummon();
return;
} else Must_Die_Timer -= diff;
}
if (!Escape)
{
if (!PlayerGUID)
return;
if (spellEscape_Timer <= diff)
{
DoCast(me, SPELL_RIZZLE_ESCAPE, false);
spellEscape_Timer = 10000;
} else spellEscape_Timer -= diff;
if (Teleport_Timer <= diff)
{
//temp solution - unit can't be teleported by core using spelleffect 5, only players
Map* map = me->GetMap();
if (map)
{
map->CreatureRelocation(me, 3706.39f, -3969.15f, 35.9118f, 0);
me->AI_SendMoveToPacket(3706.39f, -3969.15f, 35.9118f, 0, 0, 0);
}
//begin swimming and summon depth charges
Player* player = Unit::GetPlayer(*me, PlayerGUID);
SendText(MSG_ESCAPE_NOTICE, player);
DoCast(me, SPELL_PERIODIC_DEPTH_CHARGE);
me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
me->SetSpeed(MOVE_RUN, 0.85f, true);
me->GetMotionMaster()->MovementExpired();
me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]);
Escape = true;
} else Teleport_Timer -= diff;
return;
}
if (ContinueWP)
{
me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]);
ContinueWP = false;
}
if (Grenade_Timer <= diff)
{
Player* player = Unit::GetPlayer(*me, PlayerGUID);
if (player)
{
DoScriptText(SAY_RIZZLE_GRENADE, me, player);
DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true);
}
Grenade_Timer = 30000;
} else Grenade_Timer -= diff;
if (Check_Timer <= diff)
{
Player* player = Unit::GetPlayer(*me, PlayerGUID);
if (!player)
{
me->DespawnOrUnsummon();
return;
}
if (me->IsWithinDist(player, 10) && me->GetPositionX() > player->GetPositionX() && !Reached)
{
DoScriptText(SAY_RIZZLE_FINAL, me);
me->SetUInt32Value(UNIT_NPC_FLAGS, 1);
me->setFaction(35);
me->GetMotionMaster()->MoveIdle();
me->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE);
Reached = true;
}
Check_Timer = 1000;
} else Check_Timer -= diff;
}