Çözülemedi Ünvan Sistemi g++8 uyarlama

  • Konuyu açan Konuyu açan MEKA
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 23
  • Gösterim Gösterim 2K
Ne yazık ki bu konuda sorulara çözüm bulunmuyor. Eğer konuda yorumlar varsa hepsini inceleyebilirsiniz. Belki sizlerin sorununuzu çözmek için için ipuçları bulabilirsiniz.
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.

MEKA

Discord: mekaprojects
Süper Moderatör
Grafiker
Geliştirici
Yardımsever Üye
Mesaj
2.855
Çözümler
299
Beğeni
2.140
Puan
1.850
Ticaret Puanı
2
Yabancı bir arkadaşımın sunucusuna Ünvan Sistemi ekliyorum Sürümden kaynaklı düzenlemeler yapılması gerekiyor yardımlarınızı bekliyorum

Kod:
Genişlet Daralt Kopyala
title.cpp:100:29: error: 'PRESTIGE_AFFECT_1' was not declared in this scope
int get_affect_premium[] = {PRESTIGE_AFFECT_1, PRESTIGE_AFFECT_2, PRESTIGE_AFFECT_3};
                             ^~~~~~~~~~~~~~~~~
title.cpp:100:29: note: suggested alternative: 'USE_AFFECT'
int get_affect_premium[] = {PRESTIGE_AFFECT_1, PRESTIGE_AFFECT_2, PRESTIGE_AFFECT_3};
                             ^~~~~~~~~~~~~~~~~
                             USE_AFFECT
title.cpp:100:48: error: 'PRESTIGE_AFFECT_2' was not declared in this scope
int get_affect_premium[] = {PRESTIGE_AFFECT_1, PRESTIGE_AFFECT_2, PRESTIGE_AFFECT_3};
                                                ^~~~~~~~~~~~~~~~~
title.cpp:100:48: note: suggested alternative: 'USE_AFFECT'
int get_affect_premium[] = {PRESTIGE_AFFECT_1, PRESTIGE_AFFECT_2, PRESTIGE_AFFECT_3};
                                                ^~~~~~~~~~~~~~~~~
                                                USE_AFFECT
title.cpp:100:67: error: 'PRESTIGE_AFFECT_3' was not declared in this scope
int get_affect_premium[] = {PRESTIGE_AFFECT_1, PRESTIGE_AFFECT_2, PRESTIGE_AFFECT_3};
                                                                   ^~~~~~~~~~~~~~~~~
title.cpp:100:67: note: suggested alternative: 'USE_AFFECT'
int get_affect_premium[] = {PRESTIGE_AFFECT_1, PRESTIGE_AFFECT_2, PRESTIGE_AFFECT_3};
                                                                   ^~~~~~~~~~~~~~~~~
                                                                   USE_AFFECT
title.cpp: In member function 'bool TitleManager::TransformTitle(LPCHARACTER)':
title.cpp:156:14: error: 'class CHARACTER' has no member named 'GetRealTitle'; did you mean 'GetBeadTime'?
  switch (ch->GetRealTitle())
              ^~~~~~~~~~~~
              GetBeadTime
title.cpp:164:9: error: 'class CHARACTER' has no member named 'UpdateTitle'; did you mean 'UpdatePacket'?
     ch->UpdateTitle(- ch->GetRealTitle());
         ^~~~~~~~~~~
         UpdatePacket
title.cpp:164:27: error: 'class CHARACTER' has no member named 'GetRealTitle'; did you mean 'GetBeadTime'?
     ch->UpdateTitle(- ch->GetRealTitle());
                           ^~~~~~~~~~~~
                           GetBeadTime
title.cpp:176:9: error: 'class CHARACTER' has no member named 'UpdateTitle'; did you mean 'UpdatePacket'?
     ch->UpdateTitle(- ch->GetRealTitle());
         ^~~~~~~~~~~
         UpdatePacket
title.cpp:176:27: error: 'class CHARACTER' has no member named 'GetRealTitle'; did you mean 'GetBeadTime'?
     ch->UpdateTitle(- ch->GetRealTitle());
                           ^~~~~~~~~~~~
                           GetBeadTime
title.cpp:188:9: error: 'class CHARACTER' has no member named 'UpdateTitle'; did you mean 'UpdatePacket'?
     ch->UpdateTitle(- ch->GetRealTitle());
         ^~~~~~~~~~~
         UpdatePacket
title.cpp:188:27: error: 'class CHARACTER' has no member named 'GetRealTitle'; did you mean 'GetBeadTime'?
     ch->UpdateTitle(- ch->GetRealTitle());
                           ^~~~~~~~~~~~
                           GetBeadTime
title.cpp: In member function 'void TitleManager::BuyPotion(LPCHARACTER, const char*)':
title.cpp:229:3: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
   else
   ^~~~
title.cpp:231:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
    DBManager::instance().DirectQuery("UPDATE account.account SET cash = cash - %u WHERE id = %u", sPotionPrice[0], ch->GetDesc()->GetAccountTable().id);
    ^~~~~~~~~
title.cpp:260:3: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
   else
   ^~~~
title.cpp:262:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
    DBManager::instance().DirectQuery("UPDATE account.account SET cash = cash - %u WHERE id = %u", sPotionPrice[1], ch->GetDesc()->GetAccountTable().id);
    ^~~~~~~~~
title.cpp:291:3: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
   else
   ^~~~
title.cpp:293:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
    DBManager::instance().DirectQuery("UPDATE account.account SET cash = cash - %u WHERE id = %u", sPotionPrice[2], ch->GetDesc()->GetAccountTable().id);
    ^~~~~~~~~
