Example #1
0
        private static void AddNpcService(NPC npc,
                                          string cur_service, string[] opts, string lfs)
        {
            NPCService npc_service = null;

            switch (cur_service)
            {
            case "class_trainer":
                npc_service = new ClassTrainingService(ProcessManager.Player.CharClass);
                break;

            case "trade_skill_trainer":
                npc_service = new TradeSkillTrainingService("");
                break;

            case "vendor":
                npc_service = new VendorService(
                    ((opts[1] != null) && opts[1].Equals("1")),
                    ((opts[2] != null) && opts[2].Equals("1")),
                    ((opts[3] != null) && opts[3].Equals("1")));
                break;

            case "taxi":
            case "binder":
                npc_service = new ZoneNpcService(cur_service, ProcessManager.Player.SubZoneText);
                break;

            case "wep_skill_trainer":
            case "banker":
            case "battlemaster":
                npc_service = new NPCService(cur_service);
                break;

            default:
                Output.Instance.Log(lfs, "Unknown npc service type '" +
                                    cur_service + "'");
                break;
            }

            if (npc_service != null)
            {
                npc.AddService(npc_service);
            }
        }