Example #1
0
    public void DoAction()
    {
        bool show_message = ActionInfo.show_message;

        string text_statType = Localization.Get("StatType_" + ActionInfo.statType);

        switch (ActionInfo.actionType)
        {
        case eActionType.stun:
        case eActionType.hidden:
        case eActionType.sleep:
            m_Creature.CancelAction(false);
            break;

        case eActionType.shield:
        case eActionType.immune:
        case eActionType.provoke:
            break;

        case eActionType.buff:
            if (show_message)
            {
                if (StatInfo.IsPercentValue(ActionInfo.statType) == true)
                {
                    TextManager.Instance.PushMessage(m_Creature, string.Format("{0} +{1}%", text_statType, Value / 100), eBuffColorType.Buff, eTextPushType.Normal);
                }
                else
                {
                    TextManager.Instance.PushMessage(m_Creature, string.Format("{0} +{1}", text_statType, Value), eBuffColorType.Buff, eTextPushType.Normal);
                }
            }
            break;

        case eActionType.buff_percent:
            if (show_message)
            {
                TextManager.Instance.PushMessage(m_Creature, string.Format("{0} +{1:p0}", text_statType, (float)Value / 10000), eBuffColorType.Buff, eTextPushType.Normal);
            }
            break;

        case eActionType.debuff:
            if (show_message)
            {
                if (StatInfo.IsPercentValue(ActionInfo.statType) == true)
                {
                    TextManager.Instance.PushMessage(m_Creature, string.Format("{0} -{1}%", text_statType, -Value / 100), eBuffColorType.DeBuff, eTextPushType.Normal);
                }
                else
                {
                    TextManager.Instance.PushMessage(m_Creature, string.Format("{0} -{1}", text_statType, -Value), eBuffColorType.DeBuff, eTextPushType.Normal);
                }
            }
            break;

        case eActionType.debuff_percent:
            if (show_message)
            {
                TextManager.Instance.PushMessage(m_Creature, string.Format("{0} -{1:p0}", text_statType, -(float)Value / 10000), eBuffColorType.DeBuff, eTextPushType.Normal);
            }
            break;
        }
    }