always_check_los TRUE
always_check_pet_los TRUE
check_los_during_cast True
losmgr_cleanup_entries 1000
losmgr_cleanup_frequency 120000
losmgr_contamination_zfactor 0.5
losmgr_debug_level 0
losmgr_enable True
losmgr_environment_vs_environment_cache_timeout 5000
losmgr_environment__vs_environment_range_threshold 350
losmgr_guard_contamination_radius 200
losmgr_max_contamination_radius 350
losmgr_npc_contamination_radius 250
losmgr_pet_contamination_radius 50
losmgr_players_contamination_radius 0
losmgr_player_check_frequency 100
losmgr_player_vs_environment_cache_timeout 1500
losmgr_player_vs_environment_range_threshold 125
losmgr_player_vs_player_cache_timeout 200
losmgr_player_vs_player_range_threshold 32
losmgr_query_timeout 300
los_player_check_frequency 5
public virtual void AddToAggroList(GameLiving living, int aggroamount, bool NaturalAggro)
{
if (m_body.IsConfused) return;
// tolakram - duration spell effects will attempt to add to aggro after npc is dead
if (!m_body.IsAlive) return;
if (living == null) return;
if (aggroamount > 0 && NaturalAggro)
{
LastNaturalAggro = Body.CurrentRegion.Time;
}
//Handle trigger to say sentance on first aggro.
if (m_aggroTable.Count < 1)
Body.FireAmbientSentence(GameNPC.eAmbientTrigger.aggroing, living);
// Check LOS (walls, pits, etc...) before attacking, player + pet
// Be sure the aggrocheck is triggered by the brain on Think() method
if (DOL.GS.ServerProperties.Properties.ALWAYS_CHECK_LOS && NaturalAggro)
{
GamePlayer thisLiving = null;
if (living is GamePlayer)
thisLiving = (GamePlayer)living;
if (living is GamePet)
{
IControlledBrain brain = ((GamePet)living).Brain as IControlledBrain;
thisLiving = brain.GetPlayerOwner();
}
if (thisLiving != null)
{
thisLiving.Out.SendCheckLOS (Body, living, new CheckLOSResponse(CheckAggroLOS));
if (!AggroLOS) return;
}
}
thisLiving.Out.SendCheckLOS (Body, living, new CheckLOSResponse(CheckAggroLOS));
if (!AggroLOS) return;
/// <summary>
/// Check for aggro against close NPCs
/// </summary>
protected virtual void CheckNPCAggro()
{
if (Body.AttackState)
return;
foreach (GameNPC npc in Body.GetNPCsInRadius((ushort)AggroRange, Body.CurrentRegion.IsDungeon ? false : true))
{
if (!GameServer.ServerRules.IsAllowedToAttack(Body, npc, true)) continue;
if (m_aggroTable.ContainsKey(npc))
continue; // add only new NPCs
if (!npc.IsAlive || npc.ObjectState != GameObject.eObjectState.Active)
continue;
if (npc is GameTaxi)
continue; //do not attack horses
if (CalculateAggroLevelToTarget(npc) > 0)
{
AddToAggroList(npc, (npc.Level + 1) << 1);
}
}
}
Return to “%s” DOL Development Discussion
Users browsing this forum: No registered users and 1 guest