But will you do somefthing for this to next version of magic items?
This looks so stupid


im no expert either at coding and i did it. just took me awhile cause i looked carefully at the whole function to figure it out first hand -.-. i like learning by making and fixing my own mistakesdiuuude wrote: that's it, you're right!
My magic weps have this fixed.. Do some chopping to my code.Dshaked wrote: Sry about double post but, this looks kinda stupid?
![]()
if you have a good antivirus like me, it will automatically get rid of it on unzippingJensen wrote: would you mind re-uploading w/o the virus in the files?
id really like to check out the magic weapons some.
MPs are decreased everytime you use the weapon...Firestorm wrote: Thats an great feature but the Mana pooints of your character should be lowered when you attack with the MagicGiant sword.
I will try my first HB Code by doing this. maybe it will be a noobish code but i hope it will work![]()
sorry man... but i wanna know, how declare sMagicLevel!!!!!!!!!!?BlueChristmas wrote:you need to declare sMagicLevel and the other errors is cause you replaced the whole statement when you should just replace the cases onPiotrekK wrote:I need help
Code: Select all
--------------------Configuration: HGserver - Win32 Release-------------------- Compiling... Game.cpp C:\Documents and Settings\PiotrekK\Pulpit\2.24c\Game.cpp(2112) : warning C4305: '=' : truncation from 'const int' to 'char' C:\Documents and Settings\PiotrekK\Pulpit\2.24c\Game.cpp(2112) : warning C4309: '=' : truncation of constant value C:\Documents and Settings\PiotrekK\Pulpit\2.24c\Game.cpp(8857) : warning C4305: '=' : truncation from 'const int' to 'short' C:\Documents and Settings\PiotrekK\Pulpit\2.24c\Game.cpp(8857) : warning C4309: '=' : truncation of constant value C:\Documents and Settings\PiotrekK\Pulpit\2.24c\Game.cpp(49710) : error C2065: 'sMagicLevel' : undeclared identifier C:\Documents and Settings\PiotrekK\Pulpit\2.24c\Game.cpp(49731) : error C2181: illegal else without matching if Error executing cl.exe. HGserver.exe - 2 error(s), 4 warning(s)
void CGame::GetItemName(char * cItemName, DWORD dwAttribute, char *pStr1, char *pStr2, char *pStr3)
should look like this if im correct
Code: Select all
void CGame::GetItemName(char * cItemName, DWORD dwAttribute, char *pStr1, char *pStr2, char *pStr3) { int i; char cTxt[256], cTxt2[256], cName[51]; DWORD dwType1, dwType2, dwValue1, dwValue2, dwValue3; m_bIsSpecial = FALSE; ZeroMemory(cName, sizeof(cName)); ZeroMemory(pStr1, sizeof(pStr1)); ZeroMemory(pStr2, sizeof(pStr2)); ZeroMemory(pStr3, sizeof(pStr3)); strcpy(cName, cItemName); for (i = 0; i < DEF_MAXITEMNAMES; i++) if ((m_pItemNameList[i] != NULL) && (strcmp(m_pItemNameList[i]->m_cOriginName, cItemName) == 0)) { strcpy(cName, m_pItemNameList[i]->m_cName); break; } strcpy(pStr1, cName); if ((dwAttribute & 0x00F0F000) != 0) { m_bIsSpecial = TRUE; dwType1 = (dwAttribute & 0x00F00000) >> 20; dwValue1 = (dwAttribute & 0x000F0000) >> 16; dwType2 = (dwAttribute & 0x0000F000) >> 12; dwValue2 = (dwAttribute & 0x00000F00) >> 8; if (dwType1 != 0) { ZeroMemory(cTxt, sizeof(cTxt)); switch (dwType1) { case 1: strcpy(cTxt, GET_ITEM_NAME3); break; case 2: strcpy(cTxt, GET_ITEM_NAME4); break; case 3: strcpy(cTxt, GET_ITEM_NAME5); break; case 4: break; case 5: strcpy(cTxt, GET_ITEM_NAME6); break; case 6: strcpy(cTxt, GET_ITEM_NAME7); break; case 7: strcpy(cTxt, GET_ITEM_NAME8); break; case 8: strcpy(cTxt, GET_ITEM_NAME9); break; case 9: strcpy(cTxt, GET_ITEM_NAME10); break; case 10: strcpy(cTxt, GET_ITEM_NAME11); break; case 11: strcpy(cTxt, GET_ITEM_NAME12); break; case 12: strcpy(cTxt, GET_ITEM_NAME13); break; case 15: strcpy(cTxt, GET_ITEM_NAME50); break; } strcat(cTxt, pStr1); ZeroMemory(pStr1, sizeof(pStr1)); strcpy(pStr1, cTxt); ZeroMemory(cTxt, sizeof(cTxt)); switch (dwType1) { case 1: wsprintf(cTxt, GET_ITEM_NAME14, dwValue1); break; case 2: wsprintf(cTxt, GET_ITEM_NAME15, dwValue1*5); break; case 3: break; case 4: break; case 5: strcpy(cTxt, GET_ITEM_NAME16); break; case 6: wsprintf(cTxt, GET_ITEM_NAME17, dwValue1*4); break; case 7: strcpy(cTxt, GET_ITEM_NAME18); break; case 8: wsprintf(cTxt, GET_ITEM_NAME19, dwValue1*7); break; case 9: strcpy(cTxt, GET_ITEM_NAME20); break; case 10: wsprintf(cTxt, GET_ITEM_NAME21, dwValue1*3); break; case 11: wsprintf(cTxt, GET_ITEM_NAME22, dwValue1); break; case 12: wsprintf(cTxt, GET_ITEM_NAME23, dwValue1); break; case 15: switch(dwValue1){ case 1: wsprintf(cTxt, GET_ITEM_NAME51, dwValue2*7); break; break; case 2: wsprintf(cTxt, GET_ITEM_NAME52, dwValue2*7); break; break; case 3: wsprintf(cTxt, GET_ITEM_NAME53, dwValue2*7); break; break; case 4: wsprintf(cTxt, GET_ITEM_NAME54, dwValue2*7); break; break; case 5: wsprintf(cTxt, GET_ITEM_NAME55, dwValue2*7); break; break; case 6: wsprintf(cTxt, GET_ITEM_NAME56, dwValue2*7); break; break; case 7: wsprintf(cTxt, GET_ITEM_NAME57, dwValue2*7); break; break; case 8: wsprintf(cTxt, GET_ITEM_NAME58, dwValue2*7); break; break; case 9: wsprintf(cTxt, GET_ITEM_NAME59, dwValue2*7); break; break; case 10: wsprintf(cTxt, GET_ITEM_NAME60, dwValue2*7); break; break; case 11: wsprintf(cTxt, GET_ITEM_NAME61, dwValue2*7); break; break; case 12: wsprintf(cTxt, GET_ITEM_NAME62, dwValue2*7); break; break; case 13: wsprintf(cTxt, GET_ITEM_NAME63, dwValue2*7); break; break; case 14: wsprintf(cTxt, GET_ITEM_NAME64, dwValue2*7); break; break; case 15: wsprintf(cTxt, GET_ITEM_NAME65, dwValue2*7); break; break; case 16: wsprintf(cTxt, GET_ITEM_NAME66, dwValue2*7); break; break; } break; } ZeroMemory(cTxt, sizeof(cTxt)); switch (dwType1) { case 1: wsprintf(cTxt, GET_ITEM_NAME14, dwValue1); break; case 2: wsprintf(cTxt, GET_ITEM_NAME15, dwValue1*5); break; case 3: break; case 4: break; case 5: strcpy(cTxt, GET_ITEM_NAME16); break; case 6: wsprintf(cTxt, GET_ITEM_NAME17, dwValue1*4); break; case 7: strcpy(cTxt, GET_ITEM_NAME18); break; case 8: wsprintf(cTxt, GET_ITEM_NAME19, dwValue1*7); break; case 9: strcpy(cTxt, GET_ITEM_NAME20); break; case 10: wsprintf(cTxt, GET_ITEM_NAME21, dwValue1*3); break; case 11: wsprintf(cTxt, GET_ITEM_NAME22, dwValue1); break; case 12: wsprintf(cTxt, GET_ITEM_NAME23, dwValue1); break; } strcat(pStr2, cTxt); if (dwType2 != 0) { ZeroMemory(cTxt, sizeof(cTxt)); switch (dwType2) { case 1: wsprintf(cTxt, GET_ITEM_NAME24, dwValue2*7); break; case 2: wsprintf(cTxt, GET_ITEM_NAME25, dwValue2*7); break; case 3: wsprintf(cTxt, GET_ITEM_NAME26, dwValue2*7); break; case 4: wsprintf(cTxt, GET_ITEM_NAME27, dwValue2*7); break; case 5: wsprintf(cTxt, GET_ITEM_NAME28, dwValue2*7); break; case 6: wsprintf(cTxt, GET_ITEM_NAME29, dwValue2*7); break; case 7: wsprintf(cTxt, GET_ITEM_NAME30, dwValue2*7); break; case 8: wsprintf(cTxt, GET_ITEM_NAME31, dwValue2*3); break; case 9: wsprintf(cTxt, GET_ITEM_NAME32, dwValue2*3); break; case 10: wsprintf(cTxt, GET_ITEM_NAME33, dwValue2); break; case 11: wsprintf(cTxt, GET_ITEM_NAME34, dwValue2*10); break; case 12: wsprintf(cTxt, GET_ITEM_NAME35, dwValue2*10); break; } strcpy(pStr3, cTxt); } } } dwValue3 = (dwAttribute & 0xF0000000) >> 28; if (dwValue3 > 0) { if (pStr1[strlen(pStr1)-2] == '+') { dwValue3 = atoi((char *)(pStr1 + strlen(pStr1)-1)) + dwValue3; ZeroMemory(cTxt, sizeof(cTxt)); memcpy(cTxt, pStr1, strlen(pStr1)-2); ZeroMemory(cTxt2, sizeof(cTxt2)); wsprintf(cTxt2, "%s+%d", cTxt, dwValue3); ZeroMemory(pStr1, sizeof(pStr1)); strcpy(pStr1, cTxt2); } else { ZeroMemory(cTxt, sizeof(cTxt)); wsprintf(cTxt, "+%d", dwValue3); strcat(pStr1, cTxt); } } }
Mmh than i bugged something i will overview the code again ^^ . Thanks for this info diuuuudediuuude Posted on May 18 2006, 11:11 PM
QUOTE (Firestorm @ May 18 2006, 08:57 PM)
Thats an great feature but the Mana pooints of your character should be lowered when you attack with the MagicGiant sword.
I will try my first HB Code by doing this. maybe it will be a noobish code but i hope it will work sad.gif
MPs are decreased everytime you use the weapon...
If your MPs are lower than the required MPs, the spell isn't casted and there is no damage bonus when attacking. It's like a normal weapon when you're out of mana.
just like you declare everything elseogeid wrote:sorry man... but i wanna know, how declare sMagicLevel!!!!!!!!!!?BlueChristmas wrote:you need to declare sMagicLevel and the other errors is cause you replaced the whole statement when you should just replace the cases onPiotrekK wrote:I need help
Code: Select all
--------------------Configuration: HGserver - Win32 Release-------------------- Compiling... Game.cpp C:\Documents and Settings\PiotrekK\Pulpit\2.24c\Game.cpp(2112) : warning C4305: '=' : truncation from 'const int' to 'char' C:\Documents and Settings\PiotrekK\Pulpit\2.24c\Game.cpp(2112) : warning C4309: '=' : truncation of constant value C:\Documents and Settings\PiotrekK\Pulpit\2.24c\Game.cpp(8857) : warning C4305: '=' : truncation from 'const int' to 'short' C:\Documents and Settings\PiotrekK\Pulpit\2.24c\Game.cpp(8857) : warning C4309: '=' : truncation of constant value C:\Documents and Settings\PiotrekK\Pulpit\2.24c\Game.cpp(49710) : error C2065: 'sMagicLevel' : undeclared identifier C:\Documents and Settings\PiotrekK\Pulpit\2.24c\Game.cpp(49731) : error C2181: illegal else without matching if Error executing cl.exe. HGserver.exe - 2 error(s), 4 warning(s)
void CGame::GetItemName(char * cItemName, DWORD dwAttribute, char *pStr1, char *pStr2, char *pStr3)
should look like this if im correct
Code: Select all
void CGame::GetItemName(char * cItemName, DWORD dwAttribute, char *pStr1, char *pStr2, char *pStr3) { int i; char cTxt[256], cTxt2[256], cName[51]; DWORD dwType1, dwType2, dwValue1, dwValue2, dwValue3; m_bIsSpecial = FALSE; ZeroMemory(cName, sizeof(cName)); ZeroMemory(pStr1, sizeof(pStr1)); ZeroMemory(pStr2, sizeof(pStr2)); ZeroMemory(pStr3, sizeof(pStr3)); strcpy(cName, cItemName); for (i = 0; i < DEF_MAXITEMNAMES; i++) if ((m_pItemNameList[i] != NULL) && (strcmp(m_pItemNameList[i]->m_cOriginName, cItemName) == 0)) { strcpy(cName, m_pItemNameList[i]->m_cName); break; } strcpy(pStr1, cName); if ((dwAttribute & 0x00F0F000) != 0) { m_bIsSpecial = TRUE; dwType1 = (dwAttribute & 0x00F00000) >> 20; dwValue1 = (dwAttribute & 0x000F0000) >> 16; dwType2 = (dwAttribute & 0x0000F000) >> 12; dwValue2 = (dwAttribute & 0x00000F00) >> 8; if (dwType1 != 0) { ZeroMemory(cTxt, sizeof(cTxt)); switch (dwType1) { case 1: strcpy(cTxt, GET_ITEM_NAME3); break; case 2: strcpy(cTxt, GET_ITEM_NAME4); break; case 3: strcpy(cTxt, GET_ITEM_NAME5); break; case 4: break; case 5: strcpy(cTxt, GET_ITEM_NAME6); break; case 6: strcpy(cTxt, GET_ITEM_NAME7); break; case 7: strcpy(cTxt, GET_ITEM_NAME8); break; case 8: strcpy(cTxt, GET_ITEM_NAME9); break; case 9: strcpy(cTxt, GET_ITEM_NAME10); break; case 10: strcpy(cTxt, GET_ITEM_NAME11); break; case 11: strcpy(cTxt, GET_ITEM_NAME12); break; case 12: strcpy(cTxt, GET_ITEM_NAME13); break; case 15: strcpy(cTxt, GET_ITEM_NAME50); break; } strcat(cTxt, pStr1); ZeroMemory(pStr1, sizeof(pStr1)); strcpy(pStr1, cTxt); ZeroMemory(cTxt, sizeof(cTxt)); switch (dwType1) { case 1: wsprintf(cTxt, GET_ITEM_NAME14, dwValue1); break; case 2: wsprintf(cTxt, GET_ITEM_NAME15, dwValue1*5); break; case 3: break; case 4: break; case 5: strcpy(cTxt, GET_ITEM_NAME16); break; case 6: wsprintf(cTxt, GET_ITEM_NAME17, dwValue1*4); break; case 7: strcpy(cTxt, GET_ITEM_NAME18); break; case 8: wsprintf(cTxt, GET_ITEM_NAME19, dwValue1*7); break; case 9: strcpy(cTxt, GET_ITEM_NAME20); break; case 10: wsprintf(cTxt, GET_ITEM_NAME21, dwValue1*3); break; case 11: wsprintf(cTxt, GET_ITEM_NAME22, dwValue1); break; case 12: wsprintf(cTxt, GET_ITEM_NAME23, dwValue1); break; case 15: switch(dwValue1){ case 1: wsprintf(cTxt, GET_ITEM_NAME51, dwValue2*7); break; break; case 2: wsprintf(cTxt, GET_ITEM_NAME52, dwValue2*7); break; break; case 3: wsprintf(cTxt, GET_ITEM_NAME53, dwValue2*7); break; break; case 4: wsprintf(cTxt, GET_ITEM_NAME54, dwValue2*7); break; break; case 5: wsprintf(cTxt, GET_ITEM_NAME55, dwValue2*7); break; break; case 6: wsprintf(cTxt, GET_ITEM_NAME56, dwValue2*7); break; break; case 7: wsprintf(cTxt, GET_ITEM_NAME57, dwValue2*7); break; break; case 8: wsprintf(cTxt, GET_ITEM_NAME58, dwValue2*7); break; break; case 9: wsprintf(cTxt, GET_ITEM_NAME59, dwValue2*7); break; break; case 10: wsprintf(cTxt, GET_ITEM_NAME60, dwValue2*7); break; break; case 11: wsprintf(cTxt, GET_ITEM_NAME61, dwValue2*7); break; break; case 12: wsprintf(cTxt, GET_ITEM_NAME62, dwValue2*7); break; break; case 13: wsprintf(cTxt, GET_ITEM_NAME63, dwValue2*7); break; break; case 14: wsprintf(cTxt, GET_ITEM_NAME64, dwValue2*7); break; break; case 15: wsprintf(cTxt, GET_ITEM_NAME65, dwValue2*7); break; break; case 16: wsprintf(cTxt, GET_ITEM_NAME66, dwValue2*7); break; break; } break; } ZeroMemory(cTxt, sizeof(cTxt)); switch (dwType1) { case 1: wsprintf(cTxt, GET_ITEM_NAME14, dwValue1); break; case 2: wsprintf(cTxt, GET_ITEM_NAME15, dwValue1*5); break; case 3: break; case 4: break; case 5: strcpy(cTxt, GET_ITEM_NAME16); break; case 6: wsprintf(cTxt, GET_ITEM_NAME17, dwValue1*4); break; case 7: strcpy(cTxt, GET_ITEM_NAME18); break; case 8: wsprintf(cTxt, GET_ITEM_NAME19, dwValue1*7); break; case 9: strcpy(cTxt, GET_ITEM_NAME20); break; case 10: wsprintf(cTxt, GET_ITEM_NAME21, dwValue1*3); break; case 11: wsprintf(cTxt, GET_ITEM_NAME22, dwValue1); break; case 12: wsprintf(cTxt, GET_ITEM_NAME23, dwValue1); break; } strcat(pStr2, cTxt); if (dwType2 != 0) { ZeroMemory(cTxt, sizeof(cTxt)); switch (dwType2) { case 1: wsprintf(cTxt, GET_ITEM_NAME24, dwValue2*7); break; case 2: wsprintf(cTxt, GET_ITEM_NAME25, dwValue2*7); break; case 3: wsprintf(cTxt, GET_ITEM_NAME26, dwValue2*7); break; case 4: wsprintf(cTxt, GET_ITEM_NAME27, dwValue2*7); break; case 5: wsprintf(cTxt, GET_ITEM_NAME28, dwValue2*7); break; case 6: wsprintf(cTxt, GET_ITEM_NAME29, dwValue2*7); break; case 7: wsprintf(cTxt, GET_ITEM_NAME30, dwValue2*7); break; case 8: wsprintf(cTxt, GET_ITEM_NAME31, dwValue2*3); break; case 9: wsprintf(cTxt, GET_ITEM_NAME32, dwValue2*3); break; case 10: wsprintf(cTxt, GET_ITEM_NAME33, dwValue2); break; case 11: wsprintf(cTxt, GET_ITEM_NAME34, dwValue2*10); break; case 12: wsprintf(cTxt, GET_ITEM_NAME35, dwValue2*10); break; } strcpy(pStr3, cTxt); } } } dwValue3 = (dwAttribute & 0xF0000000) >> 28; if (dwValue3 > 0) { if (pStr1[strlen(pStr1)-2] == '+') { dwValue3 = atoi((char *)(pStr1 + strlen(pStr1)-1)) + dwValue3; ZeroMemory(cTxt, sizeof(cTxt)); memcpy(cTxt, pStr1, strlen(pStr1)-2); ZeroMemory(cTxt2, sizeof(cTxt2)); wsprintf(cTxt2, "%s+%d", cTxt, dwValue3); ZeroMemory(pStr1, sizeof(pStr1)); strcpy(pStr1, cTxt2); } else { ZeroMemory(cTxt, sizeof(cTxt)); wsprintf(cTxt, "+%d", dwValue3); strcat(pStr1, cTxt); } } }
nice, i'd love to see themdiuuude wrote: yes... that's it !
By the way, i'm working on new defensive magic items, it will be released soon...
Ex :
- Healing Necklace : 3% -> 27% chance casting Heal when attacked
- Defensive Ring : 3% -> 27% chance casting Defense-Shield when attacked
- PFM Cape : 3% -> 27% chance casting Protection-From-Magic when attacked
- Great-Healing Boots : 3% -> 27% chance casting Great-Heal when attacked
- Zerk Leggings : 2% -> 18% chance casting Berserk when attacked
- Paralyze Hauberk : 2% -> 18% chance casting paralyze on ennemy when attacked
Mana / Health / Stamina / Stats increasing Items are comming too, but won't be released to public, you'll have to ask me in order to have it when i'll be done with it![]()