title.cpp: In function 'bool GetMoney(LPCHARACTER, int)':
title.cpp:358:20: warning: comparison of integer expressions of different signedness: 'uint64_t' {aka 'long long unsigned int'} and 'int' [-Wsign-compare]
  if (ch->GetGold() < sGold)
      ~~~~~~~~~~~~~~^~~~~~~
title.cpp: In function 'bool GetTitlePremium(LPCHARACTER)':
title.cpp:381:14: error: 'class CHARACTER' has no member named 'GetRealTitle'; did you mean 'GetBeadTime'?
  switch (ch->GetRealTitle())
              ^~~~~~~~~~~~
              GetBeadTime
title.cpp: In function 'bool GetTitleActual(LPCHARACTER, int)':
title.cpp:400:10: error: 'class CHARACTER' has no member named 'GetRealTitle'; did you mean 'GetBeadTime'?
  if (ch->GetRealTitle() == arg1)
          ^~~~~~~~~~~~
          GetBeadTime
title.cpp: In member function 'bool TitleManager::UpdateTitle(LPCHARACTER, int, int)':
title.cpp:424:7: error: 'class CHARACTER' has no member named 'UpdateTitle'; did you mean 'UpdatePacket'?
   ch->UpdateTitle(changeTitle - ch->GetTitle());
       ^~~~~~~~~~~
       UpdatePacket
title.cpp:424:37: error: 'class CHARACTER' has no member named 'GetTitle'; did you mean 'GetType'?
   ch->UpdateTitle(changeTitle - ch->GetTitle());
                                     ^~~~~~~~
                                     GetType
title.cpp:425:19: error: 'POINT_GOLD' was not declared in this scope
   ch->PointChange(POINT_GOLD, - changeMoney);
                   ^~~~~~~~~~
title.cpp:425:19: note: suggested alternative: 'POINT_NONE'
   ch->PointChange(POINT_GOLD, - changeMoney);
                   ^~~~~~~~~~
                   POINT_NONE
title.cpp:429:7: error: 'class CHARACTER' has no member named 'UpdateTitle'; did you mean 'UpdatePacket'?
   ch->UpdateTitle(changeTitle - ch->GetTitle());
       ^~~~~~~~~~~
       UpdatePacket
title.cpp:429:37: error: 'class CHARACTER' has no member named 'GetTitle'; did you mean 'GetType'?
   ch->UpdateTitle(changeTitle - ch->GetTitle());
                                     ^~~~~~~~
                                     GetType
title.cpp: In member function 'void TitleManager::SetAffect(LPCHARACTER, const char*)':
title.cpp:452:3: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
   else
   ^~~~
title.cpp:454:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
    return;
    ^~~~~~
title.cpp:467:3: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
   else
   ^~~~
title.cpp:469:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
    return;
    ^~~~~~
title.cpp: In member function 'bool TitleManager::SetTitle(LPCHARACTER, const char*)':
title.cpp:506:7: error: 'class CHARACTER' has no member named 'UpdateTitle'; did you mean 'UpdatePacket'?
   ch->UpdateTitle(- ch->GetTitle());
       ^~~~~~~~~~~
       UpdatePacket
title.cpp:506:25: error: 'class CHARACTER' has no member named 'GetTitle'; did you mean 'GetType'?
   ch->UpdateTitle(- ch->GetTitle());
                         ^~~~~~~~
                         GetType

C++:
Genişlet Daralt Kopyala
/*********************************************************************
* date        : 2016.07.16
* file        : title.cpp
* author      : VegaS
* description :
*/
#include "stdafx.h"
#include "constants.h"
#include "utils.h"
#include "desc.h"
#include "char.h"
#include "db.h"
#include "config.h"
#include "title.h"
#include "affect.h"
#include "item.h"
#include "questmanager.h"
/*********************************************************************
*/
TitleManager::TitleManager()
{
}

TitleManager::~TitleManager()
{
}
/*****************************
* Set requirements gold(yang) for title
*/
#define need_gold_1        500000
#define need_gold_2        800000
#define need_gold_3        1500000
#define need_gold_4        1800000
#define need_gold_5        2500000
#define need_gold_6        3000000
#define need_gold_7        4000000
#define need_gold_8        5000000
#define need_gold_9        10000000
#define need_gold_10    15000000
#define need_gold_11    25000000
#define need_gold_12    50000000
#define need_gold_13    75000000
#define need_gold_14    100000000
#define need_gold_15    150000000
#define need_gold_16    300000000

/*****************************
* Set requirements level for title
*/
#define need_level_1    7
#define need_level_2    14
#define need_level_3    21
#define need_level_4    28
#define need_level_5    35
#define need_level_6    42
#define need_level_7    49
#define need_level_8    56
#define need_level_9    63
#define need_level_10    70
#define need_level_11    77
#define need_level_12    84
#define need_level_13    91
#define need_level_14    98
#define need_level_15    100
#define need_level_16    103

/*****************************
* Set requirements level for playTime on character
*/
#define need_minutes_1    5
#define need_minutes_2    15
#define need_minutes_3    40
#define need_minutes_4    50                                               
#define need_minutes_5    60
#define need_minutes_6    75
#define need_minutes_7    90
#define need_minutes_8    110
#define need_minutes_9    130
#define need_minutes_10    150
#define need_minutes_11    170
#define need_minutes_12    200
#define need_minutes_13    500
#define need_minutes_14    700
#define need_minutes_15    1200
#define need_minutes_16    1500
#include <boost/unordered_map.hpp>
#include "../../common/stl.h"
/****************************************************************************************************************************************************************************************
* Get enable options
*/
#define ENABLE_CHECK_TIME_POTIONS // If you want to make enable check for buy potions with time
//#define ENABLE_GIVE_JCOINS // Enable to give you jcoins loadead from account.account(jcoins [row]) example: if u buy a potion yeelow cost 50coins, when you buy give make: -50 cash and give +50 jcoins

