[svn] Improve TargetedMovement (TODO: let mob find "near angle" rather than "random angle").
Delete a repeated check in instance canenter(). Fix some spell targets. Add some sunwell spell sql. Fix Magtheridons earthquake. (TODO: need to find out why soul transfer has no effect when casted by mobs) Let Brutallus dual wield. Enable burn (still no script effect). Quick fix for shadowmoon valley illidan quest crash (wait for author's fix). --HG-- branch : trunk
This commit is contained in:
1 parent
1c3d4c40c3
commit
e2eb694c57
14 files changed
+313
-303
No files matched your search
+9
-1
@@ -420,12 +420,20 @@ bool Unit::IsWithinCombatDist(Unit *obj, float dist2compare) const
|
||||
float dz = GetPositionZ() - obj->GetPositionZ();
|
||||
float distsq = dx*dx + dy*dy + dz*dz;
|
||||
//not sure here, or combatreach + combatreach?
|
||||
float sizefactor = GetObjectSize() + obj->GetFloatValue(UNIT_FIELD_COMBATREACH);
|
||||
float sizefactor = GetFloatValue(UNIT_FIELD_COMBATREACH) + obj->GetFloatValue(UNIT_FIELD_COMBATREACH);
|
||||
float maxdist = dist2compare + sizefactor;
|
||||
|
||||
return distsq < maxdist * maxdist;
|
||||
}
|
||||
|
||||
void Unit::GetRandomContactPoint( const Unit* obj, float &x, float &y, float &z, float distance2dMin, float distance2dMax ) const
|
||||
{
|
||||
uint32 attacker_number = getAttackers().size();
|
||||
if(attacker_number > 0) --attacker_number;
|
||||
GetNearPoint(obj,x,y,z,obj->GetFloatValue(UNIT_FIELD_COMBATREACH),distance2dMin+(distance2dMax-distance2dMin)*rand_norm()
|
||||
, GetAngle(obj) + (attacker_number ? (M_PI/2 - M_PI * rand_norm()) * (float)attacker_number / GetFloatValue(UNIT_FIELD_COMBATREACH) / 3 : 0));
|
||||
}
|
||||
|
||||
void Unit::RemoveSpellsCausingAura(AuraType auraType)
|
||||
{
|
||||
if (auraType >= TOTAL_AURAS) return;
|
||||
|
||||
Reference in new issue
Block a user