Majestic change stat Lost!
Edit max stat's in client :rolleyes:
<img src='http://img174.imageshack.us/img174/9513 ... ionrv6.png' border='0' alt='user posted image' />
<a href='http://imageshack.us' target='_blank'></a>Blood wrote:If you have good the character-stat-limit config, what message can you see in log files?
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
that I made bad. ?
it does not touch anything of sources and it uses many clients..
Use This Code...
Game.cpp
Game.h
The Default Formula is for max level 180
if you want to change it to a higher max level change the formula...
=)))))))
Game.cpp
Code: Select all
void CGame::StateChangeHandler(int iClientH, char * pData, DWORD dwMsgSize)
{
char * cp, cStateChange1, cStateChange2, cStateChange3;
char cStr, cVit, cDex, cInt, cMag, cChar;
char cStateTxt[512];
int iOldStr, iOldVit, iOldDex, iOldInt, iOldMag, iOldChar;
int iTotalSetting = 0;
if (m_pClientList[ iClientH ] == NULL) return;
if (m_pClientList[ iClientH ]->m_bIsInitComplete == FALSE) return;
if (m_pClientList[ iClientH ]->m_iGizonItemUpgradeLeft <= 0) return;
cStr = cVit = cDex = cInt = cMag = cChar = 0;
cp = (char *)(pData + DEF_INDEX2_MSGTYPE + 2);
cStateChange1 = *cp;
cp++;
cStateChange2 = *cp;
cp++;
cStateChange3 = *cp;
cp++;
iOldStr = m_pClientList[ iClientH ]->m_iStr;
iOldVit = m_pClientList[ iClientH ]->m_iVit;
iOldDex = m_pClientList[ iClientH ]->m_iDex;
iOldInt = m_pClientList[ iClientH ]->m_iInt;
iOldMag = m_pClientList[ iClientH ]->m_iMag;
iOldChar = m_pClientList[ iClientH ]->m_iCharisma;
wsprintf(G_cTxt, "(*) Char(%s) Str(%d) Vit(%d) Dex(%d) Int(%d) Mag(%d) Chr(%d) ", m_pClientList[ iClientH ]->m_cCharName, m_pClientList[ iClientH ]->m_iStr, m_pClientList[ iClientH ]->m_iVit, m_pClientList[ iClientH ]->m_iDex, m_pClientList[ iClientH ]->m_iInt, m_pClientList[ iClientH ]->m_iMag, m_pClientList[ iClientH ]->m_iCharisma);
PutLogList(G_cTxt);
if(!bChangeState(cStateChange1,&cStr,&cVit,&cDex,&cInt,&cMag,&cChar))
{
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL);
return;
}
if(!bChangeState(cStateChange2,&cStr,&cVit,&cDex,&cInt,&cMag,&cChar))
{
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL);
return;
}
if(!bChangeState(cStateChange3,&cStr,&cVit,&cDex,&cInt,&cMag,&cChar))
{
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL);
return;
}
if(m_pClientList[ iClientH ]->m_iGuildRank == 0 )
{
if(m_pClientList[ iClientH ]->m_iCharisma - cChar < 20)
{
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL);
return;
}
}
if(iOldStr +iOldVit +iOldDex +iOldInt +iOldMag +iOldChar != (179*3 + 70))
{
return;
}
if(cStr < 0 || cVit < 0 || cDex < 0 || cInt < 0 || cMag < 0 || cChar < 0
|| cStr + cVit + cDex + cInt + cMag + cChar != 3)
{
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL);
return;
}
if ((m_pClientList[ iClientH ]->m_iStr - cStr > DEF_CHARPOINTLIMIT)
|| (m_pClientList[ iClientH ]->m_iStr - cStr < 10))
{
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL);
return;
}
if ((m_pClientList[ iClientH ]->m_iDex - cDex > DEF_CHARPOINTLIMIT)
|| (m_pClientList[ iClientH ]->m_iDex - cDex < 10))
{
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL);
return;
}
if ((m_pClientList[ iClientH ]->m_iInt - cInt > DEF_CHARPOINTLIMIT)
|| (m_pClientList[ iClientH ]->m_iInt - cInt < 10))
{
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL);
return;
}
if ((m_pClientList[ iClientH ]->m_iVit - cVit > DEF_CHARPOINTLIMIT)
|| (m_pClientList[ iClientH ]->m_iVit - cVit < 10))
{
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL);
return;
}
if ((m_pClientList[ iClientH ]->m_iMag - cMag > DEF_CHARPOINTLIMIT)
|| (m_pClientList[ iClientH ]->m_iMag - cMag < 10))
{
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL);
return;
}
if ((m_pClientList[ iClientH ]->m_iCharisma - cChar > DEF_CHARPOINTLIMIT)
|| (m_pClientList[ iClientH ]->m_iCharisma - cChar < 10))
{
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL);
return;
}
if (m_pClientList[ iClientH ]->m_iLU_Pool < 3) m_pClientList[ iClientH ]->m_iLU_Pool = 3;
m_pClientList[ iClientH ]->m_iGizonItemUpgradeLeft--;
m_pClientList[ iClientH ]->m_iStr -= cStr;
m_pClientList[ iClientH ]->m_iVit -= cVit;
m_pClientList[ iClientH ]->m_iDex -= cDex;
m_pClientList[ iClientH ]->m_iInt -= cInt;
if(cInt > 0)
bCheckMagicInt(iClientH);
m_pClientList[ iClientH ]->m_iMag -= cMag;
m_pClientList[ iClientH ]->m_iCharisma -= cChar;
ZeroMemory(cStateTxt,sizeof(cStateTxt));
wsprintf(cStateTxt, "STR(%d->%d)VIT(%d->%d)DEX(%d->%d)INT(%d->%d)MAG(%d->%d)CHARISMA(%d->%d)",
iOldStr, m_pClientList[ iClientH ]->m_iStr,
iOldVit, m_pClientList[ iClientH ]->m_iVit,
iOldDex, m_pClientList[ iClientH ]->m_iDex,
iOldInt, m_pClientList[ iClientH ]->m_iInt,
iOldMag, m_pClientList[ iClientH ]->m_iMag,
iOldChar,m_pClientList[ iClientH ]->m_iCharisma
);
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_SUCCESS, NULL, NULL, NULL, NULL);
if (m_pClientList[iClientH]->m_iHP > iGetMaxHP(iClientH))
m_pClientList[iClientH]->m_iHP = iGetMaxHP(iClientH);
if (m_pClientList[iClientH]->m_iMP > iGetMaxMP(iClientH))
m_pClientList[iClientH]->m_iMP = iGetMaxMP(iClientH);
if (m_pClientList[iClientH]->m_iSP > iGetMaxSP(iClientH))
m_pClientList[iClientH]->m_iSP = iGetMaxSP(iClientH);
}
Code: Select all
BOOL CGame::bChangeState(char cStateChange, char* cStr, char *cVit,char *cDex,char *cInt,char *cMag,char *cChar)
{
if(cStateChange == DEF_STR)
{
*cStr += 1;
}
else if(cStateChange == DEF_VIT)
{
*cVit += 1;
}
else if(cStateChange == DEF_DEX)
{
*cDex += 1;
}
else if(cStateChange == DEF_INT)
{
*cInt += 1;
}
else if(cStateChange == DEF_MAG)
{
*cMag += 1;
}
else if(cStateChange == DEF_CHR)
{
*cChar += 1;
}
else
{
return 0;
}
return cStateChange;
}
Code: Select all
#define DEF_STR 0x01
#define DEF_VIT 0x02
#define DEF_DEX 0x03
#define DEF_INT 0x04
#define DEF_MAG 0x05
#define DEF_CHR 0x06
Code: Select all
if(iOldStr +iOldVit +iOldDex +iOldInt +iOldMag +iOldChar != (179*3 + 70))
=)))))))
OWNED!<br><img src='http://img50.imageshack.us/img50/1386/p ... 3vsqn2.gif' border='0' alt='user posted image' /><br><br><img src="http://hbtop50.com/button.php?u=hbuonline" alt="Helbreath Top 50 - Keepin' it real." border="0" /><br><a href='http://www.hbuonline.net' target='_blank'>Helbreath United</a>
Sry it compiles several times and it throws this to me...
:\hg\DebugDialog.cpp(85) : warning C4018: '<' : signed/unsigned mismatch
E:\hg\DebugDialog.cpp(88) : warning C4018: '<' : signed/unsigned mismatch
E:\hg\DebugDialog.cpp(97) : warning C4018: '<' : signed/unsigned mismatch
Linking...
Game.obj : error LNK2001: unresolved external symbol "public: int __thiscall CGame::bCheckMagicInt(int)" (?bCheckMagicInt@CGame@@QAEHH@Z)
Release/HGserver.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
HGserver.exe - 2 error(s), 7 warning(s)
Game.obj : error LNK2001: unresolved external symbol "public: int __thiscall CGame::bCheckMagicInt(int)" (?bCheckMagicInt@CGame@@QAEHH@Z)Exec wrote: Sry it compiles several times and it throws this to me...
:\hg\DebugDialog.cpp(85) : warning C4018: '<' : signed/unsigned mismatch
E:\hg\DebugDialog.cpp(88) : warning C4018: '<' : signed/unsigned mismatch
E:\hg\DebugDialog.cpp(97) : warning C4018: '<' : signed/unsigned mismatch
Linking...
Game.obj : error LNK2001: unresolved external symbol "public: int __thiscall CGame::bCheckMagicInt(int)" (?bCheckMagicInt@CGame@@QAEHH@Z)
Release/HGserver.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
HGserver.exe - 2 error(s), 7 warning(s)
this means you have a function defined and there is no function actually existing for it.
heres the function your missing
Code: Select all
BOOL CGame::bCheckMagicInt(int iClientH)
{
for(int i = 0;i < DEF_MAXMAGICTYPE;i++)
{
if(m_pMagicConfigList[i] != NULL)
if(m_pMagicConfigList[i]->m_sIntLimit > (m_pClientList[iClientH]->m_iAngelicInt + m_pClientList[iClientH]->m_iInt))
{
m_pClientList[iClientH]->m_cMagicMastery[i] = 0;
}
}
return TRUE;
}
HGserver.exe - 94 error(s), 1 warning(s)
-><-
install codes those and I am created hg perfect but it has the problem this...
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
it happens when low int and up another one stat
stat int has problem...
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
<a href='http://imageshack.us' target='_blank'></a>
it happens when low int and up another one stat
stat int has problem...
fixed problem.SlammeR wrote:Use This Code...
Game.cppCode: Select all
void CGame::StateChangeHandler(int iClientH, char * pData, DWORD dwMsgSize) { char * cp, cStateChange1, cStateChange2, cStateChange3; char cStr, cVit, cDex, cInt, cMag, cChar; char cStateTxt[512]; int iOldStr, iOldVit, iOldDex, iOldInt, iOldMag, iOldChar; int iTotalSetting = 0; if (m_pClientList[ iClientH ] == NULL) return; if (m_pClientList[ iClientH ]->m_bIsInitComplete == FALSE) return; if (m_pClientList[ iClientH ]->m_iGizonItemUpgradeLeft <= 0) return; cStr = cVit = cDex = cInt = cMag = cChar = 0; cp = (char *)(pData + DEF_INDEX2_MSGTYPE + 2); cStateChange1 = *cp; cp++; cStateChange2 = *cp; cp++; cStateChange3 = *cp; cp++; iOldStr = m_pClientList[ iClientH ]->m_iStr; iOldVit = m_pClientList[ iClientH ]->m_iVit; iOldDex = m_pClientList[ iClientH ]->m_iDex; iOldInt = m_pClientList[ iClientH ]->m_iInt; iOldMag = m_pClientList[ iClientH ]->m_iMag; iOldChar = m_pClientList[ iClientH ]->m_iCharisma; wsprintf(G_cTxt, "(*) Char(%s) Str(%d) Vit(%d) Dex(%d) Int(%d) Mag(%d) Chr(%d) ", m_pClientList[ iClientH ]->m_cCharName, m_pClientList[ iClientH ]->m_iStr, m_pClientList[ iClientH ]->m_iVit, m_pClientList[ iClientH ]->m_iDex, m_pClientList[ iClientH ]->m_iInt, m_pClientList[ iClientH ]->m_iMag, m_pClientList[ iClientH ]->m_iCharisma); PutLogList(G_cTxt); if(!bChangeState(cStateChange1,&cStr,&cVit,&cDex,&cInt,&cMag,&cChar)) { SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL); return; } if(!bChangeState(cStateChange2,&cStr,&cVit,&cDex,&cInt,&cMag,&cChar)) { SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL); return; } if(!bChangeState(cStateChange3,&cStr,&cVit,&cDex,&cInt,&cMag,&cChar)) { SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL); return; } if(m_pClientList[ iClientH ]->m_iGuildRank == 0 ) { if(m_pClientList[ iClientH ]->m_iCharisma - cChar < 20) { SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL); return; } } if(iOldStr +iOldVit +iOldDex +iOldInt +iOldMag +iOldChar != (179*3 + 70)) { return; } if(cStr < 0 || cVit < 0 || cDex < 0 || cInt < 0 || cMag < 0 || cChar < 0 || cStr + cVit + cDex + cInt + cMag + cChar != 3) { SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL); return; } if ((m_pClientList[ iClientH ]->m_iStr - cStr > DEF_CHARPOINTLIMIT) || (m_pClientList[ iClientH ]->m_iStr - cStr < 10)) { SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL); return; } if ((m_pClientList[ iClientH ]->m_iDex - cDex > DEF_CHARPOINTLIMIT) || (m_pClientList[ iClientH ]->m_iDex - cDex < 10)) { SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL); return; } if ((m_pClientList[ iClientH ]->m_iInt - cInt > DEF_CHARPOINTLIMIT) || (m_pClientList[ iClientH ]->m_iInt - cInt < 10)) { SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL); return; } if ((m_pClientList[ iClientH ]->m_iVit - cVit > DEF_CHARPOINTLIMIT) || (m_pClientList[ iClientH ]->m_iVit - cVit < 10)) { SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL); return; } if ((m_pClientList[ iClientH ]->m_iMag - cMag > DEF_CHARPOINTLIMIT) || (m_pClientList[ iClientH ]->m_iMag - cMag < 10)) { SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL); return; } if ((m_pClientList[ iClientH ]->m_iCharisma - cChar > DEF_CHARPOINTLIMIT) || (m_pClientList[ iClientH ]->m_iCharisma - cChar < 10)) { SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_FAILED, NULL, NULL, NULL, NULL); return; } if (m_pClientList[ iClientH ]->m_iLU_Pool < 3) m_pClientList[ iClientH ]->m_iLU_Pool = 3; m_pClientList[ iClientH ]->m_iGizonItemUpgradeLeft--; m_pClientList[ iClientH ]->m_iStr -= cStr; m_pClientList[ iClientH ]->m_iVit -= cVit; m_pClientList[ iClientH ]->m_iDex -= cDex; m_pClientList[ iClientH ]->m_iInt -= cInt; if(cInt > 0) bCheckMagicInt(iClientH); m_pClientList[ iClientH ]->m_iMag -= cMag; m_pClientList[ iClientH ]->m_iCharisma -= cChar; ZeroMemory(cStateTxt,sizeof(cStateTxt)); wsprintf(cStateTxt, "STR(%d->%d)VIT(%d->%d)DEX(%d->%d)INT(%d->%d)MAG(%d->%d)CHARISMA(%d->%d)", iOldStr, m_pClientList[ iClientH ]->m_iStr, iOldVit, m_pClientList[ iClientH ]->m_iVit, iOldDex, m_pClientList[ iClientH ]->m_iDex, iOldInt, m_pClientList[ iClientH ]->m_iInt, iOldMag, m_pClientList[ iClientH ]->m_iMag, iOldChar,m_pClientList[ iClientH ]->m_iCharisma ); SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_STATECHANGE_SUCCESS, NULL, NULL, NULL, NULL); if (m_pClientList[iClientH]->m_iHP > iGetMaxHP(iClientH)) m_pClientList[iClientH]->m_iHP = iGetMaxHP(iClientH); if (m_pClientList[iClientH]->m_iMP > iGetMaxMP(iClientH)) m_pClientList[iClientH]->m_iMP = iGetMaxMP(iClientH); if (m_pClientList[iClientH]->m_iSP > iGetMaxSP(iClientH)) m_pClientList[iClientH]->m_iSP = iGetMaxSP(iClientH); }
------------------------------Code: Select all
BOOL CGame::bChangeState(char cStateChange, char* cStr, char *cVit,char *cDex,char *cInt,char *cMag,char *cChar) { if(cStateChange == DEF_STR) { *cStr += 1; } else if(cStateChange == DEF_VIT) { *cVit += 1; } else if(cStateChange == DEF_DEX) { *cDex += 1; } else if(cStateChange == DEF_INT) { *cInt += 1; } else if(cStateChange == DEF_MAG) { *cMag += 1; } else if(cStateChange == DEF_CHR) { *cChar += 1; } else { return 0; } return cStateChange; }
Game.h-------------------------------Code: Select all
#define DEF_STR 0x01 #define DEF_VIT 0x02 #define DEF_DEX 0x03 <------- Error; #define DEF_INT 0x04 #define DEF_MAG 0x05 #define DEF_CHR 0x06
#define DEF_STR 0x01
#define DEF_DEX 0x02
#define DEF_INT 0x03 <------- to use
#define DEF_VIT 0x04
#define DEF_MAG 0x05
#define DEF_CHR 0x06
-----------------------------
The Default Formula is for max level 180if you want to change it to a higher max level change the formula...Code: Select all
if(iOldStr +iOldVit +iOldDex +iOldInt +iOldMag +iOldChar != (179*3 + 70))
=)))))))
Thank you very much Slammer... Muah muach
-
- Loyal fan
- Posts: 423
- Joined: Thu Apr 07, 2005 7:53 pm
if you want 315, then change that 179 to 314, if you want 418, change that 179 to 417, get meh drift?
<img src='http://www.bleachportal.net/interactive ... irjjkt.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/Slipknot%20Fan.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/UT2004%20Player.jpg' border='0' alt='user posted image' /><br><img src='http://www.hazegfx.com/UserBanners/AC%20DC%20Fan.png' border='0' alt='user posted image' /><br>