int sTitle[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; // Do not change anything here

unsigned int x[] = {0, 0, 0}; // Do not change anything here
/****************
* Get type affect on title premium loaded from affect.h ( not change this )
*/
int get_affect_premium[] = {PRESTIGE_AFFECT_1, PRESTIGE_AFFECT_2, PRESTIGE_AFFECT_3};

/****************
* Settings how hours you need to wait for can buy again potion on shopping-area
*/
int sPotionTime[] = {12, 12, 12};
/****************
* ItemVnum for potions to check if u have for attached title premium 1/2/3
*/
int sPotionVnum[] = {55001, 55002, 55003};
/****************
* Price potions in cash value loaded from account.account for potion yellow/pink/white
*/
unsigned int sPotionPrice[] = {50, 100, 150};

int    sTimeDuratingBonus[] = {60*60*24*365};
/****************
* Table with bonus name affect ( if u want to change bonus you can find in enum EPointTypes on char.h other bonus type )
* If u want you can put automatically value from bonus like - POINTS_ATTBONUS_MONSTER = 63 and , 20 is value for bonus monster apply
*/
int pTitleBonus_1[] = {POINT_MAX_HP, 3000};
int pTitleBonus_2[] = {POINT_ATTBONUS_MONSTER, 20};
int pTitleBonus_3[] = {POINT_CRITICAL_PCT, 15};

const char* sPotionFlag[] = {"title.getTimePotions_1", "title.getTimePotions_2", "title.getTimePotions_3"}; // Do not change anything here

/****************
* Settings for translate
*/
const char* requirements[] = {
                                    "[نظام الالقاب] يجب ان تمتلك اليانغ الكافي %u !",
                                    "[نظام الالقاب] يجب ان تصل الى هاذا المستوى %u للحصول على اللقب!",
                                    "[نظام الالقاب] ساعات اللعب قليلة: %u"};
const char* title_translate[] = {
                                    "[نظام الالقاب] يجب ان تنتظر %u ساعة لشراء جرعة سحرية!",
                                    "[نظام الالقاب] لا تمتلك نقود تنين!",
                                    "[نظام الالقاب] لقد تلقيت العلاوة و اختفى اللقب السابق !",
                                    "[نظام الالقاب] لقد تم حذف اللقب وحصلت على جرعة سحر صفراء واحدة!",
                                    "[نظام الالقاب] لقد تم حذف اللقب وحصلت على جرعة سحر وردية واحدة!",
                                    "[نظام الالقاب] لقد تم حذف اللقب وحصلت على جرعة سحر بيضاء واحدة!",
                                    "[نظام الالقاب] انت لا تمتلك لقب مميز لتفعل هاذا!",
                                    "[نظام الالقاب] لديك لقب مميز لا يمكن فعل هاذا الشي!",
                                    "[نظام الالقاب] انت بالفعل تمتلك هاذا اللقب!",
                                    "[نظام الالقاب] يجب ان يكون لديك جرعة سحر صفراء واحدة!",
                                    "[نظام الالقاب] يجب ان يكون لديك جرعة سحر وردية واحدة!",
                                    "[نظام الالقاب] يجب ان يكون لديك جرعة سحر بيضاء واحدة!",
                                    "[نظام الالقاب] لقد تمت ازالة لقبك!"};

bool TitleManager::TransformTitle(LPCHARACTER ch)
{
    if (NULL == ch)
        return false;

    if (!ch->IsPC())
        return false;

    switch (ch->GetRealTitle())
    {
        case 17:
            if (ch->FindAffect(get_affect_premium[0]))
            {
                ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[2]);   
                ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[3]);
                ch->RemoveAffect(get_affect_premium[0]);
                ch->UpdateTitle(- ch->GetRealTitle());
                ch->AutoGiveItem(sPotionVnum[0]);
            }
            else if (!ch->FindAffect(get_affect_premium[0])){
                return false; ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[6]);}
                break;
        case 18:
            if (ch->FindAffect(get_affect_premium[1]))
            {
                ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[2]);   
                ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[4]);
                ch->RemoveAffect(get_affect_premium[1]);
                ch->UpdateTitle(- ch->GetRealTitle());
                ch->AutoGiveItem(sPotionVnum[1]);
            }
            else if (!ch->FindAffect(get_affect_premium[0])){
                return false; ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[6]);}
                break;
        case 19:
            if (ch->FindAffect(get_affect_premium[2]))
            {
                ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[2]);   
                ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[5]);
                ch->RemoveAffect(get_affect_premium[2]);
                ch->UpdateTitle(- ch->GetRealTitle());
                ch->AutoGiveItem(sPotionVnum[2]);
            }
            else if (!ch->FindAffect(get_affect_premium[0])){
                return false; ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[6]);}
                break;
        }
    return true;
}

