本文整理汇总了C++中SpellDestination::Relocate方法的典型用法代码示例。如果您正苦于以下问题:C++ SpellDestination::Relocate方法的具体用法?C++ SpellDestination::Relocate怎么用?C++ SpellDestination::Relocate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpellDestination
的用法示例。
在下文中一共展示了SpellDestination::Relocate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetDest
void SetDest(SpellDestination& dest)
{
// Adjust effect summon position
Position const offset = { frand(-7.0f, 7.0f), frand(-7.0f, 7.0f), 11.0f, 0.0f };
dest.Relocate(*GetCaster());
dest.RelocateOffset(offset);
}
示例2: ModDestHeight
void ModDestHeight(SpellDestination& dest)
{
Unit* caster = GetCaster();
Position pos = caster->GetPosition();
pos.m_positionZ = caster->GetMap()->GetHeight(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), true, 100.0f);
dest.Relocate(pos);
}
示例3: SetDest
void SetDest(SpellDestination& dest)
{
std::list<Spell::TargetInfo> const* targetsInfo = GetSpell()->GetUniqueTargetInfo();
for (std::list<Spell::TargetInfo>::const_iterator ihit = targetsInfo->begin(); ihit != targetsInfo->end(); ++ihit)
if (Unit* target = ObjectAccessor::GetUnit(*GetCaster(), ihit->targetGUID))
{
dest.Relocate(*target);
if (roll_chance_i(50))
break;
}
}
示例4: SetDest
void SetDest(SpellDestination& dest)
{
// Do our own calculations for the destination position.
/// TODO: Remove this once we find a general rule for WorldObject::MovePosition (this spell shouldn't take the Z change into consideration)
Unit* caster = GetCaster();
float angle = float(rand_norm()) * static_cast<float>(2 * M_PI);
uint32 dist = caster->GetObjectSize() + GetSpellInfo()->GetEffect(EFFECT_0)->CalcRadius(caster) * (float)rand_norm();
float x = caster->GetPositionX() + dist * std::cos(angle);
float y = caster->GetPositionY() + dist * std::sin(angle);
float z = caster->GetMap()->GetHeight(caster->GetPhases(), x, y, caster->GetPositionZ());
float o = dest._position.GetOrientation();
dest.Relocate({ x, y, z, o });
}
示例5: SetDest
void SetDest(SpellDestination& dest)
{
dest.Relocate(TeleportPoint[urand(0, 6)]);
}