This commit is contained in:
luis
2026-05-21 02:04:55 -03:00
parent 5fc2e5e5bb
commit 271883dad9
3 changed files with 44 additions and 0 deletions
@@ -2871,6 +2871,34 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
}
case SMART_ACTION_SUMMON_CREATURE_IN_PERS_VISIBILITY:
{
if (!me)
break;
for (WorldObject* target : targets)
{
Position pos;
if (e.action.sumCreaturePV.summmonInNPCPosition != 0)
pos = me->GetPosition();
else
pos.Relocate(e.target.x, e.target.y, e.target.z, e.target.o);
if (Player* player = target->ToPlayer())
{
if (TempSummon* summon = player->SummonCreature(e.action.sumCreaturePV.creature, pos, static_cast<TempSummonType>(e.action.sumCreaturePV.type), Milliseconds(e.action.sumCreaturePV.duration)))
{
summon->AddPlayerInPersonnalVisibilityList(player->GetGUID());
summon->SetVisible(true);
if (e.action.sumCreaturePV.attackinvoker)
summon->AI()->AttackStart(target->ToUnit());
if (e.action.sumCreaturePV.getphases && GetBaseObject())
summon->GetPhaseShift() = GetBaseObject()->GetPhaseShift();
}
}
}
break;
}
default:
TC_LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry {} SourceType {}, Event {}, Unhandled Action type {}", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
break;
@@ -1925,6 +1925,12 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
break;
}
case SMART_ACTION_SUMMON_CREATURE_IN_PERS_VISIBILITY:
{
if (!IsCreatureValid(e, e.action.sumCreaturePV.creature))
return false;
break;
}
case SMART_ACTION_CALL_KILLEDMONSTER:
{
if (!IsCreatureValid(e, e.action.killedMonster.creature))
@@ -732,6 +732,16 @@ struct SmartAction
uint32 createdBySpell;
} summonCreature;
struct
{
uint32 creature;
uint32 type;
uint32 duration;
uint32 attackinvoker;
uint32 getphases;
uint32 summmonInNPCPosition;
} sumCreaturePV;
struct
{
uint32 threatINC;