void TitleManager::BuyPotion(LPCHARACTER ch, const char* mPotion)
{
    if (NULL == ch)
        return;

    if (!ch->IsPC())
        return;

    if (!*mPotion)
    {
        return;
    }
/****************
* Argument first
*/
    if (!strcmp(mPotion, "buy_potion_1"))
    {
        std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT cash FROM account.account WHERE id = %u", ch->GetDesc()->GetAccountTable().id));
        quest::PC* pPC = quest::CQuestManager::instance().GetPC(ch->GetPlayerID());
        if (pMsg->Get()->uiNumRows == x[0])    return;
            MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
            str_to_number(x[0], row[0]);
    #ifdef ENABLE_CHECK_TIME_POTIONS   
        int szTime = pPC->GetFlag(sPotionFlag[0]);
        if (get_global_time() - szTime < sPotionTime[0] * 60 * 60)
        {
            ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[0], sPotionTime[2]);    return;
        }   
    #endif
        if (x[0] < sPotionPrice[0])    {
            ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[1]);    return;    }
        else
            ch->AutoGiveItem(sPotionVnum[0]);
            DBManager::instance().DirectQuery("UPDATE account.account SET cash = cash - %u WHERE id = %u", sPotionPrice[0], ch->GetDesc()->GetAccountTable().id);
        #ifdef ENABLE_CHECK_TIME_POTIONS   
            pPC->SetFlag(sPotionFlag[0], get_global_time());
        #endif   
   
        #ifdef ENABLE_GIVE_JCOINS
            DBManager::instance().DirectQuery("UPDATE account.account SET jcoins = jcoins + %u WHERE id = %u", sPotionPrice[0], ch->GetDesc()->GetAccountTable().id);
        #endif       
        }
//}   
/****************
* Argument two
*/
    if (!strcmp(mPotion, "buy_potion_2"))
    {
        std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT cash FROM account.account WHERE id = %u", ch->GetDesc()->GetAccountTable().id));
        quest::PC* pPC = quest::CQuestManager::instance().GetPC(ch->GetPlayerID());
        if (pMsg->Get()->uiNumRows == x[1])    return;
            MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
            str_to_number(x[1], row[0]);
    #ifdef ENABLE_CHECK_TIME_POTIONS   
        int szTime = pPC->GetFlag(sPotionFlag[0]);
        if (get_global_time() - szTime < sPotionTime[0] * 60 * 60)
        {
            ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[0], sPotionTime[2]);    return;
        }   
    #endif
        if (x[1] < sPotionPrice[1])    {
            ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[1]);    return;    }
        else
            ch->AutoGiveItem(sPotionVnum[1]);
            DBManager::instance().DirectQuery("UPDATE account.account SET cash = cash - %u WHERE id = %u", sPotionPrice[1], ch->GetDesc()->GetAccountTable().id);
        #ifdef ENABLE_CHECK_TIME_POTIONS   
            pPC->SetFlag(sPotionFlag[1], get_global_time());
        #endif   
   
        #ifdef ENABLE_GIVE_JCOINS
            DBManager::instance().DirectQuery("UPDATE account.account SET jcoins = jcoins + %u WHERE id = %u", sPotionPrice[1], ch->GetDesc()->GetAccountTable().id);
        #endif   
    }
//}
/****************
* Argument three
*/
    if (!strcmp(mPotion, "buy_potion_3"))
    {
        std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT cash FROM account.account WHERE id = %u", ch->GetDesc()->GetAccountTable().id));
        quest::PC* pPC = quest::CQuestManager::instance().GetPC(ch->GetPlayerID());
        if (pMsg->Get()->uiNumRows == x[2])    return;
            MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
            str_to_number(x[2], row[0]);
    #ifdef ENABLE_CHECK_TIME_POTIONS   
        int szTime = pPC->GetFlag(sPotionFlag[0]);
        if (get_global_time() - szTime < sPotionTime[0] * 60 * 60)
        {
            ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[0], sPotionTime[2]);    return;
        }   
    #endif
        if (x[2] < sPotionPrice[2])    {
            ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[1]);    return;    }
        else
            ch->AutoGiveItem(sPotionVnum[2]);
            DBManager::instance().DirectQuery("UPDATE account.account SET cash = cash - %u WHERE id = %u", sPotionPrice[2], ch->GetDesc()->GetAccountTable().id);
        #ifdef ENABLE_CHECK_TIME_POTIONS   
            pPC->SetFlag(sPotionFlag[0], get_global_time());
        #endif   
   
        #ifdef ENABLE_GIVE_JCOINS
            DBManager::instance().DirectQuery("UPDATE account.account SET jcoins = jcoins + %u WHERE id = %u", sPotionPrice[2], ch->GetDesc()->GetAccountTable().id);
        #endif
    }
}

static bool GetPlayTime(LPCHARACTER ch, int sTime)
{
    if (NULL == ch)
        return false;

    if (!ch->IsPC())
        return false;

    if (ch->GetRealPoint(POINT_PLAYTIME) < sTime)
    {
        switch (sTime)
        {
            case need_minutes_1:        case need_minutes_2:    case need_minutes_3:    case need_minutes_4:
            case need_minutes_5:        case need_minutes_6:    case need_minutes_7:    case need_minutes_8:   
            case need_minutes_9:        case need_minutes_10:    case need_minutes_11:    case need_minutes_12:   
            case need_minutes_13:        case need_minutes_14:    case need_minutes_15:    case need_minutes_16:
                ch->ChatPacket(CHAT_TYPE_NOTICE, requirements[2], sTime);
                return false;
        }
    }
        return true;
}

