mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
Fix (Core\DB) Hostil to Hostile spelling fix (#11399)
* Fix (Core) Hostil to Hostile spelling fix * sql cmd adjustment as well * AliGnZ * Further Hostil to Hostile Correction Per @Si1ker Research via https://github.com/azerothcore/azerothcore-wotlk/pull/11399#issuecomment-1099506373
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1649944595674185734');
|
||||||
|
|
||||||
|
-- corrects hostil to hostile
|
||||||
|
UPDATE `command` SET `name`='debug hostile' WHERE `name`='debug hostil';
|
||||||
@@ -3561,48 +3561,48 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
|||||||
case SMART_TARGET_HOSTILE_SECOND_AGGRO:
|
case SMART_TARGET_HOSTILE_SECOND_AGGRO:
|
||||||
if (me)
|
if (me)
|
||||||
{
|
{
|
||||||
if (e.target.hostilRandom.powerType)
|
if (e.target.hostileRandom.powerType)
|
||||||
{
|
{
|
||||||
if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::MaxThreat, 1, PowerUsersSelector(me, Powers(e.target.hostilRandom.powerType - 1), (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly)))
|
if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::MaxThreat, 1, PowerUsersSelector(me, Powers(e.target.hostileRandom.powerType - 1), (float)e.target.hostileRandom.maxDist, e.target.hostileRandom.playerOnly)))
|
||||||
l->push_back(u);
|
l->push_back(u);
|
||||||
}
|
}
|
||||||
else if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::MaxThreat, 1, (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly))
|
else if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::MaxThreat, 1, (float)e.target.hostileRandom.maxDist, e.target.hostileRandom.playerOnly))
|
||||||
l->push_back(u);
|
l->push_back(u);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SMART_TARGET_HOSTILE_LAST_AGGRO:
|
case SMART_TARGET_HOSTILE_LAST_AGGRO:
|
||||||
if (me)
|
if (me)
|
||||||
{
|
{
|
||||||
if (e.target.hostilRandom.powerType)
|
if (e.target.hostileRandom.powerType)
|
||||||
{
|
{
|
||||||
if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::MinThreat, 0, PowerUsersSelector(me, Powers(e.target.hostilRandom.powerType - 1), (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly)))
|
if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::MinThreat, 0, PowerUsersSelector(me, Powers(e.target.hostileRandom.powerType - 1), (float)e.target.hostileRandom.maxDist, e.target.hostileRandom.playerOnly)))
|
||||||
l->push_back(u);
|
l->push_back(u);
|
||||||
}
|
}
|
||||||
else if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::MinThreat, 0, (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly))
|
else if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::MinThreat, 0, (float)e.target.hostileRandom.maxDist, e.target.hostileRandom.playerOnly))
|
||||||
l->push_back(u);
|
l->push_back(u);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SMART_TARGET_HOSTILE_RANDOM:
|
case SMART_TARGET_HOSTILE_RANDOM:
|
||||||
if (me)
|
if (me)
|
||||||
{
|
{
|
||||||
if (e.target.hostilRandom.powerType)
|
if (e.target.hostileRandom.powerType)
|
||||||
{
|
{
|
||||||
if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::Random, 0, PowerUsersSelector(me, Powers(e.target.hostilRandom.powerType - 1), (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly)))
|
if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::Random, 0, PowerUsersSelector(me, Powers(e.target.hostileRandom.powerType - 1), (float)e.target.hostileRandom.maxDist, e.target.hostileRandom.playerOnly)))
|
||||||
l->push_back(u);
|
l->push_back(u);
|
||||||
}
|
}
|
||||||
else if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::Random, 0, (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly))
|
else if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::Random, 0, (float)e.target.hostileRandom.maxDist, e.target.hostileRandom.playerOnly))
|
||||||
l->push_back(u);
|
l->push_back(u);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SMART_TARGET_HOSTILE_RANDOM_NOT_TOP:
|
case SMART_TARGET_HOSTILE_RANDOM_NOT_TOP:
|
||||||
if (me)
|
if (me)
|
||||||
{
|
{
|
||||||
if (e.target.hostilRandom.powerType)
|
if (e.target.hostileRandom.powerType)
|
||||||
{
|
{
|
||||||
if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::Random, 1, PowerUsersSelector(me, Powers(e.target.hostilRandom.powerType - 1), (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly)))
|
if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::Random, 1, PowerUsersSelector(me, Powers(e.target.hostileRandom.powerType - 1), (float)e.target.hostileRandom.maxDist, e.target.hostileRandom.playerOnly)))
|
||||||
l->push_back(u);
|
l->push_back(u);
|
||||||
}
|
}
|
||||||
else if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::Random, 1, (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly))
|
else if (Unit* u = me->AI()->SelectTarget(SelectTargetMethod::Random, 1, (float)e.target.hostileRandom.maxDist, e.target.hostileRandom.playerOnly))
|
||||||
l->push_back(u);
|
l->push_back(u);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
|
|||||||
case SMART_TARGET_HOSTILE_LAST_AGGRO:
|
case SMART_TARGET_HOSTILE_LAST_AGGRO:
|
||||||
case SMART_TARGET_HOSTILE_RANDOM:
|
case SMART_TARGET_HOSTILE_RANDOM:
|
||||||
case SMART_TARGET_HOSTILE_RANDOM_NOT_TOP:
|
case SMART_TARGET_HOSTILE_RANDOM_NOT_TOP:
|
||||||
AC_SAI_IS_BOOLEAN_VALID(e, e.target.hostilRandom.playerOnly);
|
AC_SAI_IS_BOOLEAN_VALID(e, e.target.hostileRandom.playerOnly);
|
||||||
break;
|
break;
|
||||||
case SMART_TARGET_FARTHEST:
|
case SMART_TARGET_FARTHEST:
|
||||||
AC_SAI_IS_BOOLEAN_VALID(e, e.target.farthest.playerOnly);
|
AC_SAI_IS_BOOLEAN_VALID(e, e.target.farthest.playerOnly);
|
||||||
@@ -756,10 +756,10 @@ bool SmartAIMgr::CheckUnusedTargetParams(SmartScriptHolder const& e)
|
|||||||
case SMART_TARGET_NONE: return NO_PARAMS;
|
case SMART_TARGET_NONE: return NO_PARAMS;
|
||||||
case SMART_TARGET_SELF: return NO_PARAMS;
|
case SMART_TARGET_SELF: return NO_PARAMS;
|
||||||
case SMART_TARGET_VICTIM: return NO_PARAMS;
|
case SMART_TARGET_VICTIM: return NO_PARAMS;
|
||||||
case SMART_TARGET_HOSTILE_SECOND_AGGRO: return sizeof(SmartTarget::hostilRandom);
|
case SMART_TARGET_HOSTILE_SECOND_AGGRO: return sizeof(SmartTarget::hostileRandom);
|
||||||
case SMART_TARGET_HOSTILE_LAST_AGGRO: return sizeof(SmartTarget::hostilRandom);
|
case SMART_TARGET_HOSTILE_LAST_AGGRO: return sizeof(SmartTarget::hostileRandom);
|
||||||
case SMART_TARGET_HOSTILE_RANDOM: return sizeof(SmartTarget::hostilRandom);
|
case SMART_TARGET_HOSTILE_RANDOM: return sizeof(SmartTarget::hostileRandom);
|
||||||
case SMART_TARGET_HOSTILE_RANDOM_NOT_TOP: return sizeof(SmartTarget::hostilRandom);
|
case SMART_TARGET_HOSTILE_RANDOM_NOT_TOP: return sizeof(SmartTarget::hostileRandom);
|
||||||
case SMART_TARGET_ACTION_INVOKER: return NO_PARAMS;
|
case SMART_TARGET_ACTION_INVOKER: return NO_PARAMS;
|
||||||
case SMART_TARGET_POSITION: return NO_PARAMS; //uses x,y,z,o
|
case SMART_TARGET_POSITION: return NO_PARAMS; //uses x,y,z,o
|
||||||
case SMART_TARGET_CREATURE_RANGE: return sizeof(SmartTarget::unitRange);
|
case SMART_TARGET_CREATURE_RANGE: return sizeof(SmartTarget::unitRange);
|
||||||
|
|||||||
@@ -1410,7 +1410,7 @@ struct SmartTarget
|
|||||||
uint32 maxDist;
|
uint32 maxDist;
|
||||||
SAIBool playerOnly;
|
SAIBool playerOnly;
|
||||||
uint32 powerType;
|
uint32 powerType;
|
||||||
} hostilRandom;
|
} hostileRandom;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -472,7 +472,7 @@ void ThreatMgr::modifyThreatPercent(Unit* victim, int32 percent)
|
|||||||
|
|
||||||
//============================================================
|
//============================================================
|
||||||
|
|
||||||
Unit* ThreatMgr::getHostilTarget()
|
Unit* ThreatMgr::getHostileTarget()
|
||||||
{
|
{
|
||||||
iThreatContainer.update();
|
iThreatContainer.update();
|
||||||
HostileReference* nextVictim = iThreatContainer.selectNextVictim(GetOwner()->ToCreature(), getCurrentVictim());
|
HostileReference* nextVictim = iThreatContainer.selectNextVictim(GetOwner()->ToCreature(), getCurrentVictim());
|
||||||
@@ -546,49 +546,49 @@ void ThreatMgr::processThreatEvent(ThreatRefStatusChangeEvent* threatRefStatusCh
|
|||||||
{
|
{
|
||||||
threatRefStatusChangeEvent->setThreatMgr(this); // now we can set the threat manager
|
threatRefStatusChangeEvent->setThreatMgr(this); // now we can set the threat manager
|
||||||
|
|
||||||
HostileReference* hostilRef = threatRefStatusChangeEvent->getReference();
|
HostileReference* hostileRef = threatRefStatusChangeEvent->getReference();
|
||||||
|
|
||||||
switch (threatRefStatusChangeEvent->getType())
|
switch (threatRefStatusChangeEvent->getType())
|
||||||
{
|
{
|
||||||
case UEV_THREAT_REF_THREAT_CHANGE:
|
case UEV_THREAT_REF_THREAT_CHANGE:
|
||||||
if ((getCurrentVictim() == hostilRef && threatRefStatusChangeEvent->getFValue() < 0.0f) ||
|
if ((getCurrentVictim() == hostileRef && threatRefStatusChangeEvent->getFValue() < 0.0f) ||
|
||||||
(getCurrentVictim() != hostilRef && threatRefStatusChangeEvent->getFValue() > 0.0f))
|
(getCurrentVictim() != hostileRef && threatRefStatusChangeEvent->getFValue() > 0.0f))
|
||||||
setDirty(true); // the order in the threat list might have changed
|
setDirty(true); // the order in the threat list might have changed
|
||||||
break;
|
break;
|
||||||
case UEV_THREAT_REF_ONLINE_STATUS:
|
case UEV_THREAT_REF_ONLINE_STATUS:
|
||||||
if (!hostilRef->isOnline())
|
if (!hostileRef->isOnline())
|
||||||
{
|
{
|
||||||
if (hostilRef == getCurrentVictim())
|
if (hostileRef == getCurrentVictim())
|
||||||
{
|
{
|
||||||
setCurrentVictim(nullptr);
|
setCurrentVictim(nullptr);
|
||||||
setDirty(true);
|
setDirty(true);
|
||||||
}
|
}
|
||||||
if (GetOwner() && GetOwner()->IsInWorld())
|
if (GetOwner() && GetOwner()->IsInWorld())
|
||||||
if (Unit* target = ObjectAccessor::GetUnit(*GetOwner(), hostilRef->getUnitGuid()))
|
if (Unit* target = ObjectAccessor::GetUnit(*GetOwner(), hostileRef->getUnitGuid()))
|
||||||
if (GetOwner()->IsInMap(target))
|
if (GetOwner()->IsInMap(target))
|
||||||
GetOwner()->SendRemoveFromThreatListOpcode(hostilRef);
|
GetOwner()->SendRemoveFromThreatListOpcode(hostileRef);
|
||||||
iThreatContainer.remove(hostilRef);
|
iThreatContainer.remove(hostileRef);
|
||||||
iThreatOfflineContainer.addReference(hostilRef);
|
iThreatOfflineContainer.addReference(hostileRef);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (getCurrentVictim() && hostilRef->getThreat() > (1.1f * getCurrentVictim()->getThreat()))
|
if (getCurrentVictim() && hostileRef->getThreat() > (1.1f * getCurrentVictim()->getThreat()))
|
||||||
setDirty(true);
|
setDirty(true);
|
||||||
iThreatContainer.addReference(hostilRef);
|
iThreatContainer.addReference(hostileRef);
|
||||||
iThreatOfflineContainer.remove(hostilRef);
|
iThreatOfflineContainer.remove(hostileRef);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case UEV_THREAT_REF_REMOVE_FROM_LIST:
|
case UEV_THREAT_REF_REMOVE_FROM_LIST:
|
||||||
if (hostilRef == getCurrentVictim())
|
if (hostileRef == getCurrentVictim())
|
||||||
{
|
{
|
||||||
setCurrentVictim(nullptr);
|
setCurrentVictim(nullptr);
|
||||||
setDirty(true);
|
setDirty(true);
|
||||||
}
|
}
|
||||||
iOwner->SendRemoveFromThreatListOpcode(hostilRef);
|
iOwner->SendRemoveFromThreatListOpcode(hostileRef);
|
||||||
if (hostilRef->isOnline())
|
if (hostileRef->isOnline())
|
||||||
iThreatContainer.remove(hostilRef);
|
iThreatContainer.remove(hostileRef);
|
||||||
else
|
else
|
||||||
iThreatOfflineContainer.remove(hostilRef);
|
iThreatOfflineContainer.remove(hostileRef);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ public:
|
|||||||
|
|
||||||
[[nodiscard]] Unit* GetOwner() const { return iOwner; }
|
[[nodiscard]] Unit* GetOwner() const { return iOwner; }
|
||||||
|
|
||||||
Unit* getHostilTarget();
|
Unit* getHostileTarget();
|
||||||
|
|
||||||
void tauntApply(Unit* taunter);
|
void tauntApply(Unit* taunter);
|
||||||
void tauntFadeOut(Unit* taunter);
|
void tauntFadeOut(Unit* taunter);
|
||||||
|
|||||||
@@ -14076,7 +14076,7 @@ Unit* Creature::SelectVictim()
|
|||||||
if (CanHaveThreatList())
|
if (CanHaveThreatList())
|
||||||
{
|
{
|
||||||
if (!target && !m_ThreatMgr.isThreatListEmpty())
|
if (!target && !m_ThreatMgr.isThreatListEmpty())
|
||||||
target = m_ThreatMgr.getHostilTarget();
|
target = m_ThreatMgr.getHostileTarget();
|
||||||
}
|
}
|
||||||
else if (!HasReactState(REACT_PASSIVE))
|
else if (!HasReactState(REACT_PASSIVE))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public:
|
|||||||
{
|
{
|
||||||
{ "setbit", HandleDebugSet32BitCommand, SEC_ADMINISTRATOR, Console::No },
|
{ "setbit", HandleDebugSet32BitCommand, SEC_ADMINISTRATOR, Console::No },
|
||||||
{ "threat", HandleDebugThreatListCommand, SEC_ADMINISTRATOR, Console::No },
|
{ "threat", HandleDebugThreatListCommand, SEC_ADMINISTRATOR, Console::No },
|
||||||
{ "hostil", HandleDebugHostileRefListCommand, SEC_ADMINISTRATOR, Console::No },
|
{ "hostile", HandleDebugHostileRefListCommand, SEC_ADMINISTRATOR, Console::No },
|
||||||
{ "anim", HandleDebugAnimCommand, SEC_ADMINISTRATOR, Console::No },
|
{ "anim", HandleDebugAnimCommand, SEC_ADMINISTRATOR, Console::No },
|
||||||
{ "arena", HandleDebugArenaCommand, SEC_ADMINISTRATOR, Console::No },
|
{ "arena", HandleDebugArenaCommand, SEC_ADMINISTRATOR, Console::No },
|
||||||
{ "bg", HandleDebugBattlegroundCommand, SEC_ADMINISTRATOR, Console::No },
|
{ "bg", HandleDebugBattlegroundCommand, SEC_ADMINISTRATOR, Console::No },
|
||||||
@@ -828,7 +828,7 @@ public:
|
|||||||
HostileReference* ref = target->getHostileRefMgr().getFirst();
|
HostileReference* ref = target->getHostileRefMgr().getFirst();
|
||||||
uint32 count = 0;
|
uint32 count = 0;
|
||||||
|
|
||||||
handler->PSendSysMessage("Hostil reference list of %s (%s)", target->GetName().c_str(), target->GetGUID().ToString().c_str());
|
handler->PSendSysMessage("Hostile reference list of %s (%s)", target->GetName().c_str(), target->GetGUID().ToString().c_str());
|
||||||
|
|
||||||
while (ref)
|
while (ref)
|
||||||
{
|
{
|
||||||
@@ -845,7 +845,7 @@ public:
|
|||||||
ref = ref->next();
|
ref = ref->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
handler->SendSysMessage("End of hostil reference list.");
|
handler->SendSysMessage("End of hostile reference list.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ public:
|
|||||||
void CastSpellOnBug(Creature* target) override
|
void CastSpellOnBug(Creature* target) override
|
||||||
{
|
{
|
||||||
target->SetFaction(FACTION_MONSTER);
|
target->SetFaction(FACTION_MONSTER);
|
||||||
target->AI()->AttackStart(me->getThreatMgr().getHostilTarget());
|
target->AI()->AttackStart(me->getThreatMgr().getHostileTarget());
|
||||||
target->AddAura(SPELL_MUTATE_BUG, target);
|
target->AddAura(SPELL_MUTATE_BUG, target);
|
||||||
target->SetFullHealth();
|
target->SetFullHealth();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user