Titulus rendszer: Prémium bővítése

Indította xTryx, 2018-09-30, 19:40:43

Sziasztok!

Beraktam a titulus rendszert. Működik rendesen, viszont miután bővítettem a prémium címeket azokat már nem engedi aktiválni.


Mi lehet a baj?

Kliens és szerver oldalon is okénak tűnik minden.


Szerver:

title.cpp:

int sTitle[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22};

int get_affect_premium[] = {PRESTIGE_AFFECT_1, PRESTIGE_AFFECT_2, PRESTIGE_AFFECT_3, PRESTIGE_AFFECT_4, PRESTIGE_AFFECT_5, PRESTIGE_AFFECT_6};

int sPotionTime[] = {12, 12, 12, 12, 12, 12};

int sPotionVnum[] = {55001, 55002, 55003, 55004, 55005, 55006};

int sPotionPrice[] = {20000, 20000, 20000, 20000, 20000, 20000};

int pTitleBonus_1[] = {POINT_RESIST_WARRIOR, 5};
int pTitleBonus_2[] = {POINT_RESIST_ASSASSIN, 5};
int pTitleBonus_3[] = {POINT_RESIST_SURA, 5};
int pTitleBonus_4[] = {POINT_RESIST_SHAMAN, 5};
int pTitleBonus_5[] = {POINT_CRITICAL_PCT, 15};
int pTitleBonus_6[] = {POINT_ATTBONUS_MONSTER, 30};

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;
case 20:
if (ch->FindAffect(get_affect_premium[3]))
{
ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[2]);
ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[16]);
ch->RemoveAffect(get_affect_premium[3]);
ch->UpdateTitle(- ch->GetRealTitle());
ch->AutoGiveItem(sPotionVnum[3]);
}
else if (!ch->FindAffect(get_affect_premium[0])){
return false; ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[6]);}
break;
case 21:
if (ch->FindAffect(get_affect_premium[4]))
{
ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[2]);
ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[17]);
ch->RemoveAffect(get_affect_premium[4]);
ch->UpdateTitle(- ch->GetRealTitle());
ch->AutoGiveItem(sPotionVnum[4]);
}
else if (!ch->FindAffect(get_affect_premium[0])){
return false; ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[6]);}
break;
case 22:
if (ch->FindAffect(get_affect_premium[5]))
{
ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[2]);
ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[18]);
ch->RemoveAffect(get_affect_premium[5]);
ch->UpdateTitle(- ch->GetRealTitle());
ch->AutoGiveItem(sPotionVnum[5]);
}
else if (!ch->FindAffect(get_affect_premium[0])){
return false; ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[6]);}
break;
}
}

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

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: case 20:
case 21: case 22:
ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[8]);
return false;
}