static bool GetLevel(LPCHARACTER ch, int sLevel)
{
    if (NULL == ch)
        return false;

    if (!ch->IsPC())
        return false;

    if (ch->GetLevel() < sLevel)
    {
        switch (sLevel)
        {
            case need_level_1:        case need_level_2:    case need_level_3:    case need_level_4:
            case need_level_5:        case need_level_6:    case need_level_7:    case need_level_8:   
            case need_level_9:        case need_level_10:    case need_level_11:    case need_level_12:   
            case need_level_13:        case need_level_14:    case need_level_15:    case need_level_16:
                ch->ChatPacket(CHAT_TYPE_NOTICE, requirements[1], sLevel);
                return false;
        }
    }
        return true;
}

static bool GetMoney(LPCHARACTER ch, int sGold)
{
    if (NULL == ch)
        return false;

    if (!ch->IsPC())
        return false;

    if (ch->GetGold() < sGold)
    {
        switch (sGold)
        {
            case need_gold_1:    case need_gold_2:    case need_gold_3:    case need_gold_4:
            case need_gold_5:    case need_gold_6:    case need_gold_7:    case need_gold_8:
            case need_gold_9:    case need_gold_10:    case need_gold_11:    case need_gold_12:
            case need_gold_13:    case need_gold_14:    case need_gold_15:    case need_gold_16:
                ch->ChatPacket(CHAT_TYPE_NOTICE, requirements[0], sGold);
                return false;
        }
    }
        return true;
}

static bool GetTitlePremium(LPCHARACTER ch)
{
    if (NULL == ch)
        return false;

    if (!ch->IsPC())
        return false;

    switch (ch->GetRealTitle())
    {
        case 17:
        case 18:
        case 19:
            ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[7]);
            return false;
    }
        return true;
}

static bool GetTitleActual(LPCHARACTER ch, int arg1)
{
    if (NULL == ch)
        return false;

    if (!ch->IsPC())
        return false;

    if (ch->GetRealTitle() == arg1)
    {   
        switch (arg1)
        {
            case 1:        case 2:        case 3:        case 4:
            case 5:        case 6:        case 7:        case 8:
            case 9:        case 10:    case 11:    case 12:
            case 13:    case 14:    case 15:    case 16:
            case 17:    case 18:    case 19:       
                ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[8]);
                return false;
        }
    }
        return true;
}

bool TitleManager::UpdateTitle(LPCHARACTER ch, int changeTitle, int changeMoney)
{

    if (!ch)
        return false;

    if (changeTitle > 0 && changeMoney > 0)
    {
        ch->UpdateTitle(changeTitle - ch->GetTitle());
        ch->PointChange(POINT_GOLD, - changeMoney);
    }
    else if (changeTitle > 0 && changeMoney < 1)
    {
        ch->UpdateTitle(changeTitle - ch->GetTitle());
    }
    return true;
}

void TitleManager::SetAffect(LPCHARACTER ch, const char* valueAffect)
{
    if (NULL == ch)
        return;

    if (!ch->IsPC())
        return;
/****************
* [Premium Title I]
*/           
    if (!strcmp(valueAffect, "send_premium_1"))
    {
        if (ch->CountSpecifyItem(sPotionVnum[0]))
        {
            ch->AddAffect(get_affect_premium[0], pTitleBonus_1[0], pTitleBonus_1[1], 0, sTimeDuratingBonus[0], 0, true);
            ch->RemoveSpecifyItem(sPotionVnum[0], 1);
            UpdateTitle(ch, sTitle[17], 0);
        }   
        else
            ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[9]);
            return;
    }
/****************
* [Premium Title II]
*/   
    if (!strcmp(valueAffect, "send_premium_2"))
    {
        if (ch->CountSpecifyItem(sPotionVnum[1]))
        {   
            ch->AddAffect(get_affect_premium[1], pTitleBonus_2[0], pTitleBonus_2[1], 0, sTimeDuratingBonus[0], 0, true);
            ch->RemoveSpecifyItem(sPotionVnum[1], 1);
            UpdateTitle(ch, sTitle[18], 0);
        }   
        else
            ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[10]);
            return;
    }
