# HG changeset patch # User yoctozepto # Date 1378303215 -7200 # Node ID 4c787c28ddce95a69832423d3677443459b24477 # Parent 091c5eb46a0e4c8438e9fb43ffd3dc7a0315c8b1 Clean CastSpellInfo. (2) diff -r 091c5eb46a0e -r 4c787c28ddce Actor.cpp --- a/Actor.cpp Wed Sep 04 15:27:01 2013 +0200 +++ b/Actor.cpp Wed Sep 04 16:00:15 2013 +0200 @@ -294,7 +294,7 @@ } //----- (00404AC7) -------------------------------------------------------- -void __fastcall Actor::AI_SpellAttack(unsigned int uActorID, AIDirection *pDir, int spellnum, int a4, unsigned int uSkillLevel) +void __fastcall Actor::AI_SpellAttack(unsigned int uActorID, AIDirection *pDir, int uSpellID, int a4, unsigned int uSkillLevel) { Actor *v5; // esi@1 unsigned int v6; // edi@1 @@ -426,25 +426,25 @@ v117 = pDir; v6 = uSkillLevel & 0x3F; v7 = SkillToMastery(uSkillLevel); - if ( spellnum <= 47 ) + if ( uSpellID <= 47 ) { - if ( spellnum != 47 ) + if ( uSpellID != 47 ) { - if ( spellnum <= 18 ) + if ( uSpellID <= 18 ) { - if ( spellnum == 18 || spellnum == 2 ) + if ( uSpellID == 18 || uSpellID == 2 ) goto LABEL_159; - if ( spellnum != 5 ) + if ( uSpellID != 5 ) { - if ( spellnum == 6 ) + if ( uSpellID == 6 ) goto LABEL_159; - if ( spellnum != 9 ) + if ( uSpellID != 9 ) { - if ( spellnum != 11 ) + if ( uSpellID != 11 ) { - if ( spellnum != 15 ) + if ( uSpellID != 15 ) { - if ( spellnum != 17 ) + if ( uSpellID != 17 ) return; if ( (signed int)v7 <= 0 ) goto LABEL_20; @@ -577,7 +577,7 @@ return; } LABEL_159: - a1.uType = stru_4E3ACC[spellnum].uType; + a1.uType = stru_4E3ACC[uSpellID].uType; v119 = 0.0; if ( (signed int)pObjectList->uNumObjects <= 0 ) { @@ -598,7 +598,7 @@ } a1.uObjectDescID = v82; a1.stru_24.Reset(); - a1.spell_id = spellnum; + a1.spell_id = uSpellID; v83 = v5->vPosition.x; v84 = v5->vPosition.y; a1.spell_level = uSkillLevel; @@ -660,7 +660,7 @@ LOBYTE(v92) = v92 | 2; v100 = 0; v99 = v92; - v22 = (SoundID)word_4EE088_sound_ids[spellnum]; + v22 = (SoundID)word_4EE088_sound_ids[uSpellID]; goto LABEL_202; } return; @@ -844,13 +844,13 @@ v39 = 0; goto LABEL_79; } - if ( spellnum == 26 || spellnum == 29 ) + if ( uSpellID == 26 || uSpellID == 29 ) goto LABEL_159; - if ( spellnum != 38 ) + if ( uSpellID != 38 ) { - if ( spellnum == 39 || spellnum == 41 ) + if ( uSpellID == 39 || uSpellID == 41 ) goto LABEL_159; - if ( spellnum != 46 ) + if ( uSpellID != 46 ) return; if ( (signed int)v7 > 0 ) { @@ -971,9 +971,9 @@ LOWORD(v48) = 0; goto LABEL_114; } - if ( spellnum <= 80 ) + if ( uSpellID <= 80 ) { - if ( spellnum == 80 ) + if ( uSpellID == 80 ) { v56 = pParty->pPartyBuffs; do @@ -1019,11 +1019,11 @@ v22 = (SoundID)word_4EE088_sound_ids[80]; goto LABEL_202; } - if ( spellnum != 51 ) + if ( uSpellID != 51 ) { - if ( spellnum == 57 || spellnum == 65 || spellnum == 70 ) + if ( uSpellID == 57 || uSpellID == 65 || uSpellID == 70 ) goto LABEL_159; - if ( spellnum == 73 ) + if ( uSpellID == 73 ) { if ( (signed int)v7 <= 0 || (signed int)v7 > 4 ) v51 = 0; @@ -1048,7 +1048,7 @@ v98 = (SoundID)16060; goto LABEL_222; } - if ( spellnum == 77 ) + if ( uSpellID == 77 ) { v5->sCurrentHP += 5 * v6 + 10; if ( v5->sCurrentHP >= (signed int)v5->pMonsterInfo.uHP ) @@ -1057,7 +1057,7 @@ v47 = 0; goto LABEL_127; } - v49 = spellnum == 78; + v49 = uSpellID == 78; LABEL_158: if ( !v49 ) return; @@ -1104,7 +1104,7 @@ v54 = 0; goto LABEL_142; } - if ( spellnum == 85 ) + if ( uSpellID == 85 ) { if ( (signed int)v7 > 0 ) { @@ -1148,7 +1148,7 @@ v96 = 0; goto LABEL_221; } - if ( spellnum == 86 ) + if ( uSpellID == 86 ) { if ( (signed int)v7 > 0 ) { @@ -1191,13 +1191,13 @@ v94 = 0; goto LABEL_212; } - if ( spellnum == 90 ) + if ( uSpellID == 90 ) goto LABEL_159; - if ( spellnum != 93 ) + if ( uSpellID != 93 ) { - if ( spellnum != 95 ) + if ( uSpellID != 95 ) { - v49 = spellnum == 97; + v49 = uSpellID == 97; goto LABEL_158; } if ( (signed int)v7 > 0 ) diff -r 091c5eb46a0e -r 4c787c28ddce Actor.h --- a/Actor.h Wed Sep 04 15:27:01 2013 +0200 +++ b/Actor.h Wed Sep 04 16:00:15 2013 +0200 @@ -214,7 +214,7 @@ static struct AIDirection *__fastcall GetDirectionInfo(unsigned int uObj1ID, unsigned int uObj2ID, struct AIDirection *pOut, int a4); static signed int __fastcall Explode(unsigned int uActorID); static char __fastcall AI_RangedAttack(unsigned int uActorID, struct AIDirection *a2, int type, char a4); - static void __fastcall AI_SpellAttack(unsigned int uActorID, struct AIDirection *pDir, int spellnum, int a4, unsigned int uSkillLevel); + static void __fastcall AI_SpellAttack(unsigned int uActorID, struct AIDirection *pDir, int uSpellID, int a4, unsigned int uSkillLevel); static void AggroSurroundingPeasants(unsigned int uActorID, int a2); static bool ArePeasantsOfSameFaction(Actor *a1, Actor *a2); static bool StealFrom(unsigned int uActorID); diff -r 091c5eb46a0e -r 4c787c28ddce CastSpellInfo.cpp --- a/CastSpellInfo.cpp Wed Sep 04 15:27:01 2013 +0200 +++ b/CastSpellInfo.cpp Wed Sep 04 16:00:15 2013 +0200 @@ -313,13 +313,13 @@ { pCastSpell = &pCastSpellInfo[n]; HIDWORD(v733) = (int)pCastSpell; - if ( pCastSpell->spellnum == 0 ) + if ( pCastSpell->uSpellID == 0 ) continue; if (pParty->Invisible()) pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); - if ( pCastSpell->field_8 & 0x3CA ) + if ( pCastSpell->uFlags & 0x3CA ) { if ( !pParty->pPlayers[pCastSpell->uPlayerID].CanAct() ) _427D48(); @@ -330,9 +330,9 @@ a2 = pCastSpell->spell_target_pid; if (!pCastSpell->spell_target_pid) { - if (pCastSpell->spellnum == SPELL_LIGHT_DESTROY_UNDEAD || - pCastSpell->spellnum == SPELL_SPIRIT_TURN_UNDEAD || - pCastSpell->spellnum == SPELL_DARK_CONTROL_UNDEAD ) + if (pCastSpell->uSpellID == SPELL_LIGHT_DESTROY_UNDEAD || + pCastSpell->uSpellID == SPELL_SPIRIT_TURN_UNDEAD || + pCastSpell->uSpellID == SPELL_DARK_CONTROL_UNDEAD ) v666 = 1; else v666 = 0; @@ -344,7 +344,7 @@ } - pSpellSprite.uType = stru_4E3ACC[pCastSpell->spellnum].uType; + pSpellSprite.uType = stru_4E3ACC[pCastSpell->uSpellID].uType; if (pSpellSprite.uType) { if (PID_TYPE(a2) == OBJECT_Actor) @@ -370,25 +370,25 @@ else { //v667 = PLAYER_SKILL_STAFF; - if (pCastSpell->spellnum < SPELL_AIR_WIZARD_EYE) + if (pCastSpell->uSpellID < SPELL_AIR_WIZARD_EYE) v667 = PLAYER_SKILL_FIRE; - else if (pCastSpell->spellnum < SPELL_WATER_AWAKEN) + else if (pCastSpell->uSpellID < SPELL_WATER_AWAKEN) v667 = PLAYER_SKILL_AIR; - else if (pCastSpell->spellnum < SPELL_EARTH_STUN) + else if (pCastSpell->uSpellID < SPELL_EARTH_STUN) v667 = PLAYER_SKILL_WATER; - else if (pCastSpell->spellnum < SPELL_SPIRIT_DETECT_LIFE) + else if (pCastSpell->uSpellID < SPELL_SPIRIT_DETECT_LIFE) v667 = PLAYER_SKILL_EARTH; - else if (pCastSpell->spellnum < SPELL_MIND_REMOVE_FEAR) + else if (pCastSpell->uSpellID < SPELL_MIND_REMOVE_FEAR) v667 = PLAYER_SKILL_SPIRIT; - else if (pCastSpell->spellnum < SPELL_BODY_CURE_WEAKNESS) + else if (pCastSpell->uSpellID < SPELL_BODY_CURE_WEAKNESS) v667 = PLAYER_SKILL_MIND; - else if (pCastSpell->spellnum < SPELL_LIGHT_LIGHT_BOLT) + else if (pCastSpell->uSpellID < SPELL_LIGHT_LIGHT_BOLT) v667 = PLAYER_SKILL_BODY; - else if (pCastSpell->spellnum < SPELL_DARK_REANIMATE) + else if (pCastSpell->uSpellID < SPELL_DARK_REANIMATE) v667 = PLAYER_SKILL_LIGHT; - else if (pCastSpell->spellnum < SPELL_BOW_ARROW) + else if (pCastSpell->uSpellID < SPELL_BOW_ARROW) v667 = PLAYER_SKILL_DARK; - else if (pCastSpell->spellnum == SPELL_BOW_ARROW) + else if (pCastSpell->uSpellID == SPELL_BOW_ARROW) v667 = PLAYER_SKILL_BOW; else assert(false && "Unknown spell"); @@ -403,21 +403,21 @@ if (pCastSpell->forced_spell_skill_level) uRequiredMana = 0; else - uRequiredMana = pSpellDatas[pCastSpell->spellnum - 1].mana_per_skill[v731 - 1]; - sRecoveryTime = pSpellDatas[pCastSpell->spellnum - 1].recovery_per_skill[v731 - 1]; + uRequiredMana = pSpellDatas[pCastSpell->uSpellID - 1].mana_per_skill[v731 - 1]; + sRecoveryTime = pSpellDatas[pCastSpell->uSpellID - 1].recovery_per_skill[v731 - 1]; if (LODWORD(v725) == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 || LODWORD(v725) == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0) uRequiredMana = 0; - if (pCastSpell->spellnum < SPELL_BOW_ARROW && pPlayer->sMana < uRequiredMana) + if (pCastSpell->uSpellID < SPELL_BOW_ARROW && pPlayer->sMana < uRequiredMana) { ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); // "Not enough spell points" - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } - v730 = pCastSpell->spellnum; - if (pPlayer->IsCursed() && pCastSpell->spellnum < SPELL_BOW_ARROW && rand() % 100 < 50) + v730 = pCastSpell->uSpellID; + if (pPlayer->IsCursed() && pCastSpell->uSpellID < SPELL_BOW_ARROW && rand() % 100 < 50) { if (!pParty->bTurnBasedModeOn) { @@ -437,12 +437,12 @@ } ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); // "Spell failed" pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpellInfo[n].spellnum = 0; + pCastSpellInfo[n].uSpellID = 0; pPlayer->sMana -= uRequiredMana; return; } - switch ( pCastSpell->spellnum ) + switch ( pCastSpell->uSpellID ) { case SPELL_101: assert(false && "Unknown spell effect #101 (prolly flaming bow arrow"); @@ -454,7 +454,7 @@ sRecoveryTime = pPlayer->GetAttackRecoveryTime(true); pSpellSprite.stru_24.Reset(); pSpellSprite.spell_level = v2; - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); if ( pPlayer->WearsItem(ITEM_ARTEFACT_ULLYSES, EQUIP_BOW) ) @@ -489,7 +489,7 @@ { sRecoveryTime = pPlayer->GetAttackRecoveryTime(0); pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v723; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -572,13 +572,13 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -609,7 +609,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } if (PID_TYPE(a2) != OBJECT_Actor) @@ -621,7 +621,7 @@ v697.y = 0; v697.z = 0; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -655,7 +655,7 @@ v704.y = 0; v704.z = 0; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -685,7 +685,7 @@ v691.y = 0; v691.z = 0; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -706,7 +706,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v691); @@ -730,7 +730,7 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -750,7 +750,7 @@ pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id); if ( pParty->bTurnBasedModeOn == 1 ) LOBYTE(pSpellSprite.uAttributes) |= 4u; - if ( pCastSpell->spellnum == SPELL_AIR_LIGHNING_BOLT ) + if ( pCastSpell->uSpellID == SPELL_AIR_LIGHNING_BOLT ) LOBYTE(pSpellSprite.uAttributes) |= 0x40u; v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed; if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 ) @@ -766,7 +766,7 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -800,13 +800,13 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } if ( pPlayer->CanCastSpell(uRequiredMana) ) { pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_skill = v731; pSpellSprite.spell_level = v2; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -918,7 +918,7 @@ pActors[PID_ID(a2)].pActorBuffs[1].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)(power << 7) * 0.033333335), v731, 0, 0, 0); pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -1026,7 +1026,7 @@ ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } case SPELL_BODY_REGENERATION: @@ -1043,7 +1043,7 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_REGENERATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669), v731, amount, 0, 0); LODWORD(v727) = 1; @@ -1066,7 +1066,7 @@ assert(false); } - switch (pCastSpell->spellnum) + switch (pCastSpell->uSpellID) { case SPELL_FIRE_PROTECTION_FROM_FIRE: LODWORD(v725) = PARTY_BUFF_RESIST_FIRE; @@ -1092,10 +1092,10 @@ } if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); v90 = (double)(signed int)v733 * 4.2666669; pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); LODWORD(v727) = 1; @@ -1127,10 +1127,10 @@ { pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); } } break; @@ -1152,7 +1152,7 @@ if ( v731 == 1 ) { v108 = pCastSpell->uPlayerID_2; - v109 = pCastSpell->spellnum; + v109 = pCastSpell->uSpellID; v110 = pGame->GetStru6(); pGame->GetStru6()->SetPlayerBuffAnim(v109, v108); v111 = pOtherOverlayList->_4418B1(10000, pCastSpell->uPlayerID_2 + 310, 0, 65536); @@ -1176,7 +1176,7 @@ v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; do { - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, v105); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, v105); v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, 0, 65536); v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); ++v730b; @@ -1223,7 +1223,7 @@ v701.y = 0; v701.z = 0; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v723; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -1246,7 +1246,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; } //pCastSpell = (CastSpellInfo *)HIDWORD(v733); } @@ -1265,7 +1265,7 @@ default: assert(false); } - v127 = pCastSpell->spellnum; + v127 = pCastSpell->uSpellID; if ( v127 == 17 ) { amount = 0; @@ -1288,10 +1288,10 @@ } if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; //LABEL_304: pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); @@ -1307,10 +1307,10 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); LODWORD(v727) = 1; @@ -1333,7 +1333,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[491], 2); // Can't cast Meteor Shower indoors! pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) @@ -1377,7 +1377,7 @@ stru_5C6E00->Atan2(j, k)); } pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -1412,7 +1412,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[492], 2); // Can't cast Inferno outdoors! pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) @@ -1422,7 +1422,7 @@ v700.y = 0; v700.x = 0; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -1489,10 +1489,10 @@ do pOtherOverlayList->_4418B1(2010, v174++ + 100, 0, 65536); while ( v174 < 4 ); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); LODWORD(v727) = 1; @@ -1513,7 +1513,7 @@ break; auto _v726 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -1583,15 +1583,15 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[638], 2); // There are hostile creatures nearby! pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } if ( pPlayer->CanCastSpell(uRequiredMana) ) { - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0); LODWORD(v727) = 1; @@ -1638,7 +1638,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[495], 2); // Can't cast Starburst indoors! pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) @@ -1693,7 +1693,7 @@ stru_5C6E00->Atan2((signed __int64)v216, (signed __int64)*(float *)&uRequiredMana)); } pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -1778,7 +1778,7 @@ if ( amount == 1 ) { pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_skill = v731; pSpellSprite.spell_level = v2; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -1807,7 +1807,7 @@ else { pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -1862,10 +1862,10 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; v716 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].Apply( pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), @@ -1892,7 +1892,7 @@ ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } if ( v731 == 1 || v731 == 2 ) @@ -1924,7 +1924,7 @@ dword_50C9D8 = 1; ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; v2 = v723; continue; } @@ -2099,7 +2099,7 @@ ShowStatusBarString(v317, 2u); pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); v318 = &pParty->pPlayers[pCastSpell->uPlayerID_2]; - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; v318->PlaySound(SPEECH_43, 0); } @@ -2114,7 +2114,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } town_portal_caster_id = LOBYTE(pCastSpell->uPlayerID); @@ -2129,7 +2129,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } v319 = uRequiredMana; @@ -2142,8 +2142,8 @@ ::uRequiredMana = v319; ::sRecoveryTime = sRecoveryTime; dword_50633C = pCastSpell->sound_id; - dword_506338 = pCastSpell->spellnum; - LOBYTE(pCastSpell->field_8) |= 0x20u; + dword_506338 = pCastSpell->uSpellID; + pCastSpell->uFlags |= 0x20u; } break; } @@ -2189,7 +2189,7 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -2222,14 +2222,14 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; pSpellSprite.uType = 4090; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -2271,10 +2271,10 @@ LODWORD(v733) = v330; if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); LODWORD(v727) = 1; @@ -2297,7 +2297,7 @@ v342 = pCastSpell->spell_target_pid; if ( v342 == 0 ) { - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, v731, amount, 0, 0); LODWORD(v727) = 1; @@ -2351,7 +2351,7 @@ break; } } - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); LODWORD(v727) = 1; break; } @@ -2365,7 +2365,7 @@ break; if ( v731 == 1 || v731 == 2 ) { - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); LODWORD(v727) = 1; break; @@ -2375,7 +2375,7 @@ v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; do { - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, a2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, a2); v357->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + v717, v731, 0, 0, 0); ++a2; ++v357;// = (SpellBuff *)((char *)v357 + 6972); @@ -2396,7 +2396,7 @@ pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); ++pSpellSprite.uType; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -2513,7 +2513,7 @@ } v388 = _v733; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, LOWORD(v682[_v733]) - 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, LOWORD(v682[_v733]) - 1); _v733 = v388 + 1; } while ( v388 + 1 < v730 ); @@ -2564,7 +2564,7 @@ } pParty->pPlayers[pCastSpell->uPlayerID_2].SetCondition(1u, 1); pParty->pPlayers[pCastSpell->uPlayerID_2].sHealth = 1; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); } LODWORD(v727) = 1; break; @@ -2583,7 +2583,7 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); v323 = pCastSpell->uPlayerID_2; v324 = (char *)&pParty->pPlayers[v323].pConditions[12]; if ( !pParty->pPlayers[v323].pConditions[12] ) @@ -2620,7 +2620,7 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); v323 = pCastSpell->uPlayerID_2; v324 = (char *)&pParty->pPlayers[v323].pConditions[3]; if ( !pParty->pPlayers[v323].pConditions[3] ) @@ -2722,7 +2722,7 @@ } ShowStatusBarString(pTmpBuf2.data(), 2u); pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -2775,7 +2775,7 @@ pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; } pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -2825,7 +2825,7 @@ v731, 0, 0, 0); } pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -2866,7 +2866,7 @@ pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); ++pSpellSprite.uType; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -2907,7 +2907,7 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); v440 = pCastSpell->uPlayerID_2; if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) { @@ -3018,7 +3018,7 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); v323 = pCastSpell->uPlayerID_2; v324 = (char *)&pParty->pPlayers[v323].pConditions[1]; if ( !pParty->pPlayers[v323].pConditions[1] ) @@ -3057,7 +3057,7 @@ if (!v460) { pParty->pPlayers[pCastSpell->uPlayerID_2].Heal(amount); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); } else { @@ -3100,7 +3100,7 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); v470 = pCastSpell->uPlayerID_2; if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6])) && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) @@ -3143,10 +3143,10 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); LODWORD(v727) = 1; @@ -3160,10 +3160,10 @@ break; if ( v731 == 4 ) { - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); v732 = (int)v733 << 7; v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); pParty->pPlayers[0].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); @@ -3174,7 +3174,7 @@ LODWORD(v727) = 1; break; } - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, v2, 0); LODWORD(v727) = 1; @@ -3189,7 +3189,7 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); v498 = pCastSpell->uPlayerID_2; if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) @@ -3235,7 +3235,7 @@ int v1 = 0; do { - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, v1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, v1); v501->Heal(amount); ++v501; ++v1; @@ -3258,7 +3258,7 @@ v688.y = 0; v688.z = 0; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -3327,7 +3327,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[648], 2); // This character can't summon any more monsters! pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) @@ -3350,10 +3350,10 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0); LODWORD(v727) = 1; @@ -3366,7 +3366,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[497], 2); // Can't cast Prismatic Light outdoors! pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) @@ -3377,7 +3377,7 @@ v694.y = 0; v694.z = 0; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -3425,10 +3425,10 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); v732 = v730 << 7; v549 = (double)(v730 << 7) * 0.033333335; @@ -3471,10 +3471,10 @@ *((float *)&v733) = (double)v732 * 0.033333335; do { - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); //((SpellBuff *)(v553 + 6056))->Apply( v553->pPlayerBuffs[4].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733)), v731, v730, 0, 0); @@ -3501,7 +3501,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) @@ -3524,7 +3524,7 @@ *(int *)(_this->uItemID + 6460) = v565; v567 = (*v566)->GetMaxMana(); *(int *)(_this->uItemID + 6464) = v567; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, a2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, a2); ++a2; _this = (ItemGen *)((char *)_this + 4); } @@ -3557,7 +3557,7 @@ if (!v576) { v585 = (char *)&pParty->pPlayers[pCastSpell->uPlayerID_2]; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); if ( *((_QWORD *)v585 + 14) ) { ((Player *)v585)->SetCondition(0x11u, 1); @@ -3573,7 +3573,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[496], 2); // No valid target exists! pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } v578 = (int)&pActors[(int)v577]; @@ -3582,12 +3582,12 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } ++pSpellSprite.uType; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -3656,7 +3656,7 @@ ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } v592 = _v733; @@ -3688,7 +3688,7 @@ break; auto _v726 = ((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -3754,7 +3754,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } pActor->pActorBuffs[9].Reset(); @@ -3762,7 +3762,7 @@ pActor->pActorBuffs[12].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -3838,7 +3838,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } v610 = 76 * v609; @@ -3883,7 +3883,7 @@ break; if ( v731 != 3 && v731 != 4 ) { - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, v716, 0); LODWORD(v727) = 1; break; @@ -3893,7 +3893,7 @@ v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; do { - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, a2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, a2); v619->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); ++a2; ++v619; @@ -3913,7 +3913,7 @@ v707.y = 0; v707.z = 0; pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->spellnum; + pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = v2; pSpellSprite.spell_skill = v731; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); @@ -3978,7 +3978,7 @@ v726->sHealth = v726->GetMaxHealth(); v635 = _v733; - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, WORD2(v733)); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, WORD2(v733)); _v733 = v635 + 1; } while ( v635 + 1 < v730 ); @@ -3993,7 +3993,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[499], 2); // Can't cast Armageddon indoors! pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } if ( v731 == 4) @@ -4004,7 +4004,7 @@ { ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; continue; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) @@ -4034,10 +4034,10 @@ default: break; } - if ( pCastSpell->field_8 & 0x20 ) + if ( pCastSpell->uFlags & 0x20 ) { if ( v727 != 0.0 ) - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[pCastSpell->spellnum], 0, 0, -1, 0, pCastSpell->sound_id, 0, 0); + pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[pCastSpell->uSpellID], 0, 0, -1, 0, pCastSpell->sound_id, 0, 0); } else { @@ -4060,29 +4060,29 @@ { pPlayer->PlaySound(SPEECH_49, 0); if ( v727 != 0.0 ) - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[pCastSpell->spellnum], 0, 0, -1, 0, pCastSpell->sound_id, 0, 0); + pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[pCastSpell->uSpellID], 0, 0, -1, 0, pCastSpell->sound_id, 0, 0); } } - pCastSpell->spellnum = 0; + pCastSpell->uSpellID = 0; v2 = v723; continue; } } //----- (00427DA0) -------------------------------------------------------- -unsigned int PushCastSpellInfo(__int16 a2, __int16 uPlayerID, __int16 skill_level, __int16 a5, int spell_sound_id) +size_t PushCastSpellInfo(uint16_t uSpellID, uint16_t uPlayerID, __int16 skill_level, uint16_t uFlags, int spell_sound_id) { for (size_t i = 0; i < CastSpellInfoCount; i++) { - if (!pCastSpellInfo[i].spellnum) + if (!pCastSpellInfo[i].uSpellID) { - pCastSpellInfo[i].spellnum = a2; + pCastSpellInfo[i].uSpellID = uSpellID; pCastSpellInfo[i].uPlayerID = uPlayerID; - if ( a5 & 0x10 ) + if (uFlags & 0x10) pCastSpellInfo[i].uPlayerID_2 = uPlayerID; pCastSpellInfo[i].field_6 = 0; pCastSpellInfo[i].spell_target_pid = 0; - pCastSpellInfo[i].field_8 = a5; + pCastSpellInfo[i].uFlags = uFlags; pCastSpellInfo[i].forced_spell_skill_level = skill_level; pCastSpellInfo[i].sound_id = spell_sound_id; return i; @@ -4095,9 +4095,9 @@ { for (size_t i = 0; i < CastSpellInfoCount; i++) { - if (pCastSpellInfo[i].spellnum && pCastSpellInfo[i].field_8 & 0x3CA) + if (pCastSpellInfo[i].uSpellID && pCastSpellInfo[i].uFlags & 0x3CA) { - pCastSpellInfo[i].spellnum = 0; + pCastSpellInfo[i].uSpellID = 0; pGUIWindow_Settings->Release(); pGUIWindow_Settings = 0; pMouse->SetCursorBitmap("MICON1"); @@ -4309,9 +4309,9 @@ if (a5 & 0x3CA) { for (uint i = 0; i < CastSpellInfoCount; ++i) - if (pCastSpellInfo[i].field_8 & 0x3CA) + if (pCastSpellInfo[i].uFlags & 0x3CA) { - pCastSpellInfo[i].spellnum = 0; + pCastSpellInfo[i].uSpellID = 0; break; } } @@ -4319,11 +4319,11 @@ for (uint i = 0; i < CastSpellInfoCount; ++i) { auto spell = &pCastSpellInfo[i]; - if (!spell->spellnum) + if (!spell->uSpellID) continue; - spell->spellnum = 0; - if (spell->field_8 & 0x3CA) + spell->uSpellID = 0; + if (spell->uFlags & 0x3CA) { pGUIWindow_Settings->Release(); pGUIWindow_Settings = nullptr; diff -r 091c5eb46a0e -r 4c787c28ddce CastSpellInfo.h --- a/CastSpellInfo.h Wed Sep 04 15:27:01 2013 +0200 +++ b/CastSpellInfo.h Wed Sep 04 16:00:15 2013 +0200 @@ -1,4 +1,7 @@ #pragma once + +#include + #include namespace CastSpellInfoHelpers @@ -14,21 +17,16 @@ //----- (00426987) -------------------------------------------------------- inline CastSpellInfo() { - field_8 = 0; - spellnum = 0; - field_6 = 0; - uPlayerID_2 = 0; - uPlayerID = 0; - sound_id = 0; + memset(this, 0, sizeof(this)); } struct GUIWindow *GetCastSpellInInventoryWindow(); - __int16 spellnum; - unsigned __int16 uPlayerID; - __int16 uPlayerID_2; + uint16_t uSpellID; + uint16_t uPlayerID; + uint16_t uPlayerID_2; __int16 field_6; - __int16 field_8; + uint16_t uFlags; __int16 forced_spell_skill_level; int spell_target_pid; int sound_id; diff -r 091c5eb46a0e -r 4c787c28ddce Spells.cpp --- a/Spells.cpp Wed Sep 04 15:27:01 2013 +0200 +++ b/Spells.cpp Wed Sep 04 16:00:15 2013 +0200 @@ -441,7 +441,7 @@ } //----- (00448DF8) -------------------------------------------------------- -void __fastcall EventCastSpell(int spellnum, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz)//sub_448DF8 +void __fastcall EventCastSpell(int uSpellID, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz)//sub_448DF8 { int v9; // esi@1 double v10; // st7@4 @@ -509,7 +509,7 @@ v9 = 0; v59 = uSkillLevel + 1; - //spellnum_ = spellnum; + //spellnum_ = uSpellID; v60 = 0; if ( tox || toy || toz ) { @@ -552,12 +552,12 @@ SpriteObject a1; // [sp+38h] [bp-7Ch]@12 //SpriteObject::SpriteObject(&a1); - a1.uType = stru_4E3ACC[spellnum].uType; - if ( spellnum > 58 ) + a1.uType = stru_4E3ACC[uSpellID].uType; + if ( uSpellID > 58 ) { - if ( spellnum == 69 ) + if ( uSpellID == 69 ) goto LABEL_117; - if ( spellnum != 83 ) + if ( uSpellID != 83 ) return; v40 = v15 - 2; if ( v40 ) @@ -604,9 +604,9 @@ v37->Apply(v36, a7b, v43, 0, 0); goto LABEL_139; } - if ( spellnum != 58 ) + if ( uSpellID != 58 ) { - switch ( spellnum ) + switch ( uSpellID ) { case 2: case 6: @@ -618,7 +618,7 @@ case 41: a1.stru_24.Reset(); v16 = 0; - a1.spell_id = spellnum; + a1.spell_id = uSpellID; a1.spell_level = uSkill; a1.spell_skill = v15; if ( (signed int)pObjectList->uNumObjects <= 0 ) @@ -703,7 +703,7 @@ a8b = a7c / (v60 - 1); a1.stru_24.Reset(); v21 = 0; - a1.spell_id = spellnum; + a1.spell_id = uSpellID; a1.spell_level = uSkill; a1.spell_skill = v15; if ( (signed int)pObjectList->uNumObjects <= 0 ) @@ -759,7 +759,7 @@ } a1.stru_24.Reset(); v16 = 0; - a1.spell_id = spellnum; + a1.spell_id = uSpellID; a1.spell_level = uSkill; a1.spell_skill = v15; if ( (signed int)pObjectList->uNumObjects <= 0 ) @@ -849,7 +849,7 @@ a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1); a1.stru_24.Reset(); v25 = 0; - a1.spell_id = spellnum; + a1.spell_id = uSpellID; a1.spell_level = uSkill; a1.spell_skill = v15; if ( (signed int)pObjectList->uNumObjects <= 0 ) @@ -924,7 +924,7 @@ return; a1.stru_24.Reset(); v29 = 0; - a1.spell_id = spellnum; + a1.spell_id = uSpellID; a1.spell_level = uSkill; a1.spell_skill = v15; if ( (signed int)pObjectList->uNumObjects <= 0 ) @@ -985,10 +985,10 @@ 0, 0); //v33 = spellnum_; - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); goto LABEL_138; case 17: case 38: @@ -1006,7 +1006,7 @@ v9 = 3600 * (uSkill + 1); break; } - switch ( spellnum ) + switch ( uSpellID ) { case 17: v60 = 0; @@ -1023,10 +1023,10 @@ v60 = v34; break; } - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); v52 = 0; v50 = 0; v48 = v60; @@ -1040,10 +1040,10 @@ v38 = 60 * uSkill; else v38 = 600 * uSkill; - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); v52 = 0; v50 = 0; v48 = uSkill; @@ -1131,7 +1131,7 @@ goto LABEL_125; } LABEL_125: - switch ( spellnum ) + switch ( uSpellID ) { case 3: uSkill = 6; @@ -1153,16 +1153,16 @@ break; } //v45 = spellnum_; - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2); - pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); pParty->pPartyBuffs[uSkill].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669), v15, v60, 0, 0); //levela = 1; LABEL_138: //if ( levela ) LABEL_139: - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[spellnum], 0, 0, fromx, fromy, 0, 0, 0); + pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); } //----- (00427769) -------------------------------------------------------- bool __fastcall sub_427769_spell(unsigned int uSpellID) diff -r 091c5eb46a0e -r 4c787c28ddce mm7_5.cpp --- a/mm7_5.cpp Wed Sep 04 15:27:01 2013 +0200 +++ b/mm7_5.cpp Wed Sep 04 16:00:15 2013 +0200 @@ -1792,7 +1792,7 @@ if ( !v47 ) continue; pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; - LOBYTE(pSpellInfo->field_8) &= 0xBFu; + pSpellInfo->uFlags &= ~0x40u; pSpellInfo->uPlayerID_2 = uMessageParam; pSpellInfo->spell_target_pid = v44; pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); @@ -1810,7 +1810,7 @@ if ( !v47 ) continue; pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; - LOBYTE(pSpellInfo->field_8) &= 0xBFu; + pSpellInfo->uFlags &= ~0x40u; pSpellInfo->uPlayerID_2 = uMessageParam; pSpellInfo->spell_target_pid = v44; pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); @@ -1837,7 +1837,7 @@ continue; v44 = uNumSeconds; pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; - LOBYTE(pSpellInfo->field_8) &= 0xBFu; + pSpellInfo->uFlags &= ~0x40u; pSpellInfo->uPlayerID_2 = uMessageParam; pSpellInfo->spell_target_pid = v44; pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); @@ -1857,7 +1857,7 @@ if ( v48 ) continue; pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; - LOBYTE(pSpellInfo->field_8) &= 0xBFu; + pSpellInfo->uFlags &= ~0x40u; pSpellInfo->uPlayerID_2 = uMessageParam; pSpellInfo->spell_target_pid = v44; pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); @@ -1886,13 +1886,13 @@ switch ( uMessage ) { case UIMSG_CastSpell_Character_Big_Improvement: - LOBYTE(pSpellInfo->field_8) &= 0xFDu; + pSpellInfo->uFlags &= ~0x02u; break; case UIMSG_CastSpell_Character_Small_Improvement: - HIBYTE(pSpellInfo->field_8) &= 0xFEu; + pSpellInfo->uFlags &= ~0x0100u; break; case UIMSG_HiredNPC_CastSpell: - HIBYTE(pSpellInfo->field_8) &= 0xFDu; + pSpellInfo->uFlags &= ~0x0200u; break; } pSpellInfo->uPlayerID_2 = uMessageParam; @@ -2370,14 +2370,14 @@ pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; if ( uMessage == UIMSG_CastSpell_Shoot_Monster ) { - LOBYTE(pSpellInfo->field_8) &= 0xF7; + pSpellInfo->uFlags &= ~0x08; } else { if ( uMessage == UIMSG_CastSpell_Monster_Improvement ) - HIBYTE(pSpellInfo->field_8) &= 0xFEu; + pSpellInfo->uFlags &= ~0x0100u; else - HIBYTE(pSpellInfo->field_8) &= 0xFDu; + pSpellInfo->uFlags &= ~0x0200u; } pSpellInfo->uPlayerID_2 = uMessageParam; pSpellInfo->spell_target_pid = v44; diff -r 091c5eb46a0e -r 4c787c28ddce mm7_data.h --- a/mm7_data.h Wed Sep 04 15:27:01 2013 +0200 +++ b/mm7_data.h Wed Sep 04 16:00:15 2013 +0200 @@ -1366,7 +1366,7 @@ void GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide); // idb void OnTimer(int); void __fastcall sub_448CF4_spawn_monsters(__int16 typeindex, __int16 level, int count, int x, int y, int z, int group, unsigned int uUniqueName); -void __fastcall EventCastSpell(int spellnum, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz);//sub_448DF8 +void __fastcall EventCastSpell(int uSpellID, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz);//sub_448DF8 __int16 __fastcall sub_449A49_door_switch_animation(unsigned int uDoorID, int a2); // idb bool _449B57_test_bit(unsigned __int8 *a1, __int16 a2); void _449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle); // idb