Esempio n. 1
0
        private void Sala_OnNpcPracticeChange(Thing sender, object[] obs)
        {
            if (World.Instance.GetFlag(111111002) != 1)
            {
                foreach (var npc in ThingMgr.Instance.NpcList)
                {
                    if (npc.Camp == XiaWorld.Fight.g_emFightCamp.Player)
                    {
                        if (npc.PropertyMgr.CheckExperienceVaild("SALA_Idlest") == false && npc.PropertyMgr.CheckFeature("ProtagonistOfSala") == true)
                        {
                            if (npc.Rank == g_emNpcRank.Disciple)
                            {
                                GlobalSet.SetNpcCanDoWorkAndDisciple(npc);
#if DEBUG
                                KLog.Dbg("initWorkerBehaviour");
#endif
#if DEBUG
                                foreach (var behaviour in GlobalSet.GetNpcBehaviours(npc))
                                {
                                    KLog.Dbg(behaviour.GetType().ToString());
                                }
#endif
                                World.Instance.SetFlag(111111002, 1);
                            }
                        }
                    }
                }
            }

            if (World.Instance.GetFlag(111111002) == 1)
            {
                EventMgr.Instance.RemoveEvent(g_emEvent.NpcPracticeChange, Sala_OnNpcPracticeChange);
            }
        }
Esempio n. 2
0
        public int Main()
        {
            KLog.Dbg("Start Sala");

            GlobalSet.SetSchoolMaxNpcAsOne();

            SalaEvents salaEvents = new SalaEvents();

            salaEvents.InitEventRegister();
            return(0);
        }