63 lines
1.9 KiB
Lua
63 lines
1.9 KiB
Lua
---@class BP_MonsterExerciseRoom_C:BP_MonsterBase_C
|
|
---@field UAESkillManager UUAESkillManagerComponent
|
|
--Edit Below--
|
|
--local BP_MonsterExerciseRoom = {};
|
|
local MonsterBase = require('Script.Blueprint.Monster.BP_MonsterBase')
|
|
|
|
local BP_MonsterExerciseRoom = setmetatable(
|
|
{
|
|
ID = 1007;
|
|
MonsterName = "ExerciseRoom",
|
|
SpawnIndex = -1,
|
|
HasCleanRef = false,
|
|
},
|
|
{
|
|
__index = MonsterBase,
|
|
__metatable = MonsterBase
|
|
}
|
|
);
|
|
|
|
function BP_MonsterExerciseRoom:GetDropRate()
|
|
return 5
|
|
end
|
|
|
|
function BP_MonsterExerciseRoom:ReceiveBeginPlayEx()
|
|
end
|
|
|
|
function BP_MonsterExerciseRoom:ReceiveEndPlayEx()
|
|
if self:HasAuthority() then
|
|
self:CleanSpawnerRef()
|
|
end
|
|
end
|
|
|
|
function BP_MonsterExerciseRoom:ServerOnDeathEx(DeadMonster, KillerController, DamageCauser, KillingHitInfo, KillingHitImpulseDir, KillingHitDamageTypeID, DamageTypeClass, IsHeadShotDamage)
|
|
if DeadMonster == self then
|
|
self:CleanSpawnerRef()
|
|
self:SpawnerSpecialDrop(KillerController.PlayerKey)
|
|
end
|
|
end
|
|
|
|
function BP_MonsterExerciseRoom:SetSpawnIndex(InIndex)
|
|
self.SpawnIndex = InIndex
|
|
end
|
|
|
|
function BP_MonsterExerciseRoom:CleanSpawnerRef()
|
|
if self.SpawnIndex > 0 and self.HasCleanRef == false then
|
|
local Spawner = UGCGameSystem.GameState:GetSpawnerByPlayerKey(self.TargetPlayerKey)
|
|
if Spawner then
|
|
Spawner:CleanMonsterRefByIndex(self.SpawnIndex)
|
|
self.HasCleanRef = true
|
|
end
|
|
end
|
|
end
|
|
|
|
function BP_MonsterExerciseRoom:SpawnerSpecialDrop(KillerPlayerKey)
|
|
local Spawner = UGCGameSystem.GameState:GetSpawnerByPlayerKey(self.TargetPlayerKey)
|
|
if Spawner then
|
|
local DropPos = VectorHelper.Sub(self:K2_GetActorLocation(), {X = 0, Y = 0, Z = self.Capsule.CapsuleHalfHeight})
|
|
local DropRot = self:K2_GetActorRotation()
|
|
Spawner:CheckSpecialDropForMonster(EMonsterType.HangupRoom, DropPos, DropRot, KillerPlayerKey)
|
|
end
|
|
end
|
|
|
|
return BP_MonsterExerciseRoom; |