Esempio n. 1
0
 public static ushort Encode(string code, MonsterLib ml, NPCLib nl)
 {
     if (code.StartsWith("G"))
         return CodeOfMonster(ml.Encode(code));
     else if (code.StartsWith("N"))
         return CodeOfNPC(nl.Encode(code));
     else
         return 0;
 }
Esempio n. 2
0
 //public static bool IsDenger(ushort id)
 //{
 //    return id > 2000;
 //}
 public static NMB Decode(ushort id, MonsterLib ml, NPCLib nl)
 {
     if (id < 1000)
         return ml.Decode(id);
     else if (id > 1000 && id < 2000)
         return nl.Decode((ushort)(id - 1000));
     else
         return null;
 }
Esempio n. 3
0
 public LibGroup()
 {
     HL = new HeroLib();
     TL = new TuxLib();
     NL = new NPCLib();
     ML = new MonsterLib();
     EL = new EvenementLib();
     SL = new SkillLib();
     ZL = new OperationLib();
     NJL = new NCActionLib();
     RL = new RuneLib();
     ESL = new ExspLib();
 }
Esempio n. 4
0
 public LibGroup(HeroLib hl, TuxLib tl, NPCLib nl, MonsterLib ml, EvenementLib el,
     SkillLib sl, OperationLib zl, NCActionLib njl, RuneLib rl, ExspLib esl)
 {
     HL = hl; TL = tl; NL = nl; ML = ml; EL = el;
     SL = sl; ZL = zl; NJL = njl; RL = rl; ESL = esl;
 }
Esempio n. 5
0
 public IDictionary<string, NPC> RegisterNPCDelegates(NPCLib lib)
 {
     NPCCottage njc = this;
     IDictionary<string, NPC> nj02 = new Dictionary<string, NPC>();
     foreach (NPC npc in lib.First)
     {
         nj02.Add(npc.Code, npc);
         string njCode = npc.Code;
         var methodDebut = njc.GetType().GetMethod(njCode + "Debut");
         if (methodDebut != null)
             npc.Debut += (player => { methodDebut.Invoke(njc, new object[] { player }); });
     }
     return nj02;
 }