comparison Player.cpp @ 488:a3939d5067c4

Spells
author Nomad
date Wed, 27 Feb 2013 22:15:30 +0200
parents 7887a9cf9e7b
children 59649750a054
comparison
equal deleted inserted replaced
486:7887a9cf9e7b 488:a3939d5067c4
187 187
188 188
189 //----- (00427730) -------------------------------------------------------- 189 //----- (00427730) --------------------------------------------------------
190 bool Player::CanCastSpell(unsigned int uRequiredMana) 190 bool Player::CanCastSpell(unsigned int uRequiredMana)
191 { 191 {
192 int v2; // eax@1 192 if (sMana >= uRequiredMana)
193 bool result; // eax@2 193 {
194 194 sMana -= uRequiredMana;
195 v2 = this->sMana; 195 return true;
196 if ( v2 >= (signed int)uRequiredMana ) 196 }
197 { 197
198 this->sMana = v2 - uRequiredMana; 198 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
199 result = 1; 199 return false;
200 }
201 else
202 {
203 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
204 result = 0;
205 }
206 return result;
207 } 200 }
208 201
209 202
210 //----- (004BE2DD) -------------------------------------------------------- 203 //----- (004BE2DD) --------------------------------------------------------
211 void Player::_4BE2DD(unsigned int a2, int a3, int _2devent_idx) 204 void Player::_4BE2DD(unsigned int a2, int a3, int _2devent_idx)
4148 v8 = (int)&v4->pInventoryItems[v4->pEquipment.uMainHand-1]; 4141 v8 = (int)&v4->pInventoryItems[v4->pEquipment.uMainHand-1];
4149 v46 = v8; 4142 v46 = v8;
4150 v9 = *(int *)v8; 4143 v9 = *(int *)v8;
4151 v3 = (char *)&pItemsTable->pItems[v9].pIconName; 4144 v3 = (char *)&pItemsTable->pItems[v9].pIconName;
4152 if ( v3[28] == 12 ) 4145 if ( v3[28] == 12 )
4153 v10 = *(&pSpellDatas[0].field_A + 10 * *((int *)&pSpellDatas[66].field_8 + v9)); 4146 v10 = *(&pSpellDatas[0].uExpertLevelRecovery + 10 * *((int *)&pSpellDatas[66].uNormalLevelRecovery + v9));
4154 else 4147 else
4155 v10 = (unsigned __int16)word_4EDED8[(unsigned __int8)v3[29]]; 4148 v10 = (unsigned __int16)word_4EDED8[(unsigned __int8)v3[29]];
4156 v47 = v10; 4149 v47 = v10;
4157 } 4150 }
4158 if ( HasItemEquipped((ITEM_EQUIP_TYPE)0) ) 4151 if ( HasItemEquipped((ITEM_EQUIP_TYPE)0) )