public static int SpawnNPCAroundNPC(int npcindex, ShotTile shottile, CustomNPCDefinition customnpc) { NPC npc = Main.npc[npcindex]; if (npc == null) { return(-1); } int x = (int)(npc.position.X + shottile.X); int y = (int)(npc.position.Y + shottile.Y); return(SpawnCustomNPC(x, y, customnpc)); }
// Returns start position of projectile with shottile offset private Vector2 GetStartPosition(CustomNPCVars origin, ShotTile shottile) { Vector2 offset = new Vector2(shottile.X, shottile.Y); return(origin.mainNPC.frame.Center() + offset); }