public static void FindNpc(int npcID) { KNpcPos npcPos = NpcLogic.GetInstance().GetNpcPosByID(npcID); if (npcPos != null) { Vector3 rolePosition = MapUtils.GetMetreFromInt(npcPos.nPathX, npcPos.nPathZ, npcPos.nPathY); Goto(npcPos.MapID, rolePosition); KHeroSetting npcInfo = NpcLogic.GetInstance().GetNpcLocalInfo(npcID); if (null != npcInfo && npcInfo.HeroType == Assets.Scripts.Define.KHeroObjectType.hotMonster) { NPC_ID = npcID; bAutoAttack = true; } //SceneLogic.GetInstance().MainHero.property.CmdAutoAttack = (npcInfo.HeroType == Assets.Scripts.Define.KHeroObjectType.hotMonster); } }
public static void FindNpcAndOpen(int npcID) { if (NpcLogic.GetInstance().CheckNpcNearby(npcID) == true) { EventDispatcher.GameWorld.Dispath(ControllerCommand.OPEN_NPC_PANEL_BYID, npcID); return; } KNpcPos npcPos = NpcLogic.GetInstance().GetNpcPosByID(npcID); if (npcPos != null) { NPC_ID = npcID; Vector3 rolePosition = MapUtils.GetMetreFromInt(npcPos.nPathX, npcPos.nPathZ, npcPos.nPathY); Goto(npcPos.MapID, rolePosition); KHeroSetting npcInfo = NpcLogic.GetInstance().GetNpcLocalInfo(npcID); if (null != npcInfo) { bAutoAttack = (npcInfo.HeroType == Assets.Scripts.Define.KHeroObjectType.hotMonster); } //SceneLogic.GetInstance().MainHero.property.CmdAutoAttack = (npcInfo.HeroType == Assets.Scripts.Define.KHeroObjectType.hotMonster); } }