Closed CLAXES closed 9 months ago
Add what to where?
I see
Like this one here
protected override bool IsMonsterAlly(BaseMonsterCharacterEntity monsterCharacter, EntityInfo targetEntity)
{
if (string.IsNullOrEmpty(targetEntity.Id))
return false;
// Attack only player by default
if (targetEntity.Type == EntityTypes.Player)
{
// If it has faction set, then check the faction between two characters
if (targetEntity.FactionId != 0 && monsterCharacter.FactionId == targetEntity.FactionId)
return true;
// Player always be monster's enemy
return false;
}
if (monsterCharacter.IsSummonedAndSummonerExisted)
{
// If summoned by someone, will have same allies with summoner
return targetEntity.Id.Equals(monsterCharacter.Summoner.Id) || monsterCharacter.Summoner.IsAlly(targetEntity);
}
if (targetEntity.Type == EntityTypes.Monster)
{
if (targetEntity.HasSummoner)
{
return monsterCharacter.IsAlly(targetEntity.Summoner);
}
else
{
if (targetEntity.FactionId != 0 && monsterCharacter.FactionId == targetEntity.FactionId)
return true;
}
// If another monster has same allyId so it is ally
return GameInstance.MonsterCharacters[targetEntity.DataId].AllyId == monsterCharacter.CharacterDatabase.AllyId;
}
return false;
}
Too slow :P
Hello, arrows hit and damage the monster in the same faction
when I add this code into it, the problem disappears