monsters will always attack creatura mobs, anything else will defend it's owner if attacked.

This commit is contained in:
tenplus1 2023-05-26 16:17:58 +01:00
parent 194c9f7847
commit 05f0550876
1 changed files with 12 additions and 8 deletions

20
api.lua
View File

@ -1958,15 +1958,19 @@ function mob_class:general_attack()
elseif creatura and ent and ent._cmi_is_mob ~= true elseif creatura and ent and ent._cmi_is_mob ~= true
and ent.hitbox and ent.stand_node then and ent.hitbox and ent.stand_node then
if self.name == ent.name -- monsters attack all creatura mobs, npc and animals will only attack
or self.type ~= "monster" -- if the animal owner is currently being attacked by creatura mob
or (self.specific_attack if self.name == ent.name
and not check_for(ent.name, self.specific_attack)) then or (self.type ~= "monster"
objs[n] = nil and self.owner ~= (ent._target and ent._target:get_player_name() or "."))
-- print("- creatura", n, self.name, ent.name) or (self.specific_attack
end and not check_for(ent.name, self.specific_attack)) then
-- or are we a mob? -- ent.hitbox is a creatura mob identifier objs[n] = nil
--print("-- creatura", ent.name)
end
-- or are we a mob?
elseif ent and ent._cmi_is_mob then elseif ent and ent._cmi_is_mob then
-- remove mobs not to attack -- remove mobs not to attack