public void ObjectNPC(S.ObjectNPC p) { MapObject ob; NPCObject npc; if (ObjectList.TryGetValue(p.ObjectID, out ob)) { npc = (NPCObject)ob; npc.Name = p.Name; npc.CurrentLocation = new Vector2(p.Location.X, p.Location.Y); npc.Direction = p.Direction; npc.transform.position = CurrentScene.Cells[p.Location.X, p.Location.Y].position; npc.Model.transform.rotation = ClientFunctions.GetRotation(p.Direction); npc.gameObject.SetActive(true); CurrentScene.Cells[p.Location.X, p.Location.Y].AddObject(npc); return; } if (p.Image >= NPCModels.Count) { npc = Instantiate(NPCModels[0], CurrentScene.Cells[p.Location.X, p.Location.Y].position, Quaternion.identity).GetComponent <NPCObject>(); } else { npc = Instantiate(NPCModels[p.Image], CurrentScene.Cells[p.Location.X, p.Location.Y].position, Quaternion.identity).GetComponent <NPCObject>(); } npc.Name = p.Name; npc.ObjectID = p.ObjectID; npc.CurrentLocation = new Vector2(p.Location.X, p.Location.Y); npc.Direction = p.Direction; npc.Model.transform.rotation = ClientFunctions.GetRotation(p.Direction); CurrentScene.Cells[p.Location.X, p.Location.Y].AddObject(npc); ObjectList.Add(p.ObjectID, npc); }
public void Load(S.ObjectNPC info) { Name = info.Name; NameColour = info.NameColour; CurrentLocation = info.Location; Direction = info.Direction; Movement = info.Location; MapLocation = info.Location; GameScene.Scene.MapControl.AddObject(this); Quests = GameScene.QuestInfoList.Where(c => c.NPCIndex == ObjectID).ToList(); Image = info.Image; Colour = info.Colour; LoadLibrary(); Frames = BodyLibrary.Frames ?? FrameSet.DefaultNPC; Light = 10; BaseIndex = 0; SetAction(); }
public static void ObjectNPC(S.ObjectNPC p) { gameManager.ObjectNPC(p); }
public void Load(S.ObjectNPC info) { Name = info.Name; NameColour = info.NameColour; CurrentLocation = info.Location; Direction = info.Direction; Movement = info.Location; MapLocation = info.Location; GameScene.Scene.MapControl.AddObject(this); Quests = GameScene.QuestInfoList.Where(c => c.NPCIndex == ObjectID).ToList(); Image = info.Image; if (info.Image < Libraries.NPCs.Length) { BodyLibrary = Libraries.NPCs[info.Image]; } switch (info.Image) { #region 4 frames + direction + harvest(10 frames) default: Frames = FrameSet.NPCs[0]; break; #endregion #region 4 frames + direction + harvest(20 frames) case 23: Frames = FrameSet.NPCs[1]; break; #endregion #region 4 frames case 62: case 63: case 64: case 65: case 66: case 159: Frames = FrameSet.NPCs[2]; CanChangeDir = false; break; #endregion #region 4 frames + direction case 24: case 25: case 27: case 52: case 61: case 68: case 69: case 70: case 75: case 83: case 90: case 91: case 92: case 93: case 94: case 95: case 100: case 101: case 111: case 112: case 115: case 116: case 117: case 118: case 141: case 142: case 151: case 152: case 163: case 178: case 187: case 188: case 189: case 190: Frames = FrameSet.NPCs[2]; break; #endregion #region 12 frames + animation(10 frames) (large tele) case 33: case 34: Frames = FrameSet.NPCs[3]; CanChangeDir = false; break; #endregion #region 2 frames + animation(9 frames) (small tele) case 79: case 80: Frames = FrameSet.NPCs[4]; CanChangeDir = false; break; #endregion #region 1 frame + animation(6 frames) case 85: case 86: Frames = FrameSet.NPCs[5]; CanChangeDir = false; break; #endregion #region 1 frame case 35: case 36: case 37: case 38: case 39: case 40: case 44: case 45: case 46: case 50: case 51: case 54: case 56: case 67: case 71: case 72: case 73: case 76: case 77: case 96: case 97: case 98: case 99: case 102: case 103: case 104: case 105: case 106: case 107: case 108: case 109: case 113: case 114: case 124: case 125: case 126: case 127: case 128: case 129: case 130: case 131: case 132: case 133: case 134: case 135: case 136: case 137: case 138: case 139: case 140: case 144: case 145: case 146: case 147: case 148: case 149: case 150: case 156: case 157: Frames = FrameSet.NPCs[6]; CanChangeDir = false; break; #endregion #region 10 frames case 53: case 153: case 158: case 161: case 162: case 123: case 175: case 176: Frames = FrameSet.NPCs[7]; CanChangeDir = false; break; #endregion #region 12 frames case 55: Frames = FrameSet.NPCs[8]; CanChangeDir = false; break; #endregion #region 8 frames case 87: case 88: case 89: case 154: Frames = FrameSet.NPCs[9]; CanChangeDir = false; break; #endregion #region 6 frames + direction case 110: case 119: case 122: case 143: case 174: case 185: Frames = FrameSet.NPCs[10]; break; #endregion #region 1 frame + animation(8 frames) case 155: case 191: Frames = FrameSet.NPCs[11]; CanChangeDir = false; break; #endregion #region 11 frames case 164: case 165: case 166: case 167: case 168: case 169: case 170: case 171: case 172: case 173: Frames = FrameSet.NPCs[12]; CanChangeDir = false; break; #endregion #region 20 frames + animation(20 frames) case 59: Frames = FrameSet.NPCs[13]; CanChangeDir = false; break; #endregion #region 4 frames + direction + animation(4 frames) case 81: case 82: Frames = FrameSet.NPCs[14]; break; #endregion #region 4 frames + harvest(6 frames) case 60: case 183: Frames = FrameSet.NPCs[15]; break; #endregion #region 6 frames + animation(12 frames) case 48: Frames = FrameSet.NPCs[16]; CanChangeDir = false; break; #endregion #region 9 frames + direction case 177: Frames = FrameSet.NPCs[17]; break; #endregion #region 5 frames + direction case 179: case 180: case 181: case 184: Frames = FrameSet.NPCs[18]; break; #endregion #region 7 frames + direction + harvest(10 frames) case 182: Frames = FrameSet.NPCs[0]; break; #endregion } Light = 10; SetAction(); }
public void Load(S.ObjectNPC info) { Name = info.Name; NameColour = info.NameColour; CurrentLocation = info.Location; Direction = info.Direction; Movement = info.Location; MapLocation = info.Location; GameScene.Scene.MapControl.AddObject(this); Quests = GameScene.QuestInfoList.Where(c => c.NPCIndex == ObjectID).ToList(); Image = info.Image; Colour = info.Colour; LoadLibrary(); switch (info.Image) { #region 4 frames + direction + harvest(10 frames) default: Frames = FrameSet.NPCs[0]; break; #endregion #region 4 frames + direction + harvest(20 frames) case 23: Frames = FrameSet.NPCs[1]; break; #endregion #region 4 frames case 62: case 63: case 64: case 65: case 66: case 159: Frames = FrameSet.NPCs[2]; CanChangeDir = false; break; #endregion #region 4 frames + direction case 24: case 25: case 27: case 32: case 52: case 61: case 68: case 69: case 70: case 75: case 83: case 90: case 91: case 92: case 93: case 94: case 95: case 100: case 101: case 111: case 112: case 115: case 116: case 117: case 118: case 120: case 141: case 142: case 151: case 152: case 163: case 178: case 186: case 187: case 188: case 189: case 190: Frames = FrameSet.NPCs[2]; break; #endregion #region 12 frames + animation(10 frames) (large tele) case 33: case 34: Frames = FrameSet.NPCs[3]; CanChangeDir = false; break; #endregion #region 2 frames + animation(9 frames) (small tele) case 79: case 80: case 240: case 241: Frames = FrameSet.NPCs[4]; CanChangeDir = false; break; #endregion #region 2 frame + animation(6 frames) case 85: case 86: Frames = FrameSet.NPCs[5]; CanChangeDir = false; break; #endregion #region 1 frame case 35: case 36: case 37: case 38: case 39: case 40: case 44: case 45: case 46: case 50: case 51: case 54: case 56: case 67: case 71: case 72: case 73: case 76: case 77: case 96: case 97: case 98: case 99: case 102: case 103: case 104: case 105: case 106: case 107: case 108: case 109: case 113: case 114: case 124: case 125: case 126: case 127: case 128: case 129: case 130: case 131: case 132: case 133: case 134: case 135: case 136: case 137: case 138: case 139: case 140: case 144: case 145: case 146: case 147: case 148: case 149: case 150: case 156: case 157: case 229: // Ice 9/25 case 230: case 231: case 232: case 233: case 234: case 235: case 236: case 237: case 238: Frames = FrameSet.NPCs[6]; CanChangeDir = false; break; #endregion #region 10 frames case 53: case 153: case 158: case 161: case 162: case 123: case 175: case 176: case 192: case 1000: case 1001: case 1002: case 1003: case 1004: case 1005: case 1006: case 1007: case 1008: case 1009: case 1010: case 1011: Frames = FrameSet.NPCs[7]; CanChangeDir = false; break; #endregion #region 12 frames case 55: Frames = FrameSet.NPCs[8]; CanChangeDir = false; break; #endregion #region 8 frames case 87: case 88: case 89: case 154: Frames = FrameSet.NPCs[9]; CanChangeDir = false; break; #endregion #region 6 frames + direction case 110: case 119: case 122: case 143: case 174: case 185: case 201: //Ice 9/25 case 202: case 203: case 204: case 205: case 206: case 207: case 209: case 210: case 211: case 212: case 215: case 216: case 217: case 218: case 219: case 220: case 221: case 222: case 223: case 224: case 225: case 226: case 227: Frames = FrameSet.NPCs[10]; break; #endregion #region 2 frame + animation(8 frames) case 155: Frames = FrameSet.NPCs[11]; CanChangeDir = false; break; #endregion #region 11 frames case 164: case 165: case 166: case 167: case 168: case 169: case 170: case 171: case 172: case 173: Frames = FrameSet.NPCs[12]; CanChangeDir = false; break; #endregion #region 20 frames + animation(20 frames) case 59: Frames = FrameSet.NPCs[13]; CanChangeDir = false; break; #endregion #region 4 frames + direction + animation(4 frames) case 81: case 82: Frames = FrameSet.NPCs[14]; break; #endregion #region 4 frames + harvest(6 frames) case 60: case 183: Frames = FrameSet.NPCs[15]; break; #endregion #region 6 frames + animation(12 frames) case 48: Frames = FrameSet.NPCs[16]; CanChangeDir = false; break; #endregion #region 9 frames + direction case 177: case 213: //Ice 9/25 Frames = FrameSet.NPCs[17]; break; #endregion #region 5 frames + direction case 179: case 180: case 181: case 184: Frames = FrameSet.NPCs[18]; break; #endregion #region 7 frames + direction + harvest(10 frames) case 182: Frames = FrameSet.NPCs[19]; break; #endregion #region 1 frame + animation(9 frames) case 191: Frames = FrameSet.NPCs[20]; CanChangeDir = false; break; #endregion #region 6 frames #endregion #region 9 Animation case 239: //case 242: //case 243: Frames = FrameSet.NPCs[23]; CanChangeDir = false; break; /* * case 250: * Frames = FrameSet.NPCs[24]; * CanChangeDir = false; * break; */ case 242: case 243: case 244: case 245: Frames = FrameSet.NPCs[25]; CanChangeDir = true; break; case 246: Frames = FrameSet.NPCs[26]; CanChangeDir = false; break; case 247: case 252: Frames = FrameSet.NPCs[27]; CanChangeDir = false; break; case 248: Frames = FrameSet.NPCs[28]; CanChangeDir = false; break; case 249: case 250: case 251: Frames = FrameSet.NPCs[29]; CanChangeDir = false; break; #endregion } Light = 10; BaseIndex = 0; SetAction(); }