fix: Fixes disarm, strangle, curse, summons, looting rights, creatures attacking, and items going to the floor (#1174)

* Fixes disarm
* Fixes strangle not refreshing
* Fixes curse not refreshing
* Fixes 125% bonus to looting rights
* Fixes mobs attacking each other, or not attacking each other
* Fixes items dropping to the floor
* Fixes protection spell
* Fixes cure sending wrong message
This commit is contained in:
mark1145 2022-09-28 15:19:15 +10:00 • committed by GitHub
parent 906ec095b9
commit 060edaa76a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 127 additions and 112 deletions

View file

@ -176,11 +176,12 @@ namespace Server.Misc
return true;
}
var bcFrom = from as BaseCreature;
var pmFrom = from as PlayerMobile;
var pmTarg = target as PlayerMobile;
var bcTarg = target as BaseCreature;
if (pmFrom == null && from is BaseCreature bcFrom && bcFrom.Summoned)
if (pmFrom == null && bcFrom?.Summoned == true)
{
pmFrom = bcFrom.SummonMaster as PlayerMobile;
}
@ -257,9 +258,15 @@ namespace Server.Misc
return true; // Guild allies or enemies can be harmful
}
if (bcTarg?.Controlled == true || bcTarg?.Summoned == true && bcTarg.SummonMaster != from)
if (bcTarg?.Controlled == true
|| (bcTarg?.Summoned == true && bcTarg.SummonMaster != from && bcTarg.SummonMaster.Player))
{
return false; // Cannot harm other controlled mobiles
return false; // Cannot harm other controlled mobiles from players
}
if (pmFrom == null && bcFrom != null && bcFrom.Summoned && target.Player)
{
return true; // Summons from monsters can attack players
}
if (target.Player)