/****************
* [Premium Title III]
*/   
    if (!strcmp(valueAffect, "send_premium_3"))
    {
        if (ch->CountSpecifyItem(sPotionVnum[2]))
        {   
                ch->AddAffect(get_affect_premium[2], pTitleBonus_3[0], pTitleBonus_3[1], 0, sTimeDuratingBonus[0], 0, true);
                ch->RemoveSpecifyItem(sPotionVnum[2], 1);
                UpdateTitle(ch, sTitle[19], 0);
        }   
        else
        {
            ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[11]);
            return;
        }
    }
}
bool TitleManager::SetTitle(LPCHARACTER ch, const char* pTitle)
{
    if (NULL == ch)
        return false;

    if (!ch->IsPC())
        return false;

    if (!*pTitle)
    {
        return false;
    }
/****************
* Title  free
*/
    if (!strcmp(pTitle, "disable")    && (GetTitleActual(ch, sTitle[17]) == true) && (GetTitleActual(ch, sTitle[18]) == true) && (GetTitleActual(ch, sTitle[19]) == true))
    {   
        ch->UpdateTitle(- ch->GetTitle());
        ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[12]);
    }

    if (!strcmp(pTitle, "title1") && (GetLevel(ch, need_level_1) == true) && (GetPlayTime(ch, need_minutes_1) == true) && (GetMoney(ch, need_gold_1) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[1]) == true))
    {
            UpdateTitle(ch, sTitle[1], need_gold_1);
    }

    if (!strcmp(pTitle, "title2") && (GetLevel(ch, need_level_2) == true) && (GetPlayTime(ch, need_minutes_2) == true) && (GetMoney(ch, need_gold_2) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[2]) == true))
    {
            UpdateTitle(ch, sTitle[2], need_gold_2);
    }

    if (!strcmp(pTitle, "title3") && (GetLevel(ch, need_level_3) == true) && (GetPlayTime(ch, need_minutes_3) == true) && (GetMoney(ch, need_gold_3) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[3]) == true))
    {   
            UpdateTitle(ch, sTitle[3], need_gold_3);
    }

    if (!strcmp(pTitle, "title4") && (GetLevel(ch, need_level_4) == true) && (GetPlayTime(ch, need_minutes_4) == true) && (GetMoney(ch, need_gold_4) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[4]) == true))
    {
            UpdateTitle(ch, sTitle[4], need_gold_4);
    }

    if (!strcmp(pTitle, "title5") && (GetLevel(ch, need_level_5) == true) && (GetPlayTime(ch, need_minutes_5) == true) && (GetMoney(ch, need_gold_5) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[5]) == true))
    {
            UpdateTitle(ch, sTitle[5], need_gold_5);
    }

    if (!strcmp(pTitle, "title6") && (GetLevel(ch, need_level_6) == true) && (GetPlayTime(ch, need_minutes_6) == true) && (GetMoney(ch, need_gold_6) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[6]) == true))
    {
            UpdateTitle(ch, sTitle[6], need_gold_6);
    }

    if (!strcmp(pTitle, "title7") && (GetLevel(ch, need_level_7) == true) && (GetPlayTime(ch, need_minutes_7) == true) && (GetMoney(ch, need_gold_7) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[7]) == true))
    {
            UpdateTitle(ch, sTitle[7], need_gold_7);
    }

    if (!strcmp(pTitle, "title8") && (GetLevel(ch, need_level_8) == true) && (GetPlayTime(ch, need_minutes_8) == true) && (GetMoney(ch, need_gold_8) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[8]) == true))
    {
            UpdateTitle(ch, sTitle[8], need_gold_8);
    }

    if (!strcmp(pTitle, "title9") && (GetLevel(ch, need_level_9) == true) && (GetPlayTime(ch, need_minutes_9) == true) && (GetMoney(ch, need_gold_9) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[9]) == true))
    {
            UpdateTitle(ch, sTitle[9], need_gold_9);
    }

    if (!strcmp(pTitle, "title10") && (GetLevel(ch, need_level_10) == true) && (GetPlayTime(ch, need_minutes_10) == true) && (GetMoney(ch, need_gold_10) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[10]) == true))
    {
            UpdateTitle(ch, sTitle[10], need_gold_10);
    }

    if (!strcmp(pTitle, "title11") && (GetLevel(ch, need_level_11) == true) && (GetPlayTime(ch, need_minutes_11) == true) && (GetMoney(ch, need_gold_11) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[11]) == true))
    {
            UpdateTitle(ch, sTitle[11], need_gold_11);
    }

    if (!strcmp(pTitle, "title12") && (GetLevel(ch, need_level_12) == true) && (GetPlayTime(ch, need_minutes_12) == true) && (GetMoney(ch, need_gold_12) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[12]) == true))
    {
            UpdateTitle(ch, sTitle[12], need_gold_12);
    }

    if (!strcmp(pTitle, "title13") && (GetLevel(ch, need_level_13) == true) && (GetPlayTime(ch, need_minutes_13) == true) && (GetMoney(ch, need_gold_13) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[13]) == true))
    {
            UpdateTitle(ch, sTitle[13], need_gold_13);
    }

    if (!strcmp(pTitle, "title14") && (GetLevel(ch, need_level_14) == true) && (GetPlayTime(ch, need_minutes_14) == true) && (GetMoney(ch, need_gold_14) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[14]) == true))
    {
            UpdateTitle(ch, sTitle[14], need_gold_14);
    }

    if (!strcmp(pTitle, "title15") && (GetLevel(ch, need_level_15) == true) && (GetPlayTime(ch, need_minutes_15) == true) && (GetMoney(ch, need_gold_15) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[15]) == true))
    {
            UpdateTitle(ch, sTitle[15], need_gold_15);
    }

    if (!strcmp(pTitle, "title16") && (GetLevel(ch, need_level_16) == true) && (GetPlayTime(ch, need_minutes_16) == true) && (GetMoney(ch, need_gold_16) == true) && (GetTitlePremium(ch) == true) && (GetTitleActual(ch, sTitle[16]) == true))
    {
            UpdateTitle(ch, sTitle[16], need_gold_16);
    }
/****************
* Title  premium
*/
    if (!strcmp(pTitle, "title17") && (GetTitlePremium(ch) == true))
    {
            SetAffect(ch, "send_premium_1");
    }

    if (!strcmp(pTitle, "title18") && (GetTitlePremium(ch) == true))
    {
            SetAffect(ch, "send_premium_2");
    }

    if (!strcmp(pTitle, "title19") && (GetTitlePremium(ch) == true))
    {
            SetAffect(ch, "send_premium_3");
    }
    return true;
}

Affect.h:
Genişlet Daralt Kopyala
#pragma once

class CAffect
{
    public:
        uint32_t    dwType;
        uint8_t    bApplyOn;
        int32_t    lApplyValue;
        uint32_t   dwFlag;
        int32_t    lDuration;
        int32_t    lSPCost;

        static CAffect* Acquire();
        static void Release(CAffect* p);
};

enum EAffectTypes
{
    AFFECT_NONE,

