Changeset 257 for trunk/src/game/SpellEffects.cpp
- Timestamp:
- 11/19/08 13:51:33 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/SpellEffects.cpp
r246 r257 1172 1172 m_caster->CastSpell(m_caster, 45009, true); 1173 1173 return; 1174 } 1174 } 1175 1175 case 45030: // Impale Emissary 1176 1176 { … … 1275 1275 //Polymorph Cast Visual Rank 1 1276 1276 const uint32 spell_list[6] = {32813, 32816, 32817, 32818, 32819, 32820}; 1277 unitTarget->CastSpell( unitTarget, spell_list[urand(0, 5)], true); 1277 unitTarget->CastSpell( unitTarget, spell_list[urand(0, 5)], true); 1278 1278 } 1279 1279 return; … … 2251 2251 m_caster->ModifyPower(POWER_MANA,gain); 2252 2252 //send log 2253 m_caster->SendEnergizeSpellLog(m_caster, m_spellInfo->Id,gain,POWER_MANA ,false);2253 m_caster->SendEnergizeSpellLog(m_caster, m_spellInfo->Id,gain,POWER_MANA); 2254 2254 } 2255 2255 } … … 2267 2267 /*do not uncomment . 2268 2268 if(bg->GetTypeID()==BATTLEGROUND_WS) 2269 bg->EventPlayerClickedOnFlag((Player*)m_caster, this->gameObjTarget);2269 bg->EventPlayerClickedOnFlag((Player*)m_caster, gameObjTarget); 2270 2270 sLog.outDebug("Send Event Horde Flag Picked Up"); 2271 2271 break; … … 2280 2280 /*do not uncomment ... (it will cause crash, because of null targetobject!) anyway this is a bad way to call that event, because it would cause recursion 2281 2281 if(bg->GetTypeID()==BATTLEGROUND_WS) 2282 bg->EventPlayerClickedOnFlag((Player*)m_caster, this->gameObjTarget);2282 bg->EventPlayerClickedOnFlag((Player*)m_caster, gameObjTarget); 2283 2283 sLog.outDebug("Send Event Alliance Flag Picked Up"); 2284 2284 break; … … 2291 2291 case 23385: // Alliance Flag Returns 2292 2292 if(bg->GetTypeID()==BATTLEGROUND_WS) 2293 bg->EventPlayerClickedOnFlag((Player*)m_caster, this->gameObjTarget);2293 bg->EventPlayerClickedOnFlag((Player*)m_caster, gameObjTarget); 2294 2294 sLog.outDebug("Alliance Flag Returned"); 2295 2295 break; 2296 2296 case 23386: // Horde Flag Returns 2297 2297 if(bg->GetTypeID()==BATTLEGROUND_WS) 2298 bg->EventPlayerClickedOnFlag((Player*)m_caster, this->gameObjTarget);2298 bg->EventPlayerClickedOnFlag((Player*)m_caster, gameObjTarget); 2299 2299 sLog.outDebug("Horde Flag Returned"); 2300 2300 break;*/ … … 2302 2302 /* 2303 2303 if(bg->GetTypeID()==BATTLEGROUND_EY) 2304 bg->EventPlayerClickedOnFlag((Player*)m_caster, this->gameObjTarget);2304 bg->EventPlayerClickedOnFlag((Player*)m_caster, gameObjTarget); 2305 2305 */ 2306 2306 break; … … 2681 2681 2682 2682 // Some level depends spells 2683 int multiplier 2683 int multiplier = 0; 2684 2684 int level_diff = 0; 2685 2685 switch (m_spellInfo->Id) … … 2688 2688 case 9512: 2689 2689 level_diff = m_caster->getLevel() - 40; 2690 multiplier 2690 multiplier = 2; 2691 2691 break; 2692 2692 // Blood Fury 2693 2693 case 24571: 2694 2694 level_diff = m_caster->getLevel() - 60; 2695 multiplier 2695 multiplier = 10; 2696 2696 break; 2697 2697 // Burst of Energy 2698 2698 case 24532: 2699 2699 level_diff = m_caster->getLevel() - 60; 2700 multiplier 2700 multiplier = 4; 2701 2701 break; 2702 2702 default: … … 3760 3760 ((Player*)unitTarget)->TeleportTo(mapid, fx, fy, fz, -m_caster->GetOrientation(), TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0)); 3761 3761 else 3762 MapManager::Instance().GetMap(mapid, m_caster)->CreatureRelocation((Creature*)m_caster, fx, fy, fz, -m_caster->GetOrientation());3762 m_caster->GetMap()->CreatureRelocation((Creature*)m_caster, fx, fy, fz, -m_caster->GetOrientation()); 3763 3763 } 3764 3764 … … 3781 3781 return; 3782 3782 3783 sLog.outDebug("SpellEffect::AddHonor called for spell_id %u , that rewards %d honor points to player: %u", m_spellInfo->Id, this->damage, ((Player*)unitTarget)->GetGUIDLow());3783 sLog.outDebug("SpellEffect::AddHonor called for spell_id %u , that rewards %d honor points to player: %u", m_spellInfo->Id, damage, ((Player*)unitTarget)->GetGUIDLow()); 3784 3784 3785 3785 // TODO: find formula for honor reward based on player's level! … … 3787 3787 // now fixed only for level 70 players: 3788 3788 if (((Player*)unitTarget)->getLevel() == 70) 3789 ((Player*)unitTarget)->RewardHonor(NULL, 1, this->damage);3789 ((Player*)unitTarget)->RewardHonor(NULL, 1, damage); 3790 3790 } 3791 3791 … … 4002 4002 4003 4003 // add to world 4004 MapManager::Instance().GetMap(pet->GetMapId(), pet)->Add((Creature*)pet);4004 pet->GetMap()->Add((Creature*)pet); 4005 4005 4006 4006 // visual effect for levelup … … 4032 4032 return; 4033 4033 4034 MapManager::Instance().GetMap(OldSummon->GetMapId(), OldSummon)->Remove((Creature*)OldSummon,false);4034 OldSummon->GetMap()->Remove((Creature*)OldSummon,false); 4035 4035 OldSummon->SetMapId(m_caster->GetMapId()); 4036 4036 … … 4039 4039 4040 4040 OldSummon->Relocate(px, py, pz, OldSummon->GetOrientation()); 4041 MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster)->Add((Creature*)OldSummon);4041 m_caster->GetMap()->Add((Creature*)OldSummon); 4042 4042 4043 4043 if(m_caster->GetTypeId() == TYPEID_PLAYER && OldSummon->isControlled() ) … … 4122 4122 if(m_caster->GetTypeId() == TYPEID_UNIT) 4123 4123 { 4124 4125 4126 4127 4124 if ( ((Creature*)m_caster)->isTotem() ) 4125 NewSummon->GetCharmInfo()->SetReactState(REACT_AGGRESSIVE); 4126 else 4127 NewSummon->GetCharmInfo()->SetReactState(REACT_DEFENSIVE); 4128 4128 } 4129 4129 … … 4447 4447 ((Player*)m_caster)->AddComboPoints(unitTarget, 1); 4448 4448 } 4449 4449 4450 // Mangle (Cat): CP 4450 4451 if(m_spellInfo->SpellFamilyName==SPELLFAMILY_DRUID && (m_spellInfo->SpellFamilyFlags==0x0000040000000000LL)) … … 4453 4454 ((Player*)m_caster)->AddComboPoints(unitTarget,1); 4454 4455 } 4455 4456 4456 4457 4457 // take ammo … … 5449 5449 } 5450 5450 5451 void Spell::EffectResurrect(uint32 i)5451 void Spell::EffectResurrect(uint32 /*effIndex*/) 5452 5452 { 5453 5453 if(!unitTarget) … … 5670 5670 int32 targetLevel = creature->getLevel(); 5671 5671 5672 uint32 skill = creature->GetCreatureInfo()->GetRequiredLootSkill(); 5672 uint32 skill = creature->GetCreatureInfo()->GetRequiredLootSkill(); 5673 5673 5674 5674 ((Player*)m_caster)->SendLoot(creature->GetGUID(),LOOT_SKINNING); … … 5697 5697 5698 5698 if(m_caster->GetTypeId() != TYPEID_PLAYER) 5699 MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster)->CreatureRelocation((Creature*)m_caster,x,y,z,m_caster->GetOrientation());5699 m_caster->GetMap()->CreatureRelocation((Creature*)m_caster,x,y,z,m_caster->GetOrientation()); 5700 5700 5701 5701 // not all charge effects used in negative spells … … 6133 6133 linkedGO->SetOwnerGUID(m_caster->GetGUID() ); 6134 6134 6135 MapManager::Instance().GetMap(linkedGO->GetMapId(), linkedGO)->Add(linkedGO);6135 linkedGO->GetMap()->Add(linkedGO); 6136 6136 } 6137 6137 else