本文整理汇总了C++中SpellDestination类的典型用法代码示例。如果您正苦于以下问题:C++ SpellDestination类的具体用法?C++ SpellDestination怎么用?C++ SpellDestination使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SpellDestination类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
{
Creature* creature = GetCaster()->ToCreature();
if (creature)
return;
// Side of the room: WEST > 366.781f (middle of the room) > EAST
float ori = creature->GetPositionY() > 366.781f ? DegToRad(270) : DegToRad(90);
// DB dest has no orientation field (always 0.0f).
dest.RelocateOffset({ 0.0f, 0.0f, 0.0f, ori });
creature->SetHomePosition(dest._position.GetPosition());
}
示例5: 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 });
}
示例6: SetDest
void SetDest(SpellDestination& dest)
{
dest.RelocateOffset({ 0.0f, 0.0f, 30.0f, 0.0f });
}
示例7: SetDest
void SetDest(SpellDestination& dest)
{
dest.Relocate(TeleportPoint[urand(0, 6)]);
}