Mercurial > mm7
comparison CastSpellInfo.cpp @ 2191:48a28fe1f32f
pInventoryItemList->Reset()
author | Ritor1 |
---|---|
date | Thu, 30 Jan 2014 17:41:54 +0600 |
parents | 0acbf1f82c70 |
children | c13ae8d8471f |
comparison
equal
deleted
inserted
replaced
2190:0acbf1f82c70 | 2191:48a28fe1f32f |
---|---|
100 AIDirection v715; // [sp+DA4h] [bp-E0h]@21 | 100 AIDirection v715; // [sp+DA4h] [bp-E0h]@21 |
101 int mon_id; | 101 int mon_id; |
102 int dist_Y; // [sp+DD8h] [bp-ACh]@163 | 102 int dist_Y; // [sp+DD8h] [bp-ACh]@163 |
103 int v723; // [sp+E4Ch] [bp-38h]@1 | 103 int v723; // [sp+E4Ch] [bp-38h]@1 |
104 ItemGen *_this; // [sp+E50h] [bp-34h]@23 | 104 ItemGen *_this; // [sp+E50h] [bp-34h]@23 |
105 float v725; // [sp+E54h] [bp-30h]@23 | 105 int v725; // [sp+E54h] [bp-30h]@23 |
106 int buff_resist; | 106 int buff_resist; |
107 bool spell_sound_flag; // [sp+E5Ch] [bp-28h]@1 | 107 bool spell_sound_flag; // [sp+E5Ch] [bp-28h]@1 |
108 Player *pPlayer; // [sp+E64h] [bp-20h]@8 | 108 Player *pPlayer; // [sp+E64h] [bp-20h]@8 |
109 int v730; // [sp+E68h] [bp-1Ch]@53 | 109 int v730; // [sp+E68h] [bp-1Ch]@53 |
110 ItemGen *v730c; | 110 ItemGen *v730c; |
172 v715.uYawAngle = pParty->sRotationY; | 172 v715.uYawAngle = pParty->sRotationY; |
173 v715.uPitchAngle = pParty->sRotationX; | 173 v715.uPitchAngle = pParty->sRotationX; |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
177 LODWORD(v725) = 0; | 177 v725 = 0; |
178 _this = 0; | 178 _this = 0; |
179 if (pCastSpell->forced_spell_skill_level) | 179 if (pCastSpell->forced_spell_skill_level) |
180 { | 180 { |
181 v11 = pCastSpell->forced_spell_skill_level; | 181 v11 = pCastSpell->forced_spell_skill_level; |
182 v723 = v11 & 0x3F; // 6 bytes | 182 v723 = v11 & 0x3F; // 6 bytes |
205 v667 = PLAYER_SKILL_DARK; | 205 v667 = PLAYER_SKILL_DARK; |
206 else if (pCastSpell->uSpellID == SPELL_BOW_ARROW) | 206 else if (pCastSpell->uSpellID == SPELL_BOW_ARROW) |
207 v667 = PLAYER_SKILL_BOW; | 207 v667 = PLAYER_SKILL_BOW; |
208 else assert(false && "Unknown spell"); | 208 else assert(false && "Unknown spell"); |
209 | 209 |
210 LODWORD(v725) = v667; | 210 v725 = v667; |
211 v723 = pPlayer->GetActualSkillLevel(v667) & 0x3F; | 211 v723 = pPlayer->GetActualSkillLevel(v667) & 0x3F; |
212 spell_level = v723; | 212 spell_level = v723; |
213 v11 = pPlayer->pActiveSkills[LODWORD(v725)]; | 213 v11 = pPlayer->pActiveSkills[v725]; |
214 } | 214 } |
215 | 215 |
216 skill_level = SkillToMastery(v11); | 216 skill_level = SkillToMastery(v11); |
217 | 217 |
218 if (pCastSpell->forced_spell_skill_level) | 218 if (pCastSpell->forced_spell_skill_level) |
219 uRequiredMana = 0; | 219 uRequiredMana = 0; |
220 else | 220 else |
221 uRequiredMana = pSpellDatas[pCastSpell->uSpellID].mana_per_skill[skill_level - 1]; | 221 uRequiredMana = pSpellDatas[pCastSpell->uSpellID - 1].mana_per_skill[skill_level - 1]; |
222 sRecoveryTime = pSpellDatas[pCastSpell->uSpellID].recovery_per_skill[skill_level - 1]; | 222 sRecoveryTime = pSpellDatas[pCastSpell->uSpellID - 1].recovery_per_skill[skill_level - 1]; |
223 | 223 |
224 if (LODWORD(v725) == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 || | 224 if (v725 == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 || |
225 LODWORD(v725) == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0) | 225 v725 == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0) |
226 uRequiredMana = 0; | 226 uRequiredMana = 0; |
227 | 227 |
228 if (pCastSpell->uSpellID < SPELL_BOW_ARROW && pPlayer->sMana < uRequiredMana) | 228 if (pCastSpell->uSpellID < SPELL_BOW_ARROW && pPlayer->sMana < uRequiredMana) |
229 { | 229 { |
230 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2); // "Not enough spell points" | 230 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2); // "Not enough spell points" |
1604 break; | 1604 break; |
1605 } | 1605 } |
1606 else if ( skill_level == 3 || skill_level == 4)//мастер и гранд | 1606 else if ( skill_level == 3 || skill_level == 4)//мастер и гранд |
1607 { | 1607 { |
1608 v258 = 0; | 1608 v258 = 0; |
1609 v725 = 0.0; | 1609 v725 = 0; |
1610 int _v733; | 1610 int _v733; |
1611 if ( pItemsTable->pSpecialEnchantments_count > 0 ) | 1611 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
1612 { | 1612 { |
1613 v730 = (int)&v679; | 1613 v730 = (int)&v679; |
1614 for ( _v733 = 0; _v733 < pItemsTable->pSpecialEnchantments_count; ++_v733 ) | 1614 for ( _v733 = 0; _v733 < pItemsTable->pSpecialEnchantments_count; ++_v733 ) |
1615 { | 1615 { |
1616 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement); | 1616 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement); |
1617 if ( !v259 || v259 == 1 ) | 1617 if ( !v259 || v259 == 1 ) |
1618 { | 1618 { |
1619 v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[v245->GetItemEquipType() + 4] + v258 * 28); | 1619 v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[v245->GetItemEquipType() + 4] + v258 * 28); |
1620 LODWORD(v725) += v260; | 1620 v725 += v260; |
1621 if ( v260 ) | 1621 if ( v260 ) |
1622 { | 1622 { |
1623 v261 = v730; | 1623 v261 = v730; |
1624 v730 += 4; | 1624 v730 += 4; |
1625 *(int *)v261 = _v733; | 1625 *(int *)v261 = _v733; |
1626 } | 1626 } |
1627 } | 1627 } |
1628 ++v258; | 1628 ++v258; |
1629 } | 1629 } |
1630 } | 1630 } |
1631 v262 = rand() % SLODWORD(v725); | 1631 v262 = rand() % v725; |
1632 v263 = v679; | 1632 v263 = v679; |
1633 v245->uSpecEnchantmentType = v679[0]; | 1633 v245->uSpecEnchantmentType = v679[0]; |
1634 v264 = pItemsTable->pSpecialEnchantments[*v263].to_item_apply[v245->GetItemEquipType() + 4]; | 1634 v264 = pItemsTable->pSpecialEnchantments[*v263].to_item_apply[v245->GetItemEquipType() + 4]; |
1635 v265 = v262 + 1; | 1635 v265 = v262 + 1; |
1636 if ( v264 < v265 ) | 1636 if ( v264 < v265 ) |
1645 if ( v264 >= v265 ) | 1645 if ( v264 >= v265 ) |
1646 break; | 1646 break; |
1647 } | 1647 } |
1648 } | 1648 } |
1649 v278 = 0; | 1649 v278 = 0; |
1650 v725 = 0.0; | 1650 v725 = 0; |
1651 if ( pItemsTable->pSpecialEnchantments_count > 0 ) | 1651 if ( pItemsTable->pSpecialEnchantments_count > 0 ) |
1652 { | 1652 { |
1653 int *_v730 = v679; | 1653 int *_v730 = v679; |
1654 for ( _v733 = 0; _v733 < pItemsTable->pSpecialEnchantments_count; ++_v733 ) | 1654 for ( _v733 = 0; _v733 < pItemsTable->pSpecialEnchantments_count; ++_v733 ) |
1655 { | 1655 { |