public SimpleNpc(int id, BaseGame game, NpcInfo npcInfo, int type) : base(id, game, npcInfo.Camp, npcInfo.Name, npcInfo.ModelID, npcInfo.Blood, npcInfo.Immunity, -1) { if (type == 0) { Type = eLivingType.SimpleNpc; } else { Type = eLivingType.SimpleNpc1; } m_npcInfo = npcInfo; m_ai = ScriptMgr.CreateInstance(npcInfo.Script) as ABrain; if (m_ai == null) { log.ErrorFormat("Can't create abrain :{0}", npcInfo.Script); m_ai = SimpleBrain.Simple; } m_ai.Game = m_game; m_ai.Body = this; try { m_ai.OnCreated(); } catch (Exception ex) { log.ErrorFormat("SimpleNpc Created error:{1}", ex); } }
public SimpleNpc(int id, BaseGame game, NpcInfo npcInfo, int direction, int type) : base(id, game, npcInfo.Camp, npcInfo.Name, npcInfo.ModelID, npcInfo.Blood, npcInfo.Immunity, direction) { if (type == 0) { base.Type = eLivingType.SimpleNpcSpecial; } else { base.Type = eLivingType.SimpleNpcNormal; } this.m_npcInfo = npcInfo; this.m_ai = (ScriptMgr.CreateInstance(npcInfo.Script) as ABrain); if (this.m_ai == null) { SimpleNpc.log.ErrorFormat("Can't create abrain :{0}", npcInfo.Script); this.m_ai = SimpleBrain.Simple; } this.m_ai.Game = this.m_game; this.m_ai.Body = this; try { this.m_ai.OnCreated(); } catch (Exception arg) { SimpleNpc.log.ErrorFormat("SimpleNpc Created error:{1}", arg); } }
public SimpleBoss(int id, BaseGame game, NpcInfo npcInfo, int direction, int type, string actions) : base(id, game, npcInfo.Camp, npcInfo.Name, npcInfo.ModelID, npcInfo.Blood, npcInfo.Immunity, direction) { if (type == 0) { base.Type = eLivingType.SimpleBossSpecial; } if (type == 10) { base.Type = eLivingType.SimpleNpcNormal; } else { base.Type = eLivingType.SimpleBossHard; } base.ActionStr = actions; this.m_mostHateful = new Dictionary <Player, int>(); this.m_npcInfo = npcInfo; this.m_ai = (ScriptMgr.CreateInstance(npcInfo.Script) as ABrain); if (this.m_ai == null) { SimpleBoss.log.ErrorFormat("Can't create abrain :{0}", npcInfo.Script); this.m_ai = SimpleBrain.Simple; } this.m_ai.Game = this.m_game; this.m_ai.Body = this; try { this.m_ai.OnCreated(); } catch (Exception arg) { SimpleBoss.log.ErrorFormat("SimpleBoss Created error:{1}", arg); } }
public SimpleNpc(int id, BaseGame game, NpcInfo npcInfo, int type, int direction, int rank) : base(id, game, npcInfo.Camp, npcInfo.Name, npcInfo.ModelID, npcInfo.Blood, npcInfo.Immunity, direction, npcInfo.MaxBeatDis) { if (type == 0) { base.Type = eLivingType.SimpleNpc; } else { if (type == 1) { base.Type = eLivingType.SimpleNpcNormal; } else { if (type == 2) { base.Type = eLivingType.SimpleNpcDeck; } else { if (type == 3) { base.Type = eLivingType.SimpleWingNpc; } } } } this.m_npcInfo = npcInfo; this.m_ai = (ScriptMgr.CreateInstance(npcInfo.Script) as ABrain); if (this.m_ai == null) { if (this.m_npcInfo.Type != 3) { SimpleNpc.log.ErrorFormat("Can't create abrain :{0}", npcInfo.Script); } this.m_ai = SimpleBrain.Simple; } this.m_ai.Game = this.m_game; this.m_ai.Body = this; this.m_rank = rank; this.Reset(); try { this.m_ai.OnCreated(); } catch (Exception ex) { SimpleNpc.log.ErrorFormat("SimpleNpc Created error:{0}", ex); } }
public SimpleBoss(int id, BaseGame game, NpcInfo npcInfo, int direction, int type) : base(id, game, npcInfo.Camp, npcInfo.Name, npcInfo.ModelID, npcInfo.Blood, npcInfo.Immunity, direction, npcInfo.MaxBeatDis) { if (type == 0) { base.Type = eLivingType.SimpleBoss; } if (type == 1) { base.Type = eLivingType.SimpleBossNormal; } if (type == 2) { base.Type = eLivingType.SimpleBossHard; } if (type == 3) { base.Type = eLivingType.SimpleLongNpc; } this.m_mostHateful = new Dictionary <Player, int>(); this.m_npcInfo = npcInfo; this.m_ai = (ScriptMgr.CreateInstance(npcInfo.Script) as ABrain); if (this.m_ai == null) { SimpleBoss.log.ErrorFormat("Can't create abrain :{0}", npcInfo.Script); this.m_ai = SimpleBrain.Simple; } this.m_ai.Game = this.m_game; this.m_ai.Body = this; this.SimpleBossShooted = (SimpleBoss.SimpleBossShootedEventHanld)Delegate.Combine(this.SimpleBossShooted, new SimpleBoss.SimpleBossShootedEventHanld(this.ShootedSay)); try { this.m_ai.OnCreated(); } catch (Exception ex) { SimpleBoss.log.ErrorFormat("SimpleBoss Created error:{0}", ex); } }
public NormalBoss(int id, BaseGame game, SqlDataProvider.Data.NpcInfo npcInfo, int direction, int type) : base(id, game, npcInfo.Camp, npcInfo.Name, npcInfo.ModelID, npcInfo.Blood, npcInfo.Immunity, direction) { this.m_child = new List <SimpleNpc>(); this.m_boss = new List <SimpleBoss>(); this.m_npc = new List <NormalNpc>(); if (type == 0) { base.Type = eLivingType.SimpleBossSpecial; } if (type == 10) { base.Type = eLivingType.SimpleNpcNormal; } else { base.Type = eLivingType.SimpleBossHard; } this.m_mostHateful = new Dictionary <Player, int>(); this.m_npcInfo = npcInfo; this.m_ai = ScriptMgr.CreateInstance(npcInfo.Script) as ABrain; if (this.m_ai == null) { log.ErrorFormat("Can't create abrain :{0}", npcInfo.Script); this.m_ai = SimpleBrain.Simple; } this.m_ai.Game = base.m_game; this.m_ai.Body = this; try { this.m_ai.OnCreated(); } catch (Exception ex) { log.ErrorFormat("SimpleBoss Created error:{1}", ex); } }