*Fix the bug that many talents lose one point.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-12-24 10:57:04 -06:00
parent c81299e653
commit 253f4bf374
5 changed files with 28 additions and 12 deletions
+1 -2
View File
@@ -868,8 +868,7 @@ enum Targets
TARGET_DEST_TARGET_ENEMY = 53, TARGET_DEST_TARGET_ENEMY = 53,
TARGET_UNIT_CONE_ENEMY_UNKNOWN = 54, TARGET_UNIT_CONE_ENEMY_UNKNOWN = 54,
TARGET_DEST_CASTER_FRONT_LEAP = 55, // for a leap spell TARGET_DEST_CASTER_FRONT_LEAP = 55, // for a leap spell
TARGET_RANDOM_RAID_MEMBER = 56, TARGET_UNIT_RAID = 56,
//TARGET_UNIT_AREA_RAID
TARGET_SINGLE_FRIEND_2 = 57, TARGET_SINGLE_FRIEND_2 = 57,
TARGET_UNIT_TARGET_RAID = 57, TARGET_UNIT_TARGET_RAID = 57,
TARGET_UNIT_CONE_ALLY = 59, TARGET_UNIT_CONE_ALLY = 59,
+7 -8
View File
@@ -1473,6 +1473,12 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
case TARGET_UNIT_PARTY_CASTER: case TARGET_UNIT_PARTY_CASTER:
m_caster->GetPartyMember(TagUnitMap, radius); m_caster->GetPartyMember(TagUnitMap, radius);
break; break;
case TARGET_UNIT_RAID:
if(Unit *target = m_targets.getUnitTarget())
TagUnitMap.push_back(target);
else
m_caster->GetRaidMember(TagUnitMap, radius);
break;
} }
}break; }break;
@@ -1759,13 +1765,6 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
TagUnitMap.push_back(m_caster); TagUnitMap.push_back(m_caster);
break; break;
} }
case TARGET_RANDOM_RAID_MEMBER:
{
if (m_caster->GetTypeId() == TYPEID_PLAYER)
if(Player* target = ((Player*)m_caster)->GetNextRandomRaidMember(radius))
TagUnitMap.push_back(target);
}break;
case TARGET_CHAIN_HEAL: case TARGET_CHAIN_HEAL:
{ {
Unit* pUnitTarget = m_targets.getUnitTarget(); Unit* pUnitTarget = m_targets.getUnitTarget();
@@ -3914,7 +3913,7 @@ uint8 Spell::CanCast(bool strict)
SkillValue = 0; SkillValue = 0;
// add the damage modifier from the spell casted (cheat lock / skeleton key etc.) (use m_currentBasePoints, CalculateDamage returns wrong value) // add the damage modifier from the spell casted (cheat lock / skeleton key etc.) (use m_currentBasePoints, CalculateDamage returns wrong value)
SkillValue += m_currentBasePoints[i]+1; SkillValue += m_currentBasePoints[i]/*+1*/;
// get the required lock value // get the required lock value
int32 ReqValue=0; int32 ReqValue=0;
+1 -1
View File
@@ -342,7 +342,7 @@ m_periodicTimer(0), m_PeriodicEventId(0), m_AuraDRGroup(DIMINISHING_NONE)
if(!caster) if(!caster)
{ {
m_caster_guid = target->GetGUID(); m_caster_guid = target->GetGUID();
damage = m_currentBasePoints+1; // stored value-1 //damage = m_currentBasePoints+1; // stored value-1
m_maxduration = target->CalculateSpellDuration(m_spellProto, m_effIndex, target); m_maxduration = target->CalculateSpellDuration(m_spellProto, m_effIndex, target);
} }
else else
+1
View File
@@ -81,6 +81,7 @@ SpellMgr::SpellMgr()
case TARGET_UNIT_MASTER: case TARGET_UNIT_MASTER:
case TARGET_UNIT_PET: case TARGET_UNIT_PET:
case TARGET_UNIT_PARTY_CASTER: case TARGET_UNIT_PARTY_CASTER:
case TARGET_UNIT_RAID:
SpellTargetType[i] = TARGET_TYPE_UNIT_CASTER; SpellTargetType[i] = TARGET_TYPE_UNIT_CASTER;
break; break;
case TARGET_UNIT_MINIPET: case TARGET_UNIT_MINIPET:
+18 -1
View File
@@ -12943,8 +12943,25 @@ bool Unit::IsInRaidWith(Unit const *unit) const
return false; return false;
} }
void Unit::GetRaidMember(std::list<Unit*> &TagUnitMap, float radius) void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius)
{ {
Player *owner = GetCharmerOrOwnerPlayerOrPlayerItself();
if(!owner)
return;
Group *pGroup = owner->GetGroup();
if(!pGroup)
return;
for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* Target = itr->getSource();
// IsHostileTo check duel and controlled by enemy
if( Target && Target != this && Target->isAlive()
&& IsWithinDistInMap(Target, radius) && !IsHostileTo(Target) )
nearMembers.push_back(Target);
}
} }
void Unit::GetPartyMember(std::list<Unit*> &TagUnitMap, float radius) void Unit::GetPartyMember(std::list<Unit*> &TagUnitMap, float radius)