mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-16 01:01:30 +00:00
[BugFix] Charm Targeting and other issues. (#1655)
* fix for target change bug on client * Update spell_effects.cpp
This commit is contained in:
parent
4389f84ea5
commit
df3161455a
@ -1514,7 +1514,9 @@ void EntityList::RemoveFromTargets(Mob *mob, bool RemoveFromXTargets)
|
||||
mob->CastToClient()->RemoveXTarget(m, false);
|
||||
}
|
||||
|
||||
m->RemoveFromHateList(mob);
|
||||
if (m->IsAIControlled()) {
|
||||
m->RemoveFromHateList(mob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2875,7 +2875,7 @@ bool Mob::RemoveFromHateList(Mob* mob)
|
||||
ResetAssistCap();
|
||||
}
|
||||
}
|
||||
if(GetTarget() == mob)
|
||||
if(IsAIControlled() && GetTarget() == mob)
|
||||
{
|
||||
SetTarget(hate_list.GetEntWithMostHateOnList(this));
|
||||
}
|
||||
|
||||
@ -731,6 +731,27 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
if (!caster) // can't be someone's pet unless we know who that someone is
|
||||
break;
|
||||
|
||||
if (IsClient() && caster->IsClient()) {
|
||||
caster->Message(Chat::White, "Unable to cast charm on a fellow player.");
|
||||
BuffFadeByEffect(SE_Charm);
|
||||
break;
|
||||
}
|
||||
else if (IsCorpse()) {
|
||||
caster->Message(Chat::White, "Unable to cast charm on a corpse.");
|
||||
BuffFadeByEffect(SE_Charm);
|
||||
break;
|
||||
}
|
||||
else if (caster->GetPet() != nullptr && caster->IsClient()) {
|
||||
caster->Message(Chat::White, "You cannot charm something when you already have a pet.");
|
||||
BuffFadeByEffect(SE_Charm);
|
||||
break;
|
||||
}
|
||||
else if (GetOwner()) {
|
||||
caster->Message(Chat::White, "You cannot charm someone else's pet!");
|
||||
BuffFadeByEffect(SE_Charm);
|
||||
break;
|
||||
}
|
||||
|
||||
if(IsNPC())
|
||||
{
|
||||
CastToNPC()->SaveGuardSpotCharm();
|
||||
@ -739,25 +760,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
entity_list.RemoveDebuffs(this);
|
||||
entity_list.RemoveFromTargets(this);
|
||||
WipeHateList();
|
||||
|
||||
if (IsClient() && caster->IsClient()) {
|
||||
caster->Message(Chat::White, "Unable to cast charm on a fellow player.");
|
||||
BuffFadeByEffect(SE_Charm);
|
||||
break;
|
||||
} else if(IsCorpse()) {
|
||||
caster->Message(Chat::White, "Unable to cast charm on a corpse.");
|
||||
BuffFadeByEffect(SE_Charm);
|
||||
break;
|
||||
} else if(caster->GetPet() != nullptr && caster->IsClient()) {
|
||||
caster->Message(Chat::White, "You cannot charm something when you already have a pet.");
|
||||
BuffFadeByEffect(SE_Charm);
|
||||
break;
|
||||
} else if(GetOwner()) {
|
||||
caster->Message(Chat::White, "You cannot charm someone else's pet!");
|
||||
BuffFadeByEffect(SE_Charm);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Mob *my_pet = GetPet();
|
||||
if(my_pet)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user