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); } } } } }