    AFFECT_MOV_SPEED        = 200,
    AFFECT_ATT_SPEED,
    AFFECT_ATT_GRADE,
    AFFECT_INVISIBILITY,
    AFFECT_STR,
    AFFECT_DEX,
    AFFECT_CON,
    AFFECT_INT,
    AFFECT_FISH_MIND_PILL,

    AFFECT_POISON,
    AFFECT_STUN,
    AFFECT_SLOW,
    AFFECT_DUNGEON_READY,
    AFFECT_DUNGEON_UNIQUE,

    AFFECT_BUILDING,
    AFFECT_REVIVE_INVISIBLE,
    AFFECT_FIRE,
    AFFECT_CAST_SPEED,
    AFFECT_HP_RECOVER_CONTINUE,
    AFFECT_SP_RECOVER_CONTINUE,

    AFFECT_POLYMORPH,
    AFFECT_MOUNT,

    AFFECT_WAR_FLAG,

    AFFECT_BLOCK_CHAT,
    AFFECT_CHINA_FIREWORK,

    AFFECT_BOW_DISTANCE,
    AFFECT_DEF_GRADE,
#ifdef ENABLE_WOLFMAN_CHARACTER // @correction190
    AFFECT_BLEEDING,
#endif
#ifdef __ELEMENT_ADD__
    AFFECT_MOUNT_FALL,                            // 230
    AFFECT_NO_RECOVERY,                            // 231
    AFFECT_REDUCE_CAST_SPEED,                    // 232
#endif
#ifdef __12ZI__
    AFFECT_ATT_GRADE_DOWN,                        // 233
    AFFECT_DEF_GRADE_DOWN,                        // 234
    AFFECT_CRITICAL_PCT_DOWN,                    // 235
    AFFECT_CZ_UNLIMIT_ENTER,                    // 236
#endif

    AFFECT_RAMADAN_ABILITY = 300,
    AFFECT_RAMADAN_RING = 301,

    AFFECT_NOG_ABILITY = 302,
    AFFECT_HOLLY_STONE_POWER = 303,

    AFFECT_PREMIUM_START    = 500,
    AFFECT_EXP_BONUS        = 500,
    AFFECT_ITEM_BONUS        = 501,
    AFFECT_SAFEBOX        = 502,
    AFFECT_AUTOLOOT        = 503,
    AFFECT_FISH_MIND        = 504,
    AFFECT_MARRIAGE_FAST    = 505,
    AFFECT_GOLD_BONUS        = 506,
    AFFECT_PREMIUM_END        = 509,

    AFFECT_MALL            = 510,
    AFFECT_NO_DEATH_PENALTY    = 511,
    AFFECT_SKILL_BOOK_BONUS    = 512,
    AFFECT_SKILL_NO_BOOK_DELAY    = 513,

    AFFECT_HAIR    = 514,
    AFFECT_COLLECT = 515,
    AFFECT_EXP_BONUS_EURO_FREE = 516,
    AFFECT_EXP_BONUS_EURO_FREE_UNDER_15 = 517,
    AFFECT_UNIQUE_ABILITY = 518,

    AFFECT_CUBE_1 = 519,
    AFFECT_CUBE_2 = 520,
    AFFECT_CUBE_3 = 521,
    AFFECT_CUBE_4 = 522,
    AFFECT_CUBE_5 = 523,
    AFFECT_CUBE_6 = 524,
    AFFECT_CUBE_7 = 525,
    AFFECT_CUBE_8 = 526,
    AFFECT_CUBE_9 = 527,
    AFFECT_CUBE_10 = 528,
    AFFECT_CUBE_11 = 529,
    AFFECT_CUBE_12 = 530,

    AFFECT_BLEND = 531,

    AFFECT_HORSE_NAME = 532,
    AFFECT_MOUNT_BONUS = 533,

    AFFECT_AUTO_HP_RECOVERY = 534,
    AFFECT_AUTO_SP_RECOVERY = 535,

    AFFECT_DRAGON_SOUL_QUALIFIED = 540,
    AFFECT_DRAGON_SOUL_DECK_0 = 541,
    AFFECT_DRAGON_SOUL_DECK_1 = 542,

#ifdef ENABLE_TITLE_SYSTEM
    PRESTIGE_AFFECT_1 = 543,
    PRESTIGE_AFFECT_2 = 544,
    PRESTIGE_AFFECT_3 = 545,
#endif

#ifdef __ALIGN_RENEWAL__
    AFFECT_ALIGN_BONUS1,
    AFFECT_ALIGN_BONUS2,
    AFFECT_ALIGN_BONUS3,
#endif

#ifdef __GUILD_DRAGONLAIR__
    AFFECT_STATUE,
#endif

#ifdef __GROWTH_PET__
    AFFECT_NEW_PET,
#endif

#if defined(__MINI_GAME_ATTENDANCE__) || defined(__MINI_GAME_MONSTERBACK__)
    AFFECT_EXP_BONUS_EVENT,
    AFFECT_ATT_SPEED_SLOW,
#endif
#ifdef __SOUL__
    AFFECT_SOUL,
#endif

    AFFECT_QUEST_START_IDX = 1000
};

enum EAffectBits
{
    AFF_NONE,

    AFF_YMIR,
    AFF_INVISIBILITY,
    AFF_SPAWN,

    AFF_POISON,
    AFF_SLOW,
    AFF_STUN,

    AFF_DUNGEON_READY,
    AFF_DUNGEON_UNIQUE,

    AFF_BUILDING_CONSTRUCTION_SMALL,
    AFF_BUILDING_CONSTRUCTION_LARGE,
    AFF_BUILDING_UPGRADE,