/****************
* [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;
}

if (!strcmp(valueAffect, "send_premium_4"))
{
if (ch->CountSpecifyItem(sPotionVnum[3]))
{
ch->AddAffect(get_affect_premium[3], pTitleBonus_4[0], pTitleBonus_4[1], 0, sTimeDuratingBonus[0], 0, true);
ch->RemoveSpecifyItem(sPotionVnum[3], 1);
UpdateTitle(ch, sTitle[20], 0);
}
else
ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[13]);
return;
}

if (!strcmp(valueAffect, "send_premium_5"))
{
if (ch->CountSpecifyItem(sPotionVnum[4]))
{
ch->AddAffect(get_affect_premium[4], pTitleBonus_5[0], pTitleBonus_5[1], 0, sTimeDuratingBonus[0], 0, true);
ch->RemoveSpecifyItem(sPotionVnum[4], 1);
UpdateTitle(ch, sTitle[21], 0);
}
else
ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[14]);
return;
}

if (!strcmp(valueAffect, "send_premium_6"))
{
if (ch->CountSpecifyItem(sPotionVnum[5]))
{
ch->AddAffect(get_affect_premium[5], pTitleBonus_6[0], pTitleBonus_6[1], 0, sTimeDuratingBonus[0], 0, true);
ch->RemoveSpecifyItem(sPotionVnum[5], 1);
UpdateTitle(ch, sTitle[22], 0);
}
else
ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[15]);
return;
}
}

if (!strcmp(pTitle, "disable") && (GetTitleActual(ch, sTitle[17]) == true) && (GetTitleActual(ch, sTitle[18]) == true) && (GetTitleActual(ch, sTitle[19]) == true) && (GetTitleActual(ch, sTitle[20]) == true) && (GetTitleActual(ch, sTitle[21]) == true) && (GetTitleActual(ch, sTitle[22]) == true))
{
ch->UpdateTitle(- ch->GetTitle());
ch->ChatPacket(CHAT_TYPE_NOTICE, title_translate[12]);
}

/****************
* 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");
}

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

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

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


affect.h
PRESTIGE_AFFECT_1 = 543,
PRESTIGE_AFFECT_2 = 544,
PRESTIGE_AFFECT_3 = 545,
PRESTIGE_AFFECT_4 = 546,
PRESTIGE_AFFECT_5 = 547,
PRESTIGE_AFFECT_6 = 548,


Char_battle:
m_iRealPrestige = MINMAX(0, m_iRealPrestige + iAmount, 22);

CMD general:

if (!strcmp(arg1, "prestige_17")){
TitleManager::instance().SetTitle(ch, "title17");}

if (!strcmp(arg1, "prestige_18")){
TitleManager::instance().SetTitle(ch, "title18");}

if (!strcmp(arg1, "prestige_19")){
TitleManager::instance().SetTitle(ch, "title19");}

if (!strcmp(arg1, "prestige_20")){
TitleManager::instance().SetTitle(ch, "title20");}

if (!strcmp(arg1, "prestige_21")){
TitleManager::instance().SetTitle(ch, "title21");}

if (!strcmp(arg1, "prestige_22")){
TitleManager::instance().SetTitle(ch, "title22");}



Kliens:

Instancebase:


else if (m_sPrestige == pTitle_vegas[17])
return 16;
else if (m_sPrestige == pTitle_vegas[18])
return 17;
else if (m_sPrestige == pTitle_vegas[19])
return 18;
else if (m_sPrestige == pTitle_vegas[20])
return 19;
else if (m_sPrestige == pTitle_vegas[21])
return 20;
else if (m_sPrestige == pTitle_vegas[22])
return 21;
else if (m_sPrestige == pTitle_vegas[0])
return 22;

return 0;


insancebase.h
TITLE_NUM_PRESTIGE = 23,
TITLE_NONE_PRESTIGE = 22,



Python:

constinfo:
TITLE_SYSTEM_ITEM_1 = 55001
TITLE_SYSTEM_ITEM_2 = 55002
TITLE_SYSTEM_ITEM_3 = 55003
TITLE_SYSTEM_ITEM_4 = 55004
TITLE_SYSTEM_ITEM_5 = 55005
TITLE_SYSTEM_ITEM_6 = 55006


introloading:

if app.ENABLE_TITLE_SYSTEM:
TITLEPRESTIGE_COLOR_DICT = ( colorInfo.TITLE_PRESTIGE_COLOR_1,
colorInfo.TITLE_PRESTIGE_COLOR_2,
colorInfo.TITLE_PRESTIGE_COLOR_3,
colorInfo.TITLE_PRESTIGE_COLOR_4,
colorInfo.TITLE_PRESTIGE_COLOR_5,
colorInfo.TITLE_PRESTIGE_COLOR_6,
colorInfo.TITLE_PRESTIGE_COLOR_7,
colorInfo.TITLE_PRESTIGE_COLOR_8,
colorInfo.TITLE_PRESTIGE_COLOR_9,
colorInfo.TITLE_PRESTIGE_COLOR_10,
colorInfo.TITLE_PRESTIGE_COLOR_11,
colorInfo.TITLE_PRESTIGE_COLOR_12,
colorInfo.TITLE_PRESTIGE_COLOR_13,
colorInfo.TITLE_PRESTIGE_COLOR_14,
colorInfo.TITLE_PRESTIGE_COLOR_15,
colorInfo.TITLE_PRESTIGE_COLOR_16,
colorInfo.TITLE_PRESTIGE_COLOR_17,
colorInfo.TITLE_PRESTIGE_COLOR_18,
colorInfo.TITLE_PRESTIGE_COLOR_19,
colorInfo.TITLE_PRESTIGE_COLOR_20,
colorInfo.TITLE_PRESTIGE_COLOR_21,
colorInfo.TITLE_PRESTIGE_COLOR_22,
colorInfo.TITLE_PRESTIGE_COLOR_0, )
count_prestige_vegas = 0


localeinfo:
TITLEPRESTIGE_NAME_LIST = (TITLE_1,TITLE_2,TITLE_3,TITLE_4,TITLE_5,TITLE_6,TITLE_7,TITLE_8,TITLE_9,TITLE_10,TITLE_11,TITLE_12,TITLE_13,TITLE_14,TITLE_15,TITLE_16,TITLE_17,TITLE_18,TITLE_19,TITLE_20,TITLE_21,TITLE_22,TITLE_0)

def GetPrestigeTitleName(prestige):
if prestige == 1:
return TITLEPRESTIGE_NAME_LIST[0]
elif prestige == 2:
return TITLEPRESTIGE_NAME_LIST[1]
elif prestige == 3:
return TITLEPRESTIGE_NAME_LIST[2]
elif prestige == 4:
return TITLEPRESTIGE_NAME_LIST[3]
elif prestige == 5:
return TITLEPRESTIGE_NAME_LIST[4]
elif prestige == 6:
return TITLEPRESTIGE_NAME_LIST[5]
elif prestige == 7:
return TITLEPRESTIGE_NAME_LIST[6]
elif prestige == 8:
return TITLEPRESTIGE_NAME_LIST[7]
elif prestige == 9:
return TITLEPRESTIGE_NAME_LIST[8]
elif prestige == 10:
return TITLEPRESTIGE_NAME_LIST[9]
elif prestige == 11:
return TITLEPRESTIGE_NAME_LIST[10]
elif prestige == 12:
return TITLEPRESTIGE_NAME_LIST[11]
elif prestige == 13:
return TITLEPRESTIGE_NAME_LIST[12]
elif prestige == 14:
return TITLEPRESTIGE_NAME_LIST[13]
elif prestige == 15:
return TITLEPRESTIGE_NAME_LIST[14]
elif prestige == 16:
return TITLEPRESTIGE_NAME_LIST[15]
elif prestige == 17:
return TITLEPRESTIGE_NAME_LIST[16]
elif prestige == 18:
return TITLEPRESTIGE_NAME_LIST[17]
elif prestige == 19:
return TITLEPRESTIGE_NAME_LIST[18]
elif prestige == 20:
return TITLEPRESTIGE_NAME_LIST[19]
elif prestige == 21:
return TITLEPRESTIGE_NAME_LIST[20]
elif prestige == 22:
return TITLEPRESTIGE_NAME_LIST[21]
elif prestige == 0:
return TITLEPRESTIGE_NAME_LIST[22]


colorinfo:

TITLE_PRESTIGE_COLOR_1 = (18, 252, 18)
TITLE_PRESTIGE_COLOR_2 = (220, 185, 110)
TITLE_PRESTIGE_COLOR_3 = (72, 98, 0)
TITLE_PRESTIGE_COLOR_4 = (249, 141, 0)
TITLE_PRESTIGE_COLOR_5 = (255, 100, 100)
TITLE_PRESTIGE_COLOR_6 = (240, 13, 255)
TITLE_PRESTIGE_COLOR_7 = (184, 229, 227)
TITLE_PRESTIGE_COLOR_8 = (242, 19, 34)
TITLE_PRESTIGE_COLOR_9 = (217, 217, 217)
TITLE_PRESTIGE_COLOR_10 = (220, 185, 110)
TITLE_PRESTIGE_COLOR_11 = (185, 220, 110)
TITLE_PRESTIGE_COLOR_12 = (200, 155, 150)
TITLE_PRESTIGE_COLOR_13 = (255, 100, 100)
TITLE_PRESTIGE_COLOR_14 = (100, 220, 210)
TITLE_PRESTIGE_COLOR_15 = (20, 110, 40)
TITLE_PRESTIGE_COLOR_16 = (20, 190, 210)
TITLE_PRESTIGE_COLOR_17 = (255, 255, 255)
TITLE_PRESTIGE_COLOR_18 = (255, 255, 255)
TITLE_PRESTIGE_COLOR_19 = (255, 255, 255)
TITLE_PRESTIGE_COLOR_20 = (255, 255, 255)
TITLE_PRESTIGE_COLOR_21 = (255, 255, 255)
TITLE_PRESTIGE_COLOR_22 = (255, 255, 255)
TITLE_PRESTIGE_COLOR_0 = (255,255,255)


title_system.py:
Title_System2 = {
"Title_Free_Num"  : {
#-----------------------------------------------------------------------------------*****
0 : localeInfo.TITLE_INDEX_0,
1 : localeInfo.TITLE_INDEX_1,
2 : localeInfo.TITLE_INDEX_2,
3 : localeInfo.TITLE_INDEX_3,
4 : localeInfo.TITLE_INDEX_4,
5 : localeInfo.TITLE_INDEX_5,
6 : localeInfo.TITLE_INDEX_6,
7 : localeInfo.TITLE_INDEX_7,
8 : localeInfo.TITLE_INDEX_8,
9 : localeInfo.TITLE_INDEX_9,
10 : localeInfo.TITLE_INDEX_10,
11 : localeInfo.TITLE_INDEX_11,
12 : localeInfo.TITLE_INDEX_12,
13 : localeInfo.TITLE_INDEX_13,
14 : localeInfo.TITLE_INDEX_14,
15 : localeInfo.TITLE_INDEX_15,
16 : localeInfo.TITLE_INDEX_16,
17 : localeInfo.TITLE_INDEX_17,
18 : localeInfo.TITLE_INDEX_18,
19 : localeInfo.TITLE_INDEX_19,
20 : localeInfo.TITLE_INDEX_20,
21 : localeInfo.TITLE_INDEX_21,
22 : localeInfo.TITLE_INDEX_22,
}

premium_Title_System = {
"Title_Premium_Num"  : {
#-----------------------------------------------------------------------------------*****
0 : localeInfo.TITLE_INDEX_17,
1 : localeInfo.TITLE_INDEX_18,
2 : localeInfo.TITLE_INDEX_19,
3 : localeInfo.TITLE_INDEX_20,
4 : localeInfo.TITLE_INDEX_21,
5 : localeInfo.TITLE_INDEX_22,

},
"premium_prestige_targets_potion"    : {
#-----------------------------------------------------------------------------------*****
localeInfo.TITLE_INDEX_17 : localeInfo.TITLE_PREMIUM_INFO_OBJECT_0,
localeInfo.TITLE_INDEX_18 : localeInfo.TITLE_PREMIUM_INFO_OBJECT_1,
localeInfo.TITLE_INDEX_19 : localeInfo.TITLE_PREMIUM_INFO_OBJECT_2,
localeInfo.TITLE_INDEX_20 : localeInfo.TITLE_PREMIUM_INFO_OBJECT_3,
localeInfo.TITLE_INDEX_21 : localeInfo.TITLE_PREMIUM_INFO_OBJECT_4,
localeInfo.TITLE_INDEX_22 : localeInfo.TITLE_PREMIUM_INFO_OBJECT_5,
},
"premium_prestige_targets_bonus"    : {
#-----------------------------------------------------------------------------------*****
localeInfo.TITLE_INDEX_17 : localeInfo.TITLE_PREMIUM_INFO_BONUS_0,
localeInfo.TITLE_INDEX_18 : localeInfo.TITLE_PREMIUM_INFO_BONUS_1,
localeInfo.TITLE_INDEX_19 : localeInfo.TITLE_PREMIUM_INFO_BONUS_2,
localeInfo.TITLE_INDEX_20 : localeInfo.TITLE_PREMIUM_INFO_BONUS_3,
localeInfo.TITLE_INDEX_21 : localeInfo.TITLE_PREMIUM_INFO_BONUS_4,
localeInfo.TITLE_INDEX_22 : localeInfo.TITLE_PREMIUM_INFO_BONUS_5,
},
"Title_Premium_Name" : {
#-----------------------------------------------------------------------------------*****
localeInfo.TITLE_INDEX_17 : (255, 255, 255),
localeInfo.TITLE_INDEX_18 : (255, 255, 255),
localeInfo.TITLE_INDEX_19 : (255, 255, 255),
localeInfo.TITLE_INDEX_20 : (255, 255, 255),
localeInfo.TITLE_INDEX_21 : (255, 255, 255),
localeInfo.TITLE_INDEX_22 : (255, 255, 255),
},
}

if list_name_premium_prestige:
title_premium_prestige = list_name_premium_prestige.GetText()
if title_premium_prestige == localeInfo.TITLE_17:
net.SendChatPacket("/prestige_title_name prestige_17")
if title_premium_prestige == localeInfo.TITLE_18:
net.SendChatPacket("/prestige_title_name prestige_18")
if title_premium_prestige == localeInfo.TITLE_19:
net.SendChatPacket("/prestige_title_name prestige_19")
if title_premium_prestige == localeInfo.TITLE_20:
net.SendChatPacket("/prestige_title_name prestige_20")
if title_premium_prestige == localeInfo.TITLE_21:
net.SendChatPacket("/prestige_title_name prestige_21")
if title_premium_prestige == localeInfo.TITLE_22:
net.SendChatPacket("/prestige_title_name prestige_22")

,