You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
2.1 KiB
62 lines
2.1 KiB
using ProtoCSClass;
|
|
using xFrame;
|
|
|
|
namespace CoreGame.Render
|
|
{
|
|
public class Handle_OnKillEntity : BaseHandle
|
|
{
|
|
public override void DoHandle(int eid, object msg)
|
|
{
|
|
if (Contexts.IsValid == false)
|
|
return;
|
|
|
|
if (msg is OnKilledMonsterRes res)
|
|
{
|
|
if (res.Ret != 0)
|
|
{
|
|
XLog.LogWarning("击杀怪物,验证失败!!");
|
|
return;
|
|
}
|
|
|
|
var combatEntity = Contexts.Combat.GetEntity(res.DropInfo.Seq);
|
|
if (combatEntity == null)
|
|
{
|
|
XLog.LogWarning("wtf...");
|
|
return;
|
|
}
|
|
combatEntity.isDestroyEnt = true;
|
|
if (RPCConfig.UseLocalRPC)
|
|
{
|
|
DropItemSrv.SimulateCreateDropItem(combatEntity);
|
|
return;
|
|
}
|
|
|
|
var typeIDValueStrings = res.DropInfo.Rewards;
|
|
var pushBossBattleDropItemFinish = false;
|
|
for (int i = 0; i < typeIDValueStrings.Count; i++)
|
|
{
|
|
var typeIDValue = typeIDValueStrings[i];
|
|
var ent = DropItemSrv.DropItem(combatEntity.transformProxy.position, typeIDValue);
|
|
if (ent != null && BattleModule.Instance.worldType == WorldType.BossContinueBattle)
|
|
{
|
|
if (ent.hasInstantToBeAttracted)
|
|
{
|
|
// ent.instantToBeAttracted.specifiedAttractorEid =
|
|
// Contexts.Combat.uIAttractorEntity.creationIndex;
|
|
pushBossBattleDropItemFinish = true;
|
|
}
|
|
else
|
|
{
|
|
XLog.LogDebug("掉落装备错误,不是Instant类型");
|
|
}
|
|
}
|
|
}
|
|
|
|
if (pushBossBattleDropItemFinish)
|
|
{
|
|
CoreUIBridge.CoreGamePushBossBattleDropItemFinish(true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|