    AFF_MOV_SPEED_POTION,
    AFF_ATT_SPEED_POTION,

    AFF_FISH_MIND,

    AFF_JEONGWIHON,
    AFF_GEOMGYEONG,
    AFF_CHEONGEUN,
    AFF_GYEONGGONG,
    AFF_EUNHYUNG,
    AFF_GWIGUM,
    AFF_TERROR,
    AFF_JUMAGAP,
    AFF_HOSIN,
    AFF_BOHO,
    AFF_KWAESOK,
    AFF_MANASHIELD,
    AFF_MUYEONG,
    AFF_REVIVE_INVISIBLE,
    AFF_FIRE,
    AFF_GICHEON,
    AFF_JEUNGRYEOK,
    AFF_TANHWAN_DASH,
    AFF_PABEOP,
    AFF_CHEONGEUN_WITH_FALL,
    AFF_POLYMORPH,
    AFF_WAR_FLAG1,
    AFF_WAR_FLAG2,
    AFF_WAR_FLAG3,

    AFF_CHINA_FIREWORK,
    AFF_HAIR,
    AFF_GERMANY,
    AFF_RAMADAN_RING,

#ifdef ENABLE_WOLFMAN_CHARACTER // @correction190
    AFF_BLEEDING,
    AFF_RED_POSSESSION,
    AFF_BLUE_POSSESSION,
#endif

#ifdef __GUILD_DRAGONLAIR__
    AFF_STATUE1,
    AFF_STATUE2,
    AFF_STATUE3,
    AFF_STATUE4,
#endif

#ifdef __12ZI__
    AFF_ELECTRIC_SHOCK,                    // 46
    AFF_CONFUSION,                        // 47
#endif
#ifdef __SOUL__
    AFF_SOUL_RED,
    AFF_SOUL_BLUE,
    AFF_SOUL_MIX,
#endif

    AFF_BITS_MAX
};

extern void SendAffectAddPacket(LPDESC d, CAffect * pkAff);

enum AffectVariable
{

    INFINITE_AFFECT_DURATION = 60 * 365 * 24 * 60 * 60
};
 
Son düzenleme:
Bu şekilde degistirdim
C++:
Genişlet Daralt Kopyala
        ch->PointChange(POINT_GOLD, - changeMoney);

C++:
Genişlet Daralt Kopyala
        ch->ChangeGold(false, - changeMoney);


Kod:
Genişlet Daralt Kopyala
compiling title.cpp
linking ../game_r41032
/usr/local/bin/ld: .obj/title.o: in function `GetTitleActual(CHARACTER*, int)':
/usr/src/test/Server/game/src/title.cpp:406: undefined reference to `CHARACTER::GetRealTitle() const'
/usr/local/bin/ld: .obj/title.o: in function `GetTitlePremium(CHARACTER*)':
/usr/src/test/Server/game/src/title.cpp:387: undefined reference to `CHARACTER::GetRealTitle() const'
/usr/local/bin/ld: .obj/title.o: in function `TitleManager::TransformTitle(CHARACTER*)':
/usr/src/test/Server/game/src/title.cpp:156: undefined reference to `CHARACTER::GetRealTitle() const'
/usr/local/bin/ld: /usr/src/test/Server/game/src/title.cpp:164: undefined reference to `CHARACTER::GetRealTitle() const'
/usr/local/bin/ld: /usr/src/test/Server/game/src/title.cpp:164: undefined reference to `CHARACTER::UpdateTitle(int)'
/usr/local/bin/ld: /usr/src/test/Server/game/src/title.cpp:188: undefined reference to `CHARACTER::GetRealTitle() const'
/usr/local/bin/ld: /usr/src/test/Server/game/src/title.cpp:188: undefined reference to `CHARACTER::UpdateTitle(int)'
/usr/local/bin/ld: /usr/src/test/Server/game/src/title.cpp:176: undefined reference to `CHARACTER::GetRealTitle() const'
/usr/local/bin/ld: /usr/src/test/Server/game/src/title.cpp:176: undefined reference to `CHARACTER::UpdateTitle(int)'
/usr/local/bin/ld: .obj/title.o: in function `TitleManager::UpdateTitle(CHARACTER*, int, int)':
/usr/src/test/Server/game/src/title.cpp:430: undefined reference to `CHARACTER::GetTitle() const'
/usr/local/bin/ld: /usr/src/test/Server/game/src/title.cpp:430: undefined reference to `CHARACTER::UpdateTitle(int)'
/usr/local/bin/ld: /usr/src/test/Server/game/src/title.cpp:435: undefined reference to `CHARACTER::GetTitle() const'
/usr/local/bin/ld: /usr/src/test/Server/game/src/title.cpp:435: undefined reference to `CHARACTER::UpdateTitle(int)'
/usr/local/bin/ld: .obj/title.o: in function `TitleManager::SetTitle(CHARACTER*, char const*)':
/usr/src/test/Server/game/src/title.cpp:516: undefined reference to `CHARACTER::GetTitle() const'
/usr/local/bin/ld: /usr/src/test/Server/game/src/title.cpp:516: undefined reference to `CHARACTER::UpdateTitle(int)'
collect2: error: ld returned 1 exit status
gmake: *** [Makefile:188: ../game_r41032] Error 1
root@localhost:/usr/src/test/Server/game/src #
 
GetRealTitle, UpdateTitle bunlar char.h'ye tanımlanmamış.
 
Yardımlarınız için Teşekkürler fakat yapmamaya karar verdik.
 
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Geri
Üst