コード例 #1
0
ファイル: City_Dalaran.cpp プロジェクト: armm77/AscEmu
        void StartDefense()
        {
            Player* player = getNearestPlayer();
            if (player == nullptr)
                return;

            //Don't do anything with horde players
            if (player->IsTeamHorde())
                return;

            float player_x = player->GetPositionX();
            float player_y = player->GetPositionY();
            float player_z = player->GetPositionZ();

            //hardcoded values...
            // the guards should cast the spell if someone is behind them...
            if (player_x < 5891.88f && player_x >5858.89f && player_y < 594.99f && player_y >565.51f && player_z > 635.0f)
            {
                getCreature()->setTargetGuid(player->getGuid());
                getCreature()->EventCastSpell(player, sSpellCustomizations.GetSpellInfo(54029));
            }
            else
            {
                getCreature()->setTargetGuid(0); //Reset target... ugly
            }
        }
コード例 #2
0
ファイル: City_Dalaran.cpp プロジェクト: armm77/AscEmu
        void StartDefense()
        {
            Player* player = getNearestPlayer();
            if (player == nullptr)
                return;

            //Don't do anything with alliance players
            if (player->IsTeamAlliance())
                return;

            float player_x = player->GetPositionX();
            float player_y = player->GetPositionY();
            float player_z = player->GetPositionZ();

            //hardcoded values...
            // the guards should cast the spell if someone is behind them...
            if (player_x < 5761.9f && player_x >5738.68f && player_y < 732.12f && player_y >712.09f && player_z > 635.0f)
            {
                getCreature()->setTargetGuid(player->getGuid());
                getCreature()->EventCastSpell(player, sSpellCustomizations.GetSpellInfo(54028));
            }
            else
            {
                getCreature()->setTargetGuid(0); //Reset target... ugly
            }
        }
コード例 #3
0
    void OnLoad() override
    {
        getCreature()->addUnitFlags(UNIT_FLAG_IGNORE_PLAYER_COMBAT);

        Player* pTarget = getNearestPlayer();
        if (pTarget != nullptr)
            getCreature()->GetAIInterface()->AttackReaction(pTarget, 50, 0);
    }
コード例 #4
0
 void OnLoad() override
 {
     Player* pTarget = getNearestPlayer();
     if (pTarget != nullptr)
         getCreature()->GetAIInterface()->AttackReaction(pTarget, 50, 0);
 }
コード例 #5
0
 void OnLoad() override
 {
     setRooted(true);
     plr = getNearestPlayer();
 }