Jump to content
  • Guardai Update


    Arkadus
    • Status: awaitingdevreply
      Main Category: Script (Eluna / SD3)
      Sub-Category: sd2
      Version: 0.20 Milestone: 20 Priority: Normal
      Implemented Version: 0.20

    as title above

    Guardai.cpp file

    void guardAI::DoReplyToTextEmote(uint32 uiTextEmote, Player* pPlayer)
    {
    float curface = m_creature->GetOrientation();
    switch (uiTextEmote)
    {
    case TEXTEMOTE_KISS:
    m_creature->MovementHaltFaceTo(pPlayer);
    m_creature->HandleEmote(EMOTE_ONESHOT_BOW);
    m_creature->FaceBack(curface, 2000);
    break;
    case TEXTEMOTE_WAVE:
    m_creature->MovementHaltFaceTo(pPlayer);
    m_creature->HandleEmote(EMOTE_ONESHOT_WAVE);
    m_creature->FaceBack(curface, 2000);
    break;
    case TEXTEMOTE_SALUTE:
    m_creature->MovementHaltFaceTo(pPlayer);
    m_creature->HandleEmote(EMOTE_ONESHOT_SALUTE);
    m_creature->FaceBack(curface, 1500);
    break;
    case TEXTEMOTE_SHY:
    m_creature->MovementHaltFaceTo(pPlayer);
    m_creature->HandleEmote(EMOTE_ONESHOT_FLEX);
    m_creature->FaceBack(curface, 2400);
    break;
    case TEXTEMOTE_RUDE:
    case TEXTEMOTE_CHICKEN:
    m_creature->MovementHaltFaceTo(pPlayer);
    m_creature->HandleEmote(EMOTE_ONESHOT_POINT);
    m_creature->FaceBack(curface, 2400);
    break;
    }
    }

    void guardAI_orgrimmar::ReceiveEmote(Player* pPlayer, uint32 uiTextEmote)
    {
    if (pPlayer->GetTeam() == HORDE)
    {
    DoReplyToTextEmote(uiTextEmote, pPlayer);
    }
    }

    void guardAI_ironforge::ReceiveEmote(Player* pPlayer, uint32 uiTextEmote)
    {
    if (pPlayer->GetTeam() == ALLIANCE)
    {
    DoReplyToTextEmote(uiTextEmote, pPlayer);
    }
    }

    void guardAI_stormwind::ReceiveEmote(Player* pPlayer, uint32 uiTextEmote)
    {
    if (pPlayer->GetTeam() == ALLIANCE)
    {
    DoReplyToTextEmote(uiTextEmote, pPlayer);
    }
    }


    Guardai.h file

    struct guardAI : public ScriptedAI
    {
    public:
    explicit guardAI(Creature* pCreature);
    ~guardAI() {}

    uint32 m_uiGlobalCooldown; // This variable acts like the global cooldown that players have (1.5 seconds)
    uint32 m_uiBuffTimer; // This variable keeps track of buffs

    void Reset() override;

    void Aggro(Unit* pWho) override;

    void JustDied(Unit* /*pKiller*/) override;

    void UpdateAI(const uint32 uiDiff) override;

    // Commonly used for guards in main cities
    void DoReplyToTextEmote(uint32 uiTextEmote, Player* pPlayer);
    };

    struct guardAI_ironforge : public guardAI
    {
    guardAI_ironforge(Creature* pCreature) : guardAI(pCreature) {}

    void ReceiveEmote(Player* pPlayer, uint32 uiTextEmote) override;
    };

    struct guardAI_orgrimmar : public guardAI
    {
    guardAI_orgrimmar(Creature* pCreature) : guardAI(pCreature) {}

    void ReceiveEmote(Player* pPlayer, uint32 uiTextEmote) override;
    };

    struct guardAI_stormwind : public guardAI
    {
    guardAI_stormwind(Creature* pCreature) : guardAI(pCreature) {}

    void ReceiveEmote(Player* pPlayer, uint32 uiTextEmote) override;